Re: [Patch v6 1/7] sched/pelt.c: Add support to track thermal pressure

From: Peter Zijlstra
Date: Mon Dec 16 2019 - 08:43:34 EST


On Wed, Dec 11, 2019 at 11:11:42PM -0500, Thara Gopinath wrote:
> The
> difference here from rt/dl utilization tracking is that, instead of
> tracking time spent by a cpu running a rt/dl task through util_avg, the
> average thermal pressure is tracked through load_avg. This is because
> thermal pressure signal is weighted "delta" capacity and is not
> binary(util_avg is binary). "delta capacity" here means delta between the
> actual capacity of a cpu and the decreased capacity a cpu due to a thermal
> event.

I'm thinking that ^, would make a nice adding to that v.

> +/*
> + * thermal:
> + *
> + * load_sum = \Sum se->avg.load_sum
> + *
> + * util_avg and runnable_load_avg are not supported and meaningless.
> + *
> + */
> +int update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity)
> +{
> + if (___update_load_sum(now, &rq->avg_thermal,
> + capacity,
> + capacity,
> + capacity)) {
> + ___update_load_avg(&rq->avg_thermal, 1, 1);
> + trace_pelt_thermal_tp(rq);
> + return 1;
> + }
> +
> + return 0;
> +}