Re: [RFC][PATCH 2/3] sched: Add support to pick functions to take rf
From: Tejun Heo
Date: Wed Oct 08 2025 - 16:34:44 EST
Hello,
On Wed, Oct 08, 2025 at 05:22:42PM +0200, Vincent Guittot wrote:
> On Wed, 8 Oct 2025 at 15:58, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > On Wed, Oct 08, 2025 at 03:16:58PM +0200, Vincent Guittot wrote:
> >
> > > > +static struct task_struct *
> > > > +fair_server_pick_task(struct sched_dl_entity *dl_se, struct rq_flags *rf)
> > > > {
> > > > - return pick_next_task_fair(rq, prev, NULL);
> > >
> > > The special case of a NULL rf pointer is used to skip
> > > sched_balance_newidle() at the end of pick_next_task_fair() in the
> > > pick_next_task() slo path when prev_balance has already it. This means
> > > that it will be called twice if prev is not a fair task.
> >
> > Oh right. I suppose we can simply remove balance_fair.
>
> That was the option that I also had in mind but this will change from
> current behavior and I'm afraid that sched_ext people will complain.
> Currently, if prev is sched_ext, we don't call higher class.balance()
> which includes the fair class balance_fair->sched_balance_newidle. If
> we now always call sched_balance_newidle() at the end
> pick_next_task_fair(), we will try to pull a fair task at each
> schedule between sched_ext tasks
If we pass in @prev into pick(), can't pick() decide whether to newidle
balance or not based on that?
Thanks.
--
tejun