1.2. Relationships Between Subsystems, Hierarchies, Control Groups and Tasks
memorysubsystems (or any number of subsystems) can be attached to a single hierarchy, as long as each one is not attached to any other hierarchy which has any other subsystems attached to it already (see Rule 2).
Figure 1.1. Rule 1
cpu) cannot be attached to more than one hierarchy if one of those hierarchies has a different subsystem attached to it already.
cpusubsystem can never be attached to two different hierarchies if one of those hierarchies already has the
memorysubsystem attached to it. However, a single subsystem can be attached to two hierarchies if both of those hierarchies have only that subsystem attached.
Figure 1.2. Rule 2—The numbered bullets represent a time sequence in which the subsystems are attached.
memorysubsystems are attached to a hierarchy named
cpu_mem_cg, and the
net_clssubsystem is attached to a hierarchy named
net, then a running
httpdprocess could be a member of any one cgroup in
cpu_mem_cg, and any one cgroup in
httpdprocess is a member of might restrict its CPU time to half of that allotted to other processes, and limit its memory usage to a maximum of
1024MB. Additionally, the cgroup in
httpdprocess is a member of might limit its transmission rate to
30MB/s (megabytes per second).
Figure 1.3. Rule 3
httpdtask that is a member of the cgroup named
cpu_and_memhierarchy, and a member of the cgroup
nethierarchy. When that
httpdprocess forks itself, its child process automatically becomes a member of the
half_cpu_1gb_maxcgroup, and the
trans_rate_30cgroup. It inherits the exact same cgroups its parent task belongs to.
Figure 1.4. Rule 4—The numbered bullets represent a time sequence in which the task forks.