In this example, a directory named /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
You can list all available subsystems along with their current mount points (i.e. where the hierarchy they are attached to is mounted) with the lssubsys
[] command:
~]# lssubsys -am
cpu,cpuset,memory /cgroup/cpu_and_mem
net_cls
ns
cpu
cpuacct
devices
freezer
blkio
This output indicates that:
-
the cpu
, cpuset
and memory
subsystems are attached to a hierarchy mounted on /cgroup/cpu_and_mem
, and
-
the 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.