Links

Overview

Some sites want to use the "cpu" cgroup controller, in addition to or instead of the cpuset controller


Additionally, they may want to combine zero-CPU jobs (with the cpu controller managing their access to CPU resources) with the cpuset controller, but the current implementation does not allow this, since it will assign a minimum of one CPU for each job it manages.

Approach

For the cpu controller, it is fairly simple: all we need to do is to set 

for the different jobs, after having created a per-job cgroup directory in the controller's hierarchy (as we do for other controllers).

In the configuration file for the cgroup hook, there are some extra tunables:

Weightless jobs are not run in a per-job cpuset created for them, but in the main pbspro.slice cgroup. This allows them to coexist with jobs requiring a strictly positive number of CPUs, which can then be placed onto cpusets with specific CPU threads assigned to them.

In the "cpuset" section, there is a new allow_zero_cpus flag to prevent sites from unwittingly accepting "weightless" jobs into the pspro.slice cpuset (if "cpus" is disabled, they would not even be weightless!):

Quota enforcement on hosts with multithread cores on their CPUs is a bit tricky to control: an application using the A and B threads of a single core is using "200% of a CPU" but only one core, an application using the A threads of two different cores also uses "200% of a CPU" but essentially uses almost two cores. There is no way for the cpu controller to see the difference, although obviously the cpuset controller can often be used to fence jobs into their own sets of threads which alleviates the problem (but then, the utility of the cpu controller is low when you are already using cpusets, except for weightless jobs).

When ncpus_are_cores is set and use_ hyperthreads is set, the quotas are multiplied by the number of threads per core  detected on the host. If cpusets are not used and the application threads are e.g. placed on the A threads of all cores, then the applications are "lucky" and will run faster than if the threads were placed on the A and B threads of a lesser number of CPU cores, although that advantage will disappear if all CPU threads are in use.

Functionality outside of the cgroup hook made possible by enabling the cpu controller

A site may adapt the pbspro parent directory's cpu.cfs_quota_us and cpu.shares, in order to leave "some" more room for the operating system (e.g. throttling all jobs on the system to use only 95% of the CPU resources on the node by using the quota). cpu.shares shold then be compared to the values set by systemd in e.g. system.slice and user.slice.









OSS Site Map

Project Documentation Main Page

Developer Guide Pages