Re: [PATCH 08/20 v3] sched/fair: Add push task mechanism for fair

From: Peter Zijlstra

Date: Wed Nov 11 2026 - 04:06:39 EST


On Mon, Nov 09, 2026 at 05:14:39PM +0100, Vincent Guittot wrote:
> On Mon, 9 Nov 2026 at 16:54, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> > Can't we add the 'p->nr_cpus_allowed > 1' condition to rq->cfs_tasks and
> > use that, rather than adding yet another list? I mean, its used for
> > migration, so excluding all pinned tasks actually makes sense.
>
> rq->cfs_tasks can be quite large (we even take a breath during LB)
> whereas this list should be 1 task most of the time (except during
> wakeup)

Like in the other email; detach_one_task() is also just one task :-)

> > Also, I'm still not sure why we need a plist. The rq->cfs_tasks list is
> > MRU per set_next_task_fair() moving the current task to the front.
>
> The plist was only to reuse struct plist_node pushable_tasks; in
> struct task that is already there for RT

So while plist makes sense for RT, it doesn't make sense for fair or DL.
Notably for DL we keep pushable tasks in a RB tree.

> > So reserve iterating rq->cfs_tasks, skipping blocked and current and
> > such, should get you much the same over-all.
>
> Yes but I was afraid by the overhead of iterating this list which can
> be very long; We have already seen email about bug with thousands of
> tasks queued on the rq

Right, so just take one of the tail and stop there.