aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/cgroups/cgroups.txt
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-07-08 18:02:57 -0400
committerTejun Heo <tj@kernel.org>2014-07-08 18:02:57 -0400
commitb4536f0cab2b18414e26101a2b9d484c5cbea0c0 (patch)
treebdd7ecc28ee6ae1d558f2fa99a49b95ffd19b655 /Documentation/cgroups/cgroups.txt
parentf63070d350e3562baa6196f1043e01cd8da2509a (diff)
cgroup: implement cgroup_subsys->css_reset()
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 previous patches added support for explicitly and implicitly enabled subsystems and showing/hiding their interface files. An explicitly enabled subsystem may become implicitly enabled if it's turned off through "cgroup.subtree_control" but there are subsystems depending on it. In such cases, the subsystem, as it's turned off when seen from userland, shouldn't enforce any resource control. Also, the subsystem may be explicitly turned on later again and its interface files should be as close to the intial state as possible. This patch adds cgroup_subsys->css_reset() which is invoked when a css is hidden. The callback should disable resource control and reset the state to the vanilla state. 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 'Documentation/cgroups/cgroups.txt')
-rw-r--r--Documentation/cgroups/cgroups.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 821de56d1580..10c949b293e4 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -599,6 +599,20 @@ fork. If this method returns 0 (success) then this should remain valid
599while the caller holds cgroup_mutex and it is ensured that either 599while the caller holds cgroup_mutex and it is ensured that either
600attach() or cancel_attach() will be called in future. 600attach() or cancel_attach() will be called in future.
601 601
602void css_reset(struct cgroup_subsys_state *css)
603(cgroup_mutex held by caller)
604
605An optional operation which should restore @css's configuration to the
606initial state. This is currently only used on the unified hierarchy
607when a subsystem is disabled on a cgroup through
608"cgroup.subtree_control" but should remain enabled because other
609subsystems depend on it. cgroup core makes such a css invisible by
610removing the associated interface files and invokes this callback so
611that the hidden subsystem can return to the initial neutral state.
612This prevents unexpected resource control from a hidden css and
613ensures that the configuration is in the initial state when it is made
614visible again later.
615
602void cancel_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) 616void cancel_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
603(cgroup_mutex held by caller) 617(cgroup_mutex held by caller)
604 618