Re: [PATCH 2/2] thermal: cpufreq_cooling: Reuse effective_cpu_util()

From: Peter Zijlstra
Date: Thu Oct 22 2020 - 05:05:38 EST


On Thu, Oct 22, 2020 at 02:02:55PM +0530, Viresh Kumar wrote:
> On 16-07-20, 13:56, Peter Zijlstra wrote:

> > Another point is that cpu_util() vs turbo is a bit iffy, and to that,
> > things like x86-APERF/MPERF and ARM-AMU got mentioned. Those might also
> > have the benefit of giving you values that match your own sampling
> > interval (100ms), where the sched stuff is PELT (64,32.. based).
>
> I believe the above stuff is more around additional improvements that
> we can do over this change, and probably Lukasz was looking to do
> that.
>
> > So what I've been thinking is that cpufreq drivers ought to be able to
> > supply this method, and only when they lack, can the cpufreq-governor
> > (schedutil) install a fallback.
>
> One of the issues I see with this is that schedutil may not be
> available in all configurations and it is still absolutely fine to
> using the suggested helper to get the energy numbers in such cases, so
> we shouldn't really make it scheutil dependent.

The only constraint on schedutil is SMP I think; aside from that it
should/could always be available.

Given the trainwreck here:

20201022071145.GM2628@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

(you're on Cc), I'm starting to lean more and more towards making it
unconditionally available (when SMP).

Anybody forcing it off either sets performance (in which case we don't
care about energy usage anyway) or they select one of the old (broken)
ondemand/conservative things and I don't give a crap.