CPU manager policies¶

Nanos6 offers different policies when handling CPUs through the cpumanager.policy configuration variable:

cpumanager.policy = idle

Activates the idle policy, in which idle threads halt on a blocking condition, while not consuming CPU cycles.

cpumanager.policy = hybrid

Activates the hybrid policy, in which idle threads continue spinning for a specific number of iterations while consuming CPU cycles and then halt on a blocking condition.

cpumanager.policy = busy

Activates the busy policy, in which idle threads continue spinning and never halt, consuming CPU cycles.

cpumanager.policy = lewi

If DLB is enabled, activates the LEnd When Idle policy, which is similar to the idle policy but in DLB mode. In this policy, idle threads lend their CPU to other runtimes or processes.

cpumanager.policy = greedy

If DLB is enabled, activates the greedy policy, which disables lending CPUs from the process’ mask, but allows acquiring and lending external CPUs.

cpumanager.policy = default

Fallback to the default implementation. If DLB is disabled, this policy falls back to the hybrid policy, while if DLB is enabled it falls back to the lewi policy.

Furthermore, the number of busy-wait iterations performed in the hybrid policy can be controlled by the following configuration variable:

cpumanager.busy_iters = X

This variable indicates the collective number of busy iterations performed by all CPUs. Thus, when setting a value of X, idle threads will spin for X/numCPUs iterations before halting. By default this number is set to 240K iterations collectively.