Skip to content

Commit

Permalink
sched_ext: Don't trigger ops.quiescent/runnable() on migrations
Browse files Browse the repository at this point in the history
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]>
(cherry picked from commit 513ed0c)
  • Loading branch information
htejun committed Sep 11, 2024
1 parent 7a726f7 commit 08d3923
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ static void enqueue_task_scx(struct rq *rq, struct task_struct *p, int enq_flags
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)
Expand Down Expand Up @@ -2162,7 +2162,7 @@ static void dequeue_task_scx(struct rq *rq, struct task_struct *p, int deq_flags
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)
Expand Down

0 comments on commit 08d3923

Please sign in to comment.