CPU manager policies¶
Nanos6 offers different policies when handling CPUs through the cpumanager.policy configuration variable:
cpumanager.policy = idleActivates the idle policy, in which idle threads halt on a blocking condition, while not consuming CPU cycles.
cpumanager.policy = hybridActivates 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 = busyActivates the busy policy, in which idle threads continue spinning and never halt, consuming CPU cycles.
cpumanager.policy = lewiIf 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 = greedyIf DLB is enabled, activates the greedy policy, which disables lending CPUs from the process’ mask, but allows acquiring and lending external CPUs.
cpumanager.policy = defaultFallback to the default implementation. If DLB is disabled, this policy falls back to the
hybridpolicy, while if DLB is enabled it falls back to thelewipolicy.
Furthermore, the number of busy-wait iterations performed in the hybrid policy can be controlled by the following configuration variable:
cpumanager.busy_iters = XThis 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.