diff options
| author | Tejun Heo <tj@kernel.org> | 2016-03-08 11:51:26 -0500 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2016-03-08 11:51:26 -0500 |
| commit | f6d635ad341d5cc0b9c7ab46adfbf3bf5886cee4 (patch) | |
| tree | 0dc1bbf73f89b562748e1e2e57ca2262e9903b5e /include/linux | |
| parent | e4857982f49d21c05a84351b56724bf353022355 (diff) | |
cgroup: implement cgroup_subsys->implicit_on_dfl
Some controllers, perf_event for now and possibly freezer in the
future, don't really make sense to control explicitly through
"cgroup.subtree_control". For example, the primary role of perf_event
is identifying the cgroups of tasks; however, because the controller
also keeps a small amount of state per cgroup, it can't be replaced
with simple cgroup membership tests.
This patch implements cgroup_subsys->implicit_on_dfl flag. When set,
the controller is implicitly enabled on all cgroups on the v2
hierarchy so that utility type controllers such as perf_event can be
enabled and function transparently.
An implicit controller doesn't show up in "cgroup.controllers" or
"cgroup.subtree_control", is exempt from no internal process rule and
can be stolen from the default hierarchy even if there are non-root
csses.
v2: Reimplemented on top of the recent updates to css handling and
subsystem rebinding. Rebinding implicit subsystems is now a
simple matter of exempting it from the busy subsystem check.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cgroup-defs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h index 590291d56049..34b42f03fcd8 100644 --- a/include/linux/cgroup-defs.h +++ b/include/linux/cgroup-defs.h | |||
| @@ -451,6 +451,19 @@ struct cgroup_subsys { | |||
| 451 | bool early_init:1; | 451 | bool early_init:1; |
| 452 | 452 | ||
| 453 | /* | 453 | /* |
| 454 | * If %true, the controller, on the default hierarchy, doesn't show | ||
| 455 | * up in "cgroup.controllers" or "cgroup.subtree_control", is | ||
| 456 | * implicitly enabled on all cgroups on the default hierarchy, and | ||
| 457 | * bypasses the "no internal process" constraint. This is for | ||
| 458 | * utility type controllers which is transparent to userland. | ||
| 459 | * | ||
| 460 | * An implicit controller can be stolen from the default hierarchy | ||
| 461 | * anytime and thus must be okay with offline csses from previous | ||
| 462 | * hierarchies coexisting with csses for the current one. | ||
| 463 | */ | ||
| 464 | bool implicit_on_dfl:1; | ||
| 465 | |||
| 466 | /* | ||
| 454 | * If %false, this subsystem is properly hierarchical - | 467 | * If %false, this subsystem is properly hierarchical - |
| 455 | * configuration, resource accounting and restriction on a parent | 468 | * configuration, resource accounting and restriction on a parent |
| 456 | * cgroup cover those of its children. If %true, hierarchy support | 469 | * cgroup cover those of its children. If %true, hierarchy support |
