Re: [RFC PATCH 1/2] sched_ext: Reenqueue IMMED tasks when a higher class wins the pick

From: Kuba Piecuch

Date: Mon Nov 30 2026 - 06:19:22 EST


Hi Tejun,

On Fri, 27 Nov 2026 15:10, Tejun Heo wrote:
> Yeah, wakeup_preempt() misses the transitions which aren't wakeups. This
> looks correct to me, although it also looks like it can replace most of
> what wakeup_preempt() covers.

Right, the reenqueue in wakeup_preempt_scx() is no longer needed for
correctness. wakeup_preempt() always follows it with resched_curr() and
raises next_class, so rq_is_open() refuses new IMMED insertions until the
next pick, and that pick lands above ext and runs scx_settle_pick().

I kept it for latency. The wakeup-time reenqueue returns the IMMED tasks
to the BPF scheduler right away through the deferred irq_work or balance
callback, so they can be moved to another CPU while curr is still on its
way to a preemption point. With only scx_settle_pick(), they wait on the
local DSQ until curr actually schedules, which can take a while if curr
is in a preempt-off or IRQ-off section.

That said, if you'd rather have a single place for this, I can drop the
reenqueue from wakeup_preempt_scx() in v2.

Thanks,
Kuba