cgroups.7: Rewrite the description of cgroup v2 subtree control

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-12-23 13:03:21 +01:00
parent 57cbb0dbb0
commit 8d5f42dc46
1 changed files with 50 additions and 15 deletions

View File

@ -649,22 +649,57 @@ and
other children. other children.
.\" .\"
.SS Cgroups v2 subtree control .SS Cgroups v2 subtree control
When a cgroup Each cgroup in the v2 hierarchy contains the following two files:
.I A/B .TP
is created, its
.IR cgroup.controllers .IR cgroup.controllers
file contains the list of controllers which were active in its parent, A. This is a list of the controllers that are
This is the list of controllers which are available to this cgroup. .I available
No controllers are active until they are enabled through the in this cgroup.
.IR cgroup.subtree_control The contents of this file match the contents of the
file, by writing the list of space-delimited names of the controllers, .I cgroup.subtree_control
each preceded by '+' (to enable) or '\-' (to disable). file in the parent cgroup.
For example, if the .TP
.I freezer .I cgroup.subtree_control
controller is not enabled in This is a list of controllers that are
.IR A/B , .IR active
then it cannot be enabled in .RI ( enabled )
.IR A/B/C . in the cgroup.
The set of controllers in this file is a subset of the set in the
.IR cgroup.controllers
of this cgroup.
The set of active controllers is modified by writing strings to this file
containing space-delimited controller names,
each preceded by '+' (to enable a controller)
or '\-' (to disable a controller), as in the following example:
.IP
.in +4n
.EX
echo '+pids -memory' > x/y/cgroup.subtree_control
.EE
.in
.IP
.PP
Because the list of controllers in
.I cgroup.subtree_control
is a subset of those
.IR cgroup.controllers ,
a controller that has been disabled in one cgroup in the hierarchy
can never be re-enabled in the subtree below that cgroup.
.PP
A cgroup's
.I cgroup.subtree_control
file determines the set of controllers that are exercised in the
.I child
cgroups.
When a controller (e.g.,
.IR pids )
is present in the
.I cgroup.subtree_control
file of a parent cgroup,
then the corresponding controller-interface files (e.g.,
.IR pids.max )
are automatically created in the children of that cgroup
and can be used to exert resource control in the child cgroups.
.\" .\"
.SS Cgroups v2 cgroup.events file .SS Cgroups v2 cgroup.events file
With cgroups v2, a new mechanism is provided to obtain notification With cgroups v2, a new mechanism is provided to obtain notification