Skip to content

Commit 513ed0c

Browse files
committed
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 <[email protected]> Suggested-by: David Vernet <[email protected]> Cc: Daniel Hodges <[email protected]> Cc: Changwoo Min <[email protected]> Cc: Andrea Righi <[email protected]> Cc: Dan Schatzberg <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 750a40d commit 513ed0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/ext.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,7 +2066,7 @@ static void enqueue_task_scx(struct rq *rq, struct task_struct *p, int enq_flags
20662066
rq->scx.nr_running++;
20672067
add_nr_running(rq, 1);
20682068

2069-
if (SCX_HAS_OP(runnable))
2069+
if (SCX_HAS_OP(runnable) && !task_on_rq_migrating(p))
20702070
SCX_CALL_OP_TASK(SCX_KF_REST, runnable, p, enq_flags);
20712071

20722072
if (enq_flags & SCX_ENQ_WAKEUP)
@@ -2150,7 +2150,7 @@ static bool dequeue_task_scx(struct rq *rq, struct task_struct *p, int deq_flags
21502150
SCX_CALL_OP_TASK(SCX_KF_REST, stopping, p, false);
21512151
}
21522152

2153-
if (SCX_HAS_OP(quiescent))
2153+
if (SCX_HAS_OP(quiescent) && !task_on_rq_migrating(p))
21542154
SCX_CALL_OP_TASK(SCX_KF_REST, quiescent, p, deq_flags);
21552155

21562156
if (deq_flags & SCX_DEQ_SLEEP)

0 commit comments

Comments
 (0)