Re: [PATCH 04/13] sched_ext: Use per-CPU DSQs instead of per-node global DSQs in bypass mode

From: Andrea Righi

Date: Mon Nov 10 2025 - 12:31:23 EST


On Mon, Nov 10, 2025 at 06:42:56AM -1000, Tejun Heo wrote:
> Hello,
>
> On Mon, Nov 10, 2025 at 08:42:47AM +0100, Andrea Righi wrote:
> > On Sun, Nov 09, 2025 at 08:31:03AM -1000, Tejun Heo wrote:
> > > Change bypass mode to use dedicated per-CPU bypass DSQs. Each task is queued
> > > on the CPU that it's currently on. Because the default idle CPU selection
> > > policy and direct dispatch are both active during bypass, this works well in
> > > most cases including the above.
> >
> > Is there any reason not to reuse rq->scx.local_dsq for this?
> ...
> > > The bypass DSQ is kept separate from
> > > the local DSQ to allow the load balancer to move tasks between bypass DSQs.
>
> This is the explanation for that. More detailed explanation is that local
> DSQs are protected by rq locks and that makes load balancing across them
> more complicated - ie. we can't keep scanning and transferring while holding
> the source DSQ and if the system is already heavily contended, the system
> may already be melting down on rq locks.

Ok, thanks for the explanation, makes sense and it's definitely better than
what we have right now, so:

Reviewed-by: Andrea Righi <arighi@xxxxxxxxxx>

-Andrea