]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/linux/cgroup.h
cgroup: make css->refcnt clearing on cgroup removal optional
[mirror_ubuntu-bionic-kernel.git] / include / linux / cgroup.h
index be81fafae11f5e030d08402ca088c0f5bb75fd66..565c8034e6c802558671c3c88d9b4ae4e2cf63b0 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/prio_heap.h>
 #include <linux/rwsem.h>
 #include <linux/idr.h>
+#include <linux/workqueue.h>
 
 #ifdef CONFIG_CGROUPS
 
@@ -76,12 +77,16 @@ struct cgroup_subsys_state {
        unsigned long flags;
        /* ID for this css, if possible */
        struct css_id __rcu *id;
+
+       /* Used to put @cgroup->dentry on the last css_put() */
+       struct work_struct dput_work;
 };
 
 /* bits in struct cgroup_subsys_state flags field */
 enum {
        CSS_ROOT, /* This CSS is the root of the subsystem */
        CSS_REMOVED, /* This CSS is dead */
+       CSS_CLEAR_CSS_REFS,             /* @ss->__DEPRECATED_clear_css_refs */
 };
 
 /* Caller must verify that the css is not for root cgroup */
@@ -480,6 +485,18 @@ struct cgroup_subsys {
         * (not available in early_init time.)
         */
        bool use_id;
+
+       /*
+        * If %true, cgroup removal will try to clear css refs by retrying
+        * ss->pre_destroy() until there's no css ref left.  This behavior
+        * is strictly for backward compatibility and will be removed as
+        * soon as the current user (memcg) is updated.
+        *
+        * If %false, ss->pre_destroy() can't fail and cgroup removal won't
+        * wait for css refs to drop to zero before proceeding.
+        */
+       bool __DEPRECATED_clear_css_refs;
+
 #define MAX_CGROUP_TYPE_NAMELEN 32
        const char *name;