diff options
| author | Tejun Heo <tj@kernel.org> | 2025-11-11 09:18:08 -1000 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2025-11-12 06:43:44 -1000 |
| commit | 5ebec443fb96ac305baaae51efe998194f3c87c4 (patch) | |
| tree | f81a76210fe0a7244acabc6b7beb6d2dfd6a8fca /tools/lib/python/abi/helpers.py | |
| parent | a69040ed57f50156e5452474d25c79b9e62075d0 (diff) | |
sched_ext: Exit dispatch and move operations immediately when aborting
62dcbab8b0ef ("sched_ext: Avoid live-locking bypass mode switching") introduced
the breather mechanism to inject delays during bypass mode switching. It
maintains operation semantics unchanged while reducing lock contention to avoid
live-locks on large NUMA systems.
However, the breather only activates when exiting the scheduler, so there's no
need to maintain operation semantics. Simplify by exiting dispatch and move
operations immediately when scx_aborting is set. In consume_dispatch_q(), break
out of the task iteration loop. In scx_dsq_move(), return early before
acquiring locks.
This also fixes cases the breather mechanism cannot handle. When a large system
has many runnable threads affinitized to different CPU subsets and the BPF
scheduler places them all into a single DSQ, many CPUs can scan the DSQ
concurrently for tasks they can run. This can cause DSQ and RQ locks to be held
for extended periods, leading to various failure modes. The breather cannot
solve this because once in the consume loop, there's no exit. The new mechanism
fixes this by exiting the loop immediately.
The bypass DSQ is exempted to ensure the bypass mechanism itself can make
progress.
v2: Use READ_ONCE() when reading scx_aborting (Andrea Righi).
Reported-by: Dan Schatzberg <schatzberg.dan@gmail.com>
Reviewed-by: Dan Schatzberg <schatzberg.dan@gmail.com>
Cc: Andrea Righi <arighi@nvidia.com>
Cc: Emil Tsalapatis <etsal@meta.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/lib/python/abi/helpers.py')
0 files changed, 0 insertions, 0 deletions
