mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-26 19:30:24 +00:00
c6ada251ef
We still don't have a reliable and non-racy way to manage cpumasks from the user-space scheduler, so it is quite hard for the scheduler to enforce the proper CPU affinity behavior. Despite checking the cpumask in the BPF part, tasks may still be assigned to a CPU that they cannot use, triggering scheduler errors. For example, it is really easy to crash the scheduler with a simple CPU affinity stress test (`stress-ng --race-sched 8 --timeout 5`): 14:51:28 [WARN] FAIL: SCX_DSQ_LOCAL[_ON] verdict target cpu 1 not allowed for stress-ng-race-[567048] (err=1024) To prevent this issue from happening, create custom DSQ for each CPU available in the system and use these per-CPU DSQs to dispatch all the tasks processed by the user-space scheduler, including the user-space scheduler itself. Then consume the these DSQs from the .dispatch() callback of the respective CPU, to transfer all the tasks to the consuming CPU's local DSQ, preventing the cpumask race condition encountered using SCX_DSQ_LOCAL_ON. With this patch applied the `stress-ng --race-sched N` stress test can be executed successfully (even with large values of N) without causing the scheduler to crash. Signed-off-by: David Vernet <void@manifault.com> [ arighi: kick target cpu to improve responsiveness, update comments ] Signed-off-by: Andrea Righi <andrea.righi@canonical.com> |
||
---|---|---|
.. | ||
scx_layered | ||
scx_rustland | ||
scx_rusty | ||
meson.build | ||
README.md |
RUST SCHEDULERS
Introduction
This directory contains schedulers with user space rust components.
The README in each scheduler directory provides some background and describes the types of workloads or scenarios they're designed to accommodate. For more details on any of these schedulers, please see the header comment in their main.rs or *.bpf.c files.