Re: [RFC][PATCH 05/10] sched/fair: Unify pick_{,next_}_task_fair()

From: Mike Galbraith
Date: Fri Apr 05 2024 - 22:21:47 EST


Greetings (good to see you back).

On Fri, 2024-04-05 at 12:27 +0200, Peter Zijlstra wrote:
> @@ -8440,19 +8439,20 @@ static struct task_struct *pick_task_fai
>  
>         return task_of(se);
>  }
> -#endif
>  
>  struct task_struct *
>  pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
>  {
> -       struct cfs_rq *cfs_rq = &rq->cfs;
>         struct sched_entity *se;
>         struct task_struct *p;
> +       struct cfs_rq *cfs_rq;
>         int new_tasks;
>  
>  again:
> -       if (!sched_fair_runnable(rq))
> +       p = pick_task_fair(rq);
> +       if (!p)
>                 goto idle;
> +       se = &p->se;
>  
>  #ifdef CONFIG_FAIR_GROUP_SCHED
>         if (!prev || prev->sched_class != &fair_sched_class)

Those who dodge GROUP_SCHED overhead receive a shiny new unused variable warning.

-Mike