Re: [PATCH v2] sched_ext: idle: Respect task affinity in restricted CPU selection

From: Hui Su

Date: Sun Oct 11 2026 - 13:16:58 EST


Hi Andrea,

> Sorry, I suggested this, but I just realized that we break
> SCX_PICK_IDLE_IN_NODE if we do this. What if we factor the check with
> an helper?

Good catch. You're right that deriving the candidate from task state also
needs to preserve the SCX_PICK_IDLE_IN_NODE constraint.

I'll factor the restricted path into a helper along the lines you
suggested, with the candidate derived from task state first, followed by
the task-affinity, caller-mask, and node checks before consuming the idle
bit.

I'll also add focused validation for the cross-node case and send a v3.

I'll keep SCX_PICK_IDLE_CORE handling as a separate follow-up rather than
mixing it into this fix.

Thanks,
Hui