cgconfig service) these commands will fail unless you first unmount existing hierarchies, which will affect the operation of the system. Do not experiment with these instructions on production systems.
mount section of the /etc/cgconfig.conf file as root. Entries in the mount section have the following format:
subsystem= /cgroup/hierarchy;
cgconfig next starts, it will create the hierarchy and attach the subsystems to it.
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_memmount command to mount the hierarchy and simultaneously attach one or more subsystems. For example:
~]# mount -t cgroup -o subsystems name /cgroup/namesubsystems 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_memlssubsys [3] command:
~]# lssubsys -am
cpu,cpuset,memory /cgroup/cpu_and_mem
net_cls
ns
cpuacct
devices
freezer
blkiocpu, cpuset and memory subsystems are attached to a hierarchy mounted on /cgroup/cpu_and_mem, and
net_cls, ns, cpuacct, devices, freezer and blkio subsystems are as yet unattached to any hierarchy, as illustrated by the lack of a corresponding mount point.
lssubsys command is one of the utilities 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.