Merge tag 'sched-psi-2022-10-14' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / include / linux / cgroup-defs.h
index 7df76b318245f0e104f2bdddfb65ae135632e460..6e01f10f0d88999216270d54031ecb4d7be4d9b5 100644 (file)
@@ -126,11 +126,11 @@ enum {
        CFTYPE_NO_PREFIX        = (1 << 3),     /* (DON'T USE FOR NEW FILES) no subsys prefix */
        CFTYPE_WORLD_WRITABLE   = (1 << 4),     /* (DON'T USE FOR NEW FILES) S_IWUGO */
        CFTYPE_DEBUG            = (1 << 5),     /* create when cgroup_debug */
-       CFTYPE_PRESSURE         = (1 << 6),     /* only if pressure feature is enabled */
 
        /* internal flags, do not use outside cgroup core proper */
        __CFTYPE_ONLY_ON_DFL    = (1 << 16),    /* only on default hierarchy */
        __CFTYPE_NOT_ON_DFL     = (1 << 17),    /* not on default hierarchy */
+       __CFTYPE_ADDED          = (1 << 18),
 };
 
 /*
@@ -384,7 +384,7 @@ struct cgroup {
        /*
         * The depth this cgroup is at.  The root is at depth zero and each
         * step down the hierarchy increments the level.  This along with
-        * ancestor_ids[] can determine whether a given cgroup is a
+        * ancestors[] can determine whether a given cgroup is a
         * descendant of another without traversing the hierarchy.
         */
        int level;
@@ -507,8 +507,8 @@ struct cgroup {
        /* Used to store internal freezer state */
        struct cgroup_freezer_state freezer;
 
-       /* ids of the ancestors at each level including self */
-       u64 ancestor_ids[];
+       /* All ancestors including self */
+       struct cgroup *ancestors[];
 };
 
 /*
@@ -525,11 +525,15 @@ struct cgroup_root {
        /* Unique id for this hierarchy. */
        int hierarchy_id;
 
-       /* The root cgroup.  Root is destroyed on its release. */
+       /*
+        * The root cgroup. The containing cgroup_root will be destroyed on its
+        * release. cgrp->ancestors[0] will be used overflowing into the
+        * following field. cgrp_ancestor_storage must immediately follow.
+        */
        struct cgroup cgrp;
 
-       /* for cgrp->ancestor_ids[0] */
-       u64 cgrp_ancestor_id_storage;
+       /* must follow cgrp for cgrp->ancestors[0], see above */
+       struct cgroup *cgrp_ancestor_storage;
 
        /* Number of cgroups in the hierarchy, used only for /proc/cgroups */
        atomic_t nr_cgrps;