Re: [PATCH v6 04/11] cpufreq/schedutil: use rt utilization tracking

From: Peter Zijlstra
Date: Fri Jun 22 2018 - 10:48:58 EST


On Fri, Jun 22, 2018 at 04:11:59PM +0200, Peter Zijlstra wrote:
> On Fri, Jun 22, 2018 at 03:54:24PM +0200, Vincent Guittot wrote:
> > On Fri, 22 Jun 2018 at 15:26, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> > > define f (u,r,n) { return u + ((u/(1-r)) - u) * (u/(1-r))^n; }

> > I'm a bit lost with your example.
> > u = 0.2 (for cfs) and r=0.7 (let say for rt) in your example and idle is 0.1
> >
> > For rt task, we run 0.7 of the time at f=1 then we will select f=0.4
> > for run cfs task with u=0.2 but u is the utilization at f=1 which
> > means that it will take 250% of normal time to execute at f=0.4 which
> > means 0.5 time instead of 0.2 at f=1 so we are going out of time. In
> > order to have enough time to run r and u we must run at least f=0.666
> > for cfs = 0.2/(1-0.7).
>
> Argh.. that is n=0. So clearly I went off the rails somewhere.

Aah, I think the number I've been computing is a 'corrected' u. Not an
f. It made sure that 0 idle got u=1, but no more.