Skip to main content

plan_cpu_pool_in

Function plan_cpu_pool_in 

Source
pub fn plan_cpu_pool_in(
    requested: usize,
    reserve_coordinator: bool,
    topology: &CpuTopology,
) -> CpuPoolPlan
Expand description

Size a pinned pool, optionally reserving a core for a coordinator thread (the one that polls the device doorbell and drives the pool).

The donation rule is the point: under auto sizing only, and only while more than two workers survive it, the coordinator takes the last physical core and the pool drops from N to N-1 workers. A coordinator that instead time-slices against a full-width pool measurably destabilizes throughput on a fully-subscribed box — it is a spinner, so the worker sharing its core is the one the fork-join barrier waits for, every single step. An explicit thread count is never silently reduced: the operator asked for that width.