Re: [PATCH 10/18 v2] sched/fair: Add force push task mechanism for fair

From: Vincent Guittot

Date: Mon Oct 12 2026 - 04:18:49 EST


On Sun, 11 Oct 2026 at 19:40, Kayra Cizmeci <kayracizmeci@xxxxxxxxx> wrote:
>
> > >
> > > On Fri, 9 Oct 2026 at 07:53, Kayra Cizmeci <kayracizmeci@xxxxxxxxx> wrote:
> > > >
> > > > > task_tick_cache(rq, curr);
> > > > >
> > > > > - update_misfit_status(curr, rq);
> > > > > - check_update_overutilized_status(task_rq(curr));
> > > > > + if (!tick_pushable_task(curr, rq, rf)) {
> > > > > + update_misfit_status(curr, rq);
> > > > > + check_update_overutilized_status(task_rq(curr));
> > > > > + }
> > > > >
> > > > > task_tick_core(rq, curr);
> > > > > }
> > > >
> > > > Hm.
> > > >
> > > > I think this mechanism added on here does not works.
> > >
> > > Ah yes, while factorizing the code, I removed this main diff between
> > > tick and put events
>
> > In fact this is on purpose.
> > fair_check_pushable_task() is the function that is called to decide
> > wether we try to push or not a task. In the case of short task, we
> > will not push a task that is already alone on the rq
>
> I'm confused. So, is the added tick push mechanism not working at all
> on purpose? For future use or something IDK.

The push mecanism part is generic and includes a push on put prev and
a push on tick when the task is alone and never put back in the
runnable list. For short slice tasks, we don't use the push on tick as
there is no reason to push a short slice task that is alone on the
cpu. The push on tick will be useful for other cases like misfit task,
EAS and cache aware. The latters are not part of this patch

>
> Before the fair_check_pushable_task call on tick_pushable_task():
>
> if (rq->nr_running > 1)
> return false;
>
> So now at the rest of the function, nr_running have to be equal or smaller than 1.
>
> We call fair_check_pushable_task() with next = NULL.
>
> There are only 2 paths that can return true, one of them requires next to be true,
> so it never works. The other one:
>
> if (check_pushable_short_task(rq, p))
> return true;
>
> And check_pushable_short_task() does this:
>
> if (cfs_rq->h_nr_runnable <= 1)
> return false;
>
> As I know, h_nr_runnable should be smaller than (or equal maybe) to nr_running.
>
> nr_running can be 1 max, so if h_nr_runnable can't pass nr_running it will
> always be smaller or equal to 1.
>
> Maybe I'm missing something from the start :-)
>
> Thanks,
>
> Kayra
>