cgroup: implement cgroup_subsys->css_reset()
authorTejun Heo <tj@kernel.org>
Tue, 8 Jul 2014 22:02:57 +0000 (18:02 -0400)
committerTejun Heo <tj@kernel.org>
Tue, 8 Jul 2014 22:02:57 +0000 (18:02 -0400)
commitb4536f0cab2b18414e26101a2b9d484c5cbea0c0
treebdd7ecc28ee6ae1d558f2fa99a49b95ffd19b655
parentf63070d350e3562baa6196f1043e01cd8da2509a
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>
Documentation/cgroups/cgroups.txt
include/linux/cgroup.h
kernel/cgroup.c