Skip to contentSkip to conversation

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

PATCH Applied Tejun Heo 1 participant 2 messages Sep 9, 2024 – Sep 10, 2024 Scheduler

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 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().

Cc Daniel Hodges <[email protected]>
Cc Changwoo Min <[email protected]>
Cc Andrea Righi <[email protected]>
Cc Dan Schatzberg <[email protected]>
---
 kernel/sched/ext.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/ext.c +2 -2
@@ -2050,7 +2050,7 @@ static void enqueue_task_scx(struct rq *
 	rq->scx.nr_running++;
 	add_nr_running(rq, 1);
 
-	if (SCX_HAS_OP(runnable))
+	if (SCX_HAS_OP(runnable) && !task_on_rq_migrating(p))
 		SCX_CALL_OP_TASK(SCX_KF_REST, runnable, p, enq_flags);
 
 	if (enq_flags & SCX_ENQ_WAKEUP)
@@ -2134,7 +2134,7 @@ static bool dequeue_task_scx(struct rq *
 		SCX_CALL_OP_TASK(SCX_KF_REST, stopping, p, false);
 	}
 
-	if (SCX_HAS_OP(quiescent))
+	if (SCX_HAS_OP(quiescent) && !task_on_rq_migrating(p))
 		SCX_CALL_OP_TASK(SCX_KF_REST, quiescent, p, deq_flags);
 
 	if (deq_flags & SCX_DEQ_SLEEP)
author Applied
#1 lore raw
Quoted 11 lines · Tejun Heo

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().

Cc Daniel Hodges <[email protected]>
Cc Changwoo Min <[email protected]>
Cc Andrea Righi <[email protected]>
Cc Dan Schatzberg <[email protected]>

Applied to sched_ext/for-6.12.

Thanks.

Signature · 1 line
tejun