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

Query about code #218

Closed
Gabant opened this issue Jun 5, 2024 · 2 comments
Closed

Query about code #218

Gabant opened this issue Jun 5, 2024 · 2 comments

Comments

@Gabant
Copy link

Gabant commented Jun 5, 2024

Hi Team
Could you please check if the following code has issues? I'm not sure if I understood this code correctly.
In the new version of the kernel code, the address of idle is the largest. And it seems the purpose of this code and the meaning of the comment do not match.

static enum dispatch_to_local_dsq_ret dispatch_to_local_dsq(...)
{
		... ...
		/* if the destination CPU is idle, wake it up */
		if (dsp && p->sched_class > dst_rq->curr->sched_class)
			resched_curr(dst_rq);
}
Byte-Lab added a commit that referenced this issue 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]>
@Byte-Lab
Copy link
Collaborator

Byte-Lab commented Jun 5, 2024

Good catch! Thanks for looking diligently at the code.

@Byte-Lab
Copy link
Collaborator

Byte-Lab commented Jun 5, 2024

Fixed by #219

@Byte-Lab Byte-Lab closed this as completed 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

No branches or pull requests

2 participants