Re: [PATCH v2 5/7] sched/fair: Increase weight bits for avg_vruntime

From: Peter Zijlstra

Date: Mon Mar 30 2026 - 05:34:16 EST


On Mon, Mar 30, 2026 at 01:25:59PM +0530, K Prateek Nayak wrote:

> On a tangential note, now that we only yield on eligibility, would
> something like below make sense?
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 226509231e67..55ab1f58d703 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9265,9 +9265,10 @@ static void yield_task_fair(struct rq *rq)
> struct sched_entity *se = &curr->se;
>
> /*
> - * Are we the only task in the tree?
> + * Single task is always eligible on the cfs_rq.
> + * Don't pull the vruntime needlessly.
> */
> - if (unlikely(rq->nr_running == 1))
> + if (unlikely(cfs_rq->nr_queued == 1))
> return;
>
> clear_buddies(cfs_rq, se);

Right, with the addition of sched_ext this could actually make a
difference.