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

From: Christian Loehle

Date: Wed Sep 16 2026 - 06:09:16 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 160-CPU, dual-socket Altra has unusually large 80-CPU
candidate groups at NUMA level, making this particularly prone to stale
idle picks.

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

--fork --fork-max Baseline Patched Change
------------------------------------------------------
1 1 779.19 811.38 +4.13%
8 1 2958.32 2960.18 +0.06%
16 1 5070.95 5247.63 +3.48%
16 4 7692.64 7831.60 +1.81%
32 1 8662.82 8643.39 -0.22%
64 1 11880.47 12096.69 +1.82%

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.407%
fork, 64 creators 1.242% 0.672%

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 | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)


base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
--
2.34.1