Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
scx: Fix local DSQ comparison in dispatch_to_local_dsq()
Browse files Browse the repository at this point in the history
@Gabant noticed in #218 that our
comparison is backwards in dispatch_to_local_dsq() when determining if the
destination rq in a local dispatch is idle. This could cause us to fail to send
resched IPIs to those remote DSQs when a scheduler uses SCX_DSQ_LOCAL_ON when
dispatching. Thankfully, the issue doesn't happen if dispatching to a local DSQ
from the ops.select_cpu() path, as a resched IPI is sent by the core scheduler
if a task is migrated to an idle core on the wakeup path.

Let's fix it.

Reported-by: @Gabant
Signed-off-by: David Vernet <[email protected]>
  • Loading branch information
Byte-Lab committed Jun 5, 2024
1 parent c071b9d commit 208203e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -2402,7 +2402,7 @@ dispatch_to_local_dsq(struct rq *rq, struct rq_flags *rf, u64 dsq_id,
}

/* if the destination CPU is idle, wake it up */
if (dsp && p->sched_class > dst_rq->curr->sched_class)
if (dsp && p->sched_class < dst_rq->curr->sched_class)
resched_curr(dst_rq);

dispatch_to_local_dsq_unlock(rq, rf, src_rq, locked_dst_rq);
Expand Down

0 comments on commit 208203e

Please sign in to comment.