Re: [PATCH] sched/fair.c: Fix the calculation method of 'lag'

From: Peter Zijlstra
Date: Thu Apr 25 2024 - 07:51:41 EST


On Thu, Apr 25, 2024 at 07:44:59PM +0800, hupu@xxxxxxxx wrote:
> > > From: hupu <hupu@xxxxxxxx>
> > >
> > > I think the 'lag' calculation here is inaccurate.
> > >
> > > Assume that delta needs to be subtracted from v_i to ensure that the
> > > vlag of task i after placement is the same as before.
> >
> > Why ?!? v_i is the unkown, it makes no sense to complicate things by
> > adding extra unknowns.
> >
> > > At this time, the
> > > vlag of task i after placement should be:
> > > vl'_i = V' - (v_i - delta)
> >
> > But but but, you can't have V' without knowing v_i.
> >
>
> Thank you for your patient guidance. I overlooked a important fact that
> v_i is unknown in the process of proof. Below is the complete proof
> process, and it turns out that you are correct.

*phew*, thanks for checking!