Re: [Patch v5 6/6] sched/fair: Enable tuning of decay period

From: Dietmar Eggemann
Date: Fri Nov 08 2019 - 05:53:15 EST


On 07/11/2019 11:49, Vincent Guittot wrote:
> Le Tuesday 05 Nov 2019 Ã 13:49:46 (-0500), Thara Gopinath a Ãcrit :

[...]

>> /**
>> @@ -10444,8 +10465,8 @@ void update_thermal_pressure(int cpu, unsigned long capped_capacity)
>> static void trigger_thermal_pressure_average(struct rq *rq)
>> {
>> #ifdef CONFIG_SMP
>> - update_thermal_load_avg(rq_clock_task(rq), rq,
>> - per_cpu(thermal_pressure, cpu_of(rq)));
>> + update_thermal_load_avg(rq_clock_task(rq) >> sched_thermal_decay_shift,
>> + rq, per_cpu(thermal_pressure, cpu_of(rq)));
>
> Would be better to create
>
> +static inline u64 rq_clock_thermal(struct rq *rq)
> +{
> + lockdep_assert_held(&rq->lock);
> + assert_clock_updated(rq);

IMHO, the asserts can be skipped here since they're already done in
rq_clock_task().

> + return rq_clock_task(rq) >> sched_thermal_decay_shift;
> +}