Hardware Reference
In-Depth Information
Best−effort
tasks
Critical
tasks
Linux kernel
Power
Management
CPU Time
Memory
nodes
I/O
bandwidth
Memory
CPU
Networking
Disks
Fig. 6.7 Linux provides RTRM support for different subsystems. Tasks can be grouped in classes
which correspond to different resources access priorities
When a task is associated to a particular cgroup (i.e., a control group), it will get
an access to a portion of the system resources, where we can specify how big or small
that share can be. These shares represent minimum values, not maximum. Thus, if
we give one group 10% of a resource and another 90%, then if the more privileged
group isn't using its full 90%, the other group can have whatever is left over. This
borrowing mechanism allows to optimize resource usage while still granting each
group the resources defined at design time whenever required.
This low-level mechanism was added in Linux mainly for containers and virtual
machines. However, they are not restricted for that solely purpose. One of the most
interesting approaches nowadays is to employ it to manage resources—and therefore
performance—of ordinary processes in a multi-tasking single user system. The idea is
that other subsystems hook into the generic cgroup support to provide new attributes
for them. For example, this allows to account or limit the resources that the tasks in
a control group could access.
Like many other Linux frameworks, the TCG interface is organized as a virtual
file-system, which can be used both to inquire about resources partitioning and to
configure it by simply reading and writing files.
6.3.2.1
CPU Time Management
The CPU subsystem allows to manage the CPU time resource. Different cgroups can
be created and assigned to. The client of this subsystem is the Linux scheduler, which
recalculates the percentage of the total CPU each cgroup will get. For example, we
might create a cgroup for the background processes, another for the logged-in users
Search WWH ::




Custom Search