mirror of
https://github.com/JakeHillion/scx.git
synced 2024-11-30 04:50:24 +00:00
scx_rustland: enable user-space scheduler to preempt other tasks
Use SCX_ENQ_PREEMPT to dispatch the user-space scheduler. This can help to mitigate starvation in presence of many cpu hogs (way more than the amount of available CPUs) running in the system, by giving the scheduler more chances to drain the amount of tasks that may be starving in a waiting state. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
This commit is contained in:
parent
020ae33fe2
commit
8820af8d36
@ -415,7 +415,7 @@ static void dispatch_user_scheduler(void)
|
||||
* Always try to dispatch the user-space scheduler on the current CPU,
|
||||
* if possible.
|
||||
*/
|
||||
dispatch_on_cpu(p, bpf_get_smp_processor_id(), 0);
|
||||
dispatch_on_cpu(p, bpf_get_smp_processor_id(), SCX_ENQ_PREEMPT);
|
||||
__sync_fetch_and_add(&nr_kernel_dispatches, 1);
|
||||
bpf_task_release(p);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user