Re: [Patch v4 6/6] sched: thermal: Enable tuning of decay period

From: Peter Zijlstra
Date: Mon Oct 28 2019 - 11:42:27 EST


On Tue, Oct 22, 2019 at 04:34:25PM -0400, Thara Gopinath wrote:
> Thermal pressure follows pelt signas which means the
> decay period for thermal pressure is the default pelt
> decay period. Depending on soc charecteristics and thermal
> activity, it might be beneficial to decay thermal pressure
> slower, but still in-tune with the pelt signals.
> One way to achieve this is to provide a command line parameter
> to set the decay coefficient to an integer between 0 and 10.
>
> Signed-off-by: Thara Gopinath <thara.gopinath@xxxxxxxxxx>
> ---
> v3->v4:
> - Removed the sysctl setting to tune decay period and instead
> introduced a command line parameter to control it. The rationale
> here being changing decay period of a PELT signal runtime can
> result in a skewed average value for atleast some cycles.

TBH, I don't care too much about that. If you touch a knob, you'd better
know what it does anyway.

> void trigger_thermal_pressure_average(struct rq *rq)
> {
> - update_thermal_load_avg(rq_clock_task(rq), rq,
> + update_thermal_load_avg(rq_clock_task(rq) >>
> + sched_thermal_decay_coeff, rq,

You see, 'coefficient' means 'multiplicative factor', but what we have
here is a negative exponent. More specifically it is a power-of-2
exponent, and we typically call them '_shift', given how we use them
with 'shift' operators.