[PATCH v2 0/2] sched/fair: Randomize equally shallow idle CPU picks

From: Christian Loehle

Date: Thu Sep 17 2026 - 15:25:01 EST


Concurrent slow-path selectors can converge on the same idle CPU before
either task is enqueued. Remove the idle-recency preference and randomize
equal-latency choices in a single scan.

The testing platform is a 160-CPU, dual-socket Altra with unusually large
80-CPU candidate groups at NUMA level.

Median stress-ng throughput (bogo ops/s):

--fork --fork-max Baseline Patched Change
------------------------------------------------------
1 1 779.19 829.82 +6.50%
16 1 5070.95 5277.62 +4.08%
16 4 7692.64 7963.30 +3.52%
32 1 8662.82 8733.79 +0.82%
64 1 11880.47 12001.01 +1.01%

Separate instrumented runs observed lower conditional stale-pick rates,
i.e. a busy candidate at final return:

Workload Baseline Patched
----------------------------------------------
fork, 32 creators 0.771% 0.335%
fork, 64 creators 1.242% 0.633%

Changes since v1:
- Use u64 latency keys and U64_MAX for unpublished states.
- Sample unpublished-state CPUs only as fallbacks, resetting the reservoir
when the first advertised-state candidate is found.
- Update the Altra measurements.
- Pick up Vincent Guittot's Reviewed-by for patch 1.

Christian Loehle (2):
sched/fair: Drop idle recency from slow-path CPU selection
sched/fair: Randomize equally shallow slow-path candidates

kernel/sched/fair.c | 31 ++++++++++++-------------------
1 file changed, 12 insertions(+), 19 deletions(-)


base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
--
2.34.1