Re: [PATCH v3 02/10] sched/fair: Credit a persistent, queue-depth-scaled vlag margin
From: Vincent Guittot
Date: Mon Jun 15 2026 - 05:16:49 EST
On Fri, 12 Jun 2026 at 08:07, K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
>
> Hello Wanpeng,
>
> On 6/12/2026 7:03 AM, Wanpeng Li wrote:
> > - /* Already eligible: nothing to do. */
> > - if (vlag >= 0)
> > - return;
> > + /* Clamp the margin to entity_lag()'s bound so place_entity() keeps it. */
> > + max_slice = cfs_rq_max_slice(cfs_rq) + TICK_NSEC;
> > + lag_limit = calc_delta_fair(max_slice, se);
> > + margin = eevdf_persistent_margin(cfs_rq, se);
> > + if (lag_limit && margin > lag_limit)
> > + margin = lag_limit;
> > + if (vlag >= 0) {
> > + if ((u64)vlag >= margin)
> > + return;
> > + want = margin - (u64)vlag;
>
> And we are making an eligible task more eligible but *where* is this
> credit coming from? Someone should be paying the price right?
>
> Just adding an arbitrary credit and then moving the task doing the
> yield_to() 0-lag point is simply not fair IMO.
I agree, you can't arbitrarily add some lag to an entity just because
you want it to run.
>
> > + } else {
> > + want = margin + (u64)(-vlag);
> > + }
>
> --
> Thanks and Regards,
> Prateek
>