[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201218133655.GA10123@e123083-lin>
Date: Fri, 18 Dec 2020 14:40:07 +0100
From: Morten Rasmussen <morten.rasmussen@....com>
To: Valentin Schneider <valentin.schneider@....com>
Cc: Peter Zijlstra <peterz@...radead.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Vincent Guittot <vincent.guittot@...aro.org>,
dietmar.eggemann@....com, patrick.bellasi@...bug.net,
lenb@...nel.org, linux-kernel@...r.kernel.org,
ionela.voinescu@....com, qperret@...gle.com,
viresh.kumar@...aro.org
Subject: Re: [PATCH] sched: Add schedutil overview
On Fri, Dec 18, 2020 at 11:33:09AM +0000, Valentin Schneider wrote:
> On 18/12/20 10:32, Peter Zijlstra wrote:
> > +Schedutil / DVFS
> > +----------------
> > +
> > +Every time the scheduler load tracking is updated (task wakeup, task
> > +migration, time progression) we call out to schedutil to update the hardware
> > +DVFS state.
> > +
> > +The basis is the CPU runqueue's 'running' metric, which per the above it is
> > +the frequency invariant utilization estimate of the CPU. From this we compute
> > +a desired frequency like:
> > +
> > + max( running, util_est ); if UTIL_EST
> > + u_cfs := { running; otherwise
> > +
> > + u_clamp := clamp( u_cfs, u_min, u_max )
> > +
> > + u := u_cfs + u_rt + u_irq + u_dl; [approx. see source for more detail]
> > +
> > + f_des := min( f_max, 1.25 u * f_max )
> > +
>
> In schedutil_cpu_util(), uclamp clamps both u_cfs and u_rt. I'm afraid the
> below might just bring more confusion; what do you think?
>
> clamp( u_cfs + u_rt, u_min, u_max ); if UCLAMP_TASK
> u_clamp := { u_cfs + u_rt; otherwise
>
> u := u_clamp + u_irq + u_dl; [approx. see source for more detail]
It is reflecting the code so I think it is worth it. It also fixes the
typo in the original sum (u_cfs -> u_clamp).
> (also, does this need a word about runnable rt tasks => goto max?)
What is actually the intended policy there? I thought it was goto max
unless rt was clamped, but if I read the code correctly in
schedutil_cpu_util() the current policy is only goto max if uclamp isn't
in use at all, including cfs.
The write-up looks good to me.
Reviewed-by: Morten Rasmussen <morten.rasmussen@....com>
Morten
Powered by blists - more mailing lists