diff options
author | Tejun Heo <tj@kernel.org> | 2014-07-08 18:02:57 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-07-08 18:02:57 -0400 |
commit | f63070d350e3562baa6196f1043e01cd8da2509a (patch) | |
tree | 79880b53e57b62df7984aaeeb5340d7853e4ace5 /include/linux/cgroup.h | |
parent | 667c24917144e34880f821486bf0a6e4d05a3a14 (diff) |
cgroup: make interface files visible iff enabled on cgroup->subtree_control
cgroup is implementing support for subsystem dependency which would
require a way to enable a subsystem even when it's not directly
configured through "cgroup.subtree_control".
The preceding patch distinguished cgroup->subtree_control and
->child_subsys_mask where the former is the subsystems explicitly
configured by the userland and the latter is all enabled subsystems
currently is equal to the former but will include subsystems
implicitly enabled through dependency.
Subsystems which are enabled due to dependency shouldn't be visible to
userland. This patch updates cgroup_subtree_control_write() and
create_css() such that interface files are not created for implicitly
enabled subsytems.
* @visible paramter is added to create_css(). Interface files are
created only when true.
* If an already implicitly enabled subsystem is turned on through
"cgroup.subtree_control", the existing css should be used. css
draining is skipped.
* cgroup_subtree_control_write() computes the new target
cgroup->child_subsys_mask and create/kill or show/hide csses
accordingly.
As the two subsystem masks are still kept identical, this patch
doesn't introduce any behavior changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 8d52c8e5b510..5287f931680a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -208,6 +208,8 @@ struct cgroup { * ->subtree_control is the one configured through * "cgroup.subtree_control" while ->child_subsys_mask is the * effective one which may have more subsystems enabled. + * Controller knobs are made available iff it's enabled in + * ->subtree_control. */ unsigned int subtree_control; unsigned int child_subsys_mask; |