|
4723.
|
|
|
mount -t cgroup -o devices,memory,freezer cgroup /cgroup1
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:100(command)
|
|
4724.
|
|
|
would instantiate a hierarchy with the devices and memory cgroups comounted. A child cgroup "child1" can be created using 'mkdir'
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:104(para)
|
|
4725.
|
|
|
mkdir /cgroup1/child1
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:109(command)
|
|
4726.
|
|
|
and tasks can be moved into the new child cgroup by writing their process IDs into the 'tasks' or 'cgroup.procs' file:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:113(para)
|
|
4727.
|
|
|
sleep 100 & echo $! > /cgroup1/child1/cgroup.procs
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:118(command)
|
|
4728.
|
|
|
Other administration is done through files in the cgroup directories. For instance, to freeze all tasks in child1,
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:123(para)
|
|
4729.
|
|
|
echo FROZEN > /cgroup1/child1/freezer.state
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:128(command)
|
|
4730.
|
|
|
A great deal of information about cgroups and its subsystems can be found under the cgroups documentation directory in the kernel source tree (see Resources).
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:132(para)
|
|
4731.
|
|
|
Delegation
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:141(title)
|
|
4732.
|
|
|
Cgroup files and directories can be owned by non-root users, enabling delegation of cgroup administration. In general, the kernel enforces the hierarchical constraints on limits, so that for instance if devices cgroup <filename>/child1</filename> cannot access a disk drive, then <filename>/child1/child2</filename> cannot give itself those rights.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/cgroups.xml:143(para)
|