scx_rustland: always dispatch kthreads on the local CPU

Adding extra overhead to any kthread can potentially slow down the
entire system, so make sure this never happens by dispatching all
kthreads directly on the same local CPU (not just the per-CPU kthreads),
bypassing the user-space scheduler.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
This commit is contained in:
Andrea Righi 2023-12-27 13:29:22 +01:00
parent f0ece7af6b
commit 9237e1d835

View File

@ -297,12 +297,12 @@ static bool is_task_cpu_available(struct task_struct *p)
struct task_ctx *tctx;
/*
* Always dispatch per-CPU kthread on the same CPU, bypassing the
* user-space scheduler (in this way we can to prioritize critical
* kernel threads that may potentially slow down the entire system if
* they are blocked for too long).
* Always dispatch kthread on the same CPU, bypassing the user-space
* scheduler (in this way we can to prioritize critical kernel threads
* that may potentially slow down the entire system if they are blocked
* for too long).
*/
if (is_kthread(p) && p->nr_cpus_allowed == 1)
if (is_kthread(p))
return true;
/*