Re: [PATCH sched_ext/for-7.5 1/2] sched_ext: idle: Don't stack a sync wakee behind a higher-class task
From: Andrea Righi
Date: Fri Dec 04 2026 - 10:55:19 EST
Hi Hang,
On Fri, Dec 04, 2026 at 12:23:24PM +0000, Hang Zhengyang wrote:
> Hi Andrea,
>
> Thanks for the review. I agree that this doesn't fix the root cause,
> but I looked at the callers and couldn't find a better fix that would
> work upstream. pipe_write() and sock_def_readable() use a sync wakeup on
> purpose, so that the reader runs soon, and at that point they can't
> know whether the writer keeps running. fair copes with this:
> select_idle_sibling() moves the wakee to an idle CPU when the waker's
> CPU is busy. The ext shortcut picks the waker's CPU even while other
> CPUs are idle, so behind an RT or DL waker, the wakee can wait for the
> dl_server for up to about a second.
>
> If you have a solution in mind, or can share the direction, I'm happy
> to implement it. Or I can drop the patch if you prefer to keep it as it
> is.
I think it makes sense to drop the patch for now. A possible direction
to address the issue would require auditing the sync wakeup users in the
kernel and ensuring that they honor the contract. Which is probably
doable, but on the scx side, I think we should leave the default
behavior as it is.
BPF schedulers that need custom sync wakeup handling can clear
SCX_WAKE_SYNC in ops.select_cpu() before calling scx_select_cpu_dfl(),
then apply their own policy. Or they can ignore the helper entirely and
implement their own idle CPU selection. Ultimately, scx_select_cpu_dfl()
is just a built-in default and BPF schedulers are free to replace it
with their own logic.
Thanks,
-Andrea