Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched_ext: Don't trigger ops.quiescent/runnable() on migrations

A task moving across CPUs should not trigger quiescent/runnable task state
events as the task is staying runnable the whole time and just stopping and
then starting on different CPUs. Suppress quiescent/runnable task state
events if task_on_rq_migrating().

Signed-off-by: Tejun Heo <tj@kernel.org>
Suggested-by: David Vernet <void@manifault.com>
Cc: Daniel Hodges <hodges.daniel.scott@gmail.com>
Cc: Changwoo Min <multics69@gmail.com>
Cc: Andrea Righi <andrea.righi@linux.dev>
Cc: Dan Schatzberg <schatzberg.dan@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

+2 -2
+2 -2
kernel/sched/ext.c
··· 2066 2066 rq->scx.nr_running++; 2067 2067 add_nr_running(rq, 1); 2068 2068 2069 - if (SCX_HAS_OP(runnable)) 2069 + if (SCX_HAS_OP(runnable) && !task_on_rq_migrating(p)) 2070 2070 SCX_CALL_OP_TASK(SCX_KF_REST, runnable, p, enq_flags); 2071 2071 2072 2072 if (enq_flags & SCX_ENQ_WAKEUP) ··· 2150 2150 SCX_CALL_OP_TASK(SCX_KF_REST, stopping, p, false); 2151 2151 } 2152 2152 2153 - if (SCX_HAS_OP(quiescent)) 2153 + if (SCX_HAS_OP(quiescent) && !task_on_rq_migrating(p)) 2154 2154 SCX_CALL_OP_TASK(SCX_KF_REST, quiescent, p, deq_flags); 2155 2155 2156 2156 if (deq_flags & SCX_DEQ_SLEEP)