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

scx: Fix local DSQ comparison in dispatch_to_local_dsq() #219

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

Byte-Lab
Copy link
Collaborator

@Byte-Lab Byte-Lab commented Jun 5, 2024

@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]

@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]>
We should have _some_ test that exercises that codepath.

Signed-off-by: David Vernet <[email protected]>
@Byte-Lab Byte-Lab requested a review from htejun June 5, 2024 18:42
@Byte-Lab Byte-Lab merged commit 95e71aa into sched_ext Jun 5, 2024
1 check failed
@Byte-Lab Byte-Lab deleted the dispatch_local branch June 5, 2024 19:19
@Byte-Lab Byte-Lab mentioned this pull request Jun 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants