Re: [PATCH v3 02/10] sched/fair: Credit a persistent, queue-depth-scaled vlag margin

From: K Prateek Nayak

Date: Fri Jun 12 2026 - 02:08:34 EST


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.

> + } else {
> + want = margin + (u64)(-vlag);
> + }

--
Thanks and Regards,
Prateek