aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-03-19 10:23:54 -0400
committerTejun Heo <tj@kernel.org>2014-03-19 10:23:54 -0400
commit944196278d3dea0cece1636de417b56897d9a108 (patch)
tree5751584bf0c343aec51b662641ec71acb79a762e /include/linux/cgroup.h
parent5df3603229e520442502ff7fc5715c77bbf61912 (diff)
cgroup: move ->subsys_mask from cgroupfs_root to cgroup
cgroupfs_root->subsys_mask represents the controllers attached to the hierarchy. This patch moves the field to cgroup. Subsystem initialization and rebinding updates the top cgroup's subsys_mask. For !root cgroups, the subsys_mask bits are set from create_css() and cleared from kill_css(), which effectively means that all cgroups will have the same subsys_mask as the top cgroup. While this doesn't make any difference now, this will help implementation of the default unified hierarchy where !root cgroups may have subsets of the top_cgroup's subsys_mask. While at it, __kill_css() is split out of kill_css(). The former doesn't care about the subsys_mask while the latter becomes noop if the controller is already killed and clears the matching bit if not before proceeding to killing the css. This will be used later by the default unified hierarchy implementation. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 9f4f253f0e47..3752a0182c94 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -173,6 +173,9 @@ struct cgroup {
173 */ 173 */
174 u64 serial_nr; 174 u64 serial_nr;
175 175
176 /* The bitmask of subsystems attached to this cgroup */
177 unsigned long subsys_mask;
178
176 /* Private pointers for each registered subsystem */ 179 /* Private pointers for each registered subsystem */
177 struct cgroup_subsys_state __rcu *subsys[CGROUP_SUBSYS_COUNT]; 180 struct cgroup_subsys_state __rcu *subsys[CGROUP_SUBSYS_COUNT];
178 181
@@ -276,9 +279,6 @@ enum {
276struct cgroupfs_root { 279struct cgroupfs_root {
277 struct kernfs_root *kf_root; 280 struct kernfs_root *kf_root;
278 281
279 /* The bitmask of subsystems attached to this hierarchy */
280 unsigned long subsys_mask;
281
282 /* Unique id for this hierarchy. */ 282 /* Unique id for this hierarchy. */
283 int hierarchy_id; 283 int hierarchy_id;
284 284