Re: [PATCH 5/8] sched/eevdf: Reset lag when waking up on idle cpu
From: Vincent Guittot
Date: Tue Sep 22 2026 - 01:58:49 EST
On Mon, 21 Sept 2026 at 18:06, Kayra Cizmeci <kayracizmeci@xxxxxxxxx> wrote:
>
> Hi Vincent,
>
> > @@ -908,18 +908,25 @@ void decay_entity_lag(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
> > if (vlag <= 0)
> > return;
> >
> > - if (flags & ENQUEUE_MIGRATED)
> > - return;
> > + rq = rq_of(cfs_rq);
> >
> > - /* Compute the sleep time */
> > - delta_exec = rq_clock_task(rq_of(cfs_rq)) - se->exec_start;
> > - if (unlikely(delta_exec <= 0))
> > - return;
> > + if (rq->curr == rq->idle) {
> > + /* You can't claim any lag when waking on idle CPU */
> > + vlag = 0;
> > + } else if (!(flags & ENQUEUE_MIGRATED)) {
> > + u64 now = rq_clock_task(rq);
> > + s64 delta_exec;
> >
> > - vlag -= calc_delta_fair(delta_exec, se);
> > + /* Compute the sleep time */
> > + delta_exec = now - se->exec_start;
> > + if (unlikely(delta_exec <= 0))
> > + return;
> >
> > - /* vlag can't become negative while sleeping */
> > - se->vlag = max(0, vlag);
> > + vlag -= calc_delta_fair(delta_exec, se);
> > +
> > + /* vlag can't become neg while sleeping */
> > + se->vlag = max(0, vlag);
> > + }
> > }
>
> When if (rq->curr == rq->idle) runs the else if does not. So on that branch
> we just set local vlag to 0. I think you wanted to set se->vlag to 0?
Argh, I messed up when cleaning the patch
yes it should be se->vlag = 0 for idle case
I re-ran tests, and the latency with hackbench decreased a bit
scheduling latency (us) for cyclictest and hackbench
tip/sched/core| this patchset
slice 8ms / 16ms | 8ms / 16 ms
99th Percentile 75 | 70 ( 7 %)
99.9th Percentile 730 | 532 (+27 %)
Maximum 15996 | 5290 (+67 %)
Thanks
>
>
> Thanks,
> Kayra :>