Re: [PATCHSET sched_ext/for-7.5] sched_ext: Start ext_server from the tick

From: Andrea Righi

Date: Sat Nov 28 2026 - 14:46:13 EST


Hi Tejun,

On Fri, Nov 27, 2026 at 05:44:17AM -1000, Tejun Heo wrote:
> On Wed, Nov 25, 2026 at 06:56:14AM -1000, Tejun Heo wrote:
> > Hello, Peter.
> >
> > On Wed, Nov 25, 2026 at 02:57:23PM +0100, Peter Zijlstra wrote:
> > > Could you perhaps punt the responsibility to the DSQ? Each DSQ has both:
> > >
> > > - a count of how many tasks it has
> > > - a sense of what CPUs it targets
> > >
> > > Right? So can it make sure nr_tasks CPUs of its destination are running
> > > ext_server?
> >
> > The problem is that runnable tasks may not be on any DSQ. The BPF scheduler
> > can hold tasks in its own data structures between ops.enqueue() and
> > ops.dispatch(), and the newer schedulers do. Also, only local DSQs have
> > target CPUs. Any CPU's ops.dispatch() can consume from a user DSQ. So, all
> > the kernel can tell is that something is runnable, and only ops.dispatch()
> > knows which CPU it is for.
>
> Any thoughts on this?

How about starting the ext_server on local DSQ insertion and when BPF
kicks a target CPU (including SCX_KICK_IDLE)?

For local DSQs, rq_owned_post_enq() already holds the destination rq
lock. For shared DSQs or BPF-held tasks, BPF can identify a consumer
by kicking it after publishing the work. Most scx schedulers already
request an SCX_KICK_IDLE after shared-DSQ insertion, so they would be
covered.

We would need to start the server rather than discard the kick when a
higher-class task is running, including in the idle-kick skip path. The
DL reservation would govern when SCX actually gets to dispatch.

This would avoid the global accounting and periodic probing of unrelated
CPUs and wouldn't depend on a running tick. Would that be an acceptable
tradeoff?

Thanks,
-Andrea