mount
section of the /etc/cgconfig.conf
file as root. Entries in the mount
section have the following format:
subsystem
= /cgroup/hierarchy
;
cpu_and_mem
and attaches the cpu
, cpuset
, cpuacct
, and memory
subsystems to it.
mount { cpuset = /cgroup/cpu_and_mem; cpu = /cgroup/cpu_and_mem; cpuacct = /cgroup/cpu_and_mem; memory = /cgroup/cpu_and_mem; }
~]# mkdir /cgroup/name
~]# mkdir /cgroup/cpu_and_mem
mount
command to mount the hierarchy and simultaneously attach one or more subsystems. For example:
mount -t cgroup -o subsystems
name
/cgroup/name
subsystems
is a comma-separated list of subsystems and name
is the name of the hierarchy. Brief descriptions of all available subsystems are listed in Available Subsystems in Red Hat Enterprise Linux, and Chapter 3, Subsystems and Tunable Parameters provides a detailed reference.
/cgroup/cpu_and_mem
already exists, which will serve as the mount point for the hierarchy that we create. We will attach the cpu
, cpuset
and memory
subsystems to a hierarchy we name cpu_and_mem
, and mount
the cpu_and_mem
hierarchy on /cgroup/cpu_and_mem
:
~]# mount -t cgroup -o cpu,cpuset,memory cpu_and_mem /cgroup/cpu_and_mem
lssubsys
[3] command:
~]# lssubsys -am
cpu,cpuset,memory /cgroup/cpu_and_mem
net_cls
ns
cpu
cpuacct
devices
freezer
blkio
cpu
, cpuset
and memory
subsystems are attached to a hierarchy mounted on /cgroup/cpu_and_mem
, and
net_cls
, ns
, cpu
, cpuacct
, devices
, freezer
and blkio
subsystems are as yet unattached to any hierarchy, as illustrated by the lack of a corresponding mount point.
[3]
The lssubsys
command is one of the utiilties provided by the libcgroup package. You must install libcgroup to use it: refer to Chapter 2, Using Control Groups if you are unable to run lssubsys
.