Re: [PATCH v6 04/11] cpufreq/schedutil: use rt utilization tracking
From: Peter Zijlstra
Date: Fri Jun 22 2018 - 09:26:42 EST
On Fri, Jun 22, 2018 at 02:23:22PM +0200, Vincent Guittot wrote:
> On Fri, 22 Jun 2018 at 13:37, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > I suppose we can make it more complicated, something like:
> >
> > u u
> > f := u + (--- - u) * (---)^n
> > 1-r 1-r
> >
> > Where: u := cfs util
> > r := \Sum !cfs util
> > f := frequency request
> >
> > That would still satisfy all criteria I think:
> >
> > r = 0 -> f := u
> > u = (1-r) -> f := 1
> >
> > and in particular:
> >
> > u << (1-r) -> f ~= u
> >
> > which casuses less inflation than the linear thing where there is idle
> > time.
> And we are not yet at the right value for quentin's example as we need
> something around 0.75 for is example
$ bc -l
define f (u,r,n) { return u + ((u/(1-r)) - u) * (u/(1-r))^n; }
f(.2,.7,0)
.66666666666666666666
f(.2,.7,2)
.40740740740740740739
f(.2,.7,4)
.29218106995884773661
So at 10% idle time, we've only inflated what should be 20% to 40%, that
is entirely reasonable I think. The linear case gave us 66%. But feel
free to increase @n if you feel that helps, 4 is only one mult more than
2 and gets us down to 29%.
> The non linearity only comes from dl so if we want to use the equation
> above, u should be (cfs + rt) and r = dl
Right until we allow RT to run at anything other than f=1. Once we allow
rt util capping, either through Patrick's thing or CBS servers or
whatever, we get:
f = min(1, f_rt + f_dl + f_cfs)
And then u_rt does want to be part of r. And while we do run RT at f=1,
it doesn't matter either way around I think.
> But this also means that we will start to inflate the utilization to
> get higher OPP even if there is idle time and lost the interest of
> using dl bw
You get _some_ inflation, but only if there is actual cfs utilization to
begin with.
And that is my objection to that straight sum thing; there the dl util
distorts the computed dl bandwidth thing even if there is no cfs
utilization.