Re: [PATCH 7/7 v3] sched: fix wrong utilization accounting when switching to fair class

From: bsegall
Date: Thu Sep 22 2016 - 13:10:25 EST


Peter Zijlstra <peterz@xxxxxxxxxxxxx> writes:

> On Tue, Sep 20, 2016 at 09:59:08AM -0700, bsegall@xxxxxxxxxx wrote:
>> Peter Zijlstra <peterz@xxxxxxxxxxxxx> writes:
>> > Google has this patch-set replacing min_vruntime with an actual global
>> > 0-lag, which greatly simplifies things. If only they'd post it sometime
>> > :/ /me prods pjt and ben with a sharp stick :-)
>> >
>>
>> No, we don't have any patches like that. I wish, we've screwed up
>> vruntime a couple of times too.
>
> Hurm, I was sure you guys were doing something entirely different from
> what mainline does.
>
> IIRC Andrew Hunter was 'working' on getting that posted. See also:
> lkml.kernel.org/r/CADroS=6Ncpao6WWXBxboB6quqUP96EnjbsDUZqNgASd_PzDGaA@xxxxxxxxxxxxxx

Oh, I was looking at the wrong branches. Sigh.

Yeah, we just do an unlocked "se->vruntime -= old->min_vruntime -
new->min_vruntime;" in migrate, and remove/add it in
switched_from/switched_to_fair.

This still isn't replacing min_vruntime with anything cool, perhaps you
and Andrew were using opposite definitions of relative here - we have
fair tasks always having a vruntime that is relative to min_vruntime,
rather than temporarily having the 0-based one when doing
non-SLEEP/WAKEUP.