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

From: Peter Zijlstra
Date: Thu Jan 16 2020 - 10:17:36 EST


On Tue, Jan 14, 2020 at 02:57:33PM -0500, Thara Gopinath wrote:

> diff --git a/kernel/sched/pelt.h b/kernel/sched/pelt.h
> index afff644..bf1e17b 100644
> --- a/kernel/sched/pelt.h
> +++ b/kernel/sched/pelt.h
> @@ -7,6 +7,16 @@ int __update_load_avg_cfs_rq(u64 now, struct cfs_rq *cfs_rq);
> int update_rt_rq_load_avg(u64 now, struct rq *rq, int running);
> int update_dl_rq_load_avg(u64 now, struct rq *rq, int running);
>
> +#ifdef CONFIG_HAVE_SCHED_THERMAL_PRESSURE
> +int update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity);
static inline u64 thermal_load_avg(struct rq *rq)
{
return READ_ONCE(rq->avg_thermal.load_avg);
}
> +#else
> +static inline int
> +update_thermal_load_avg(u64 now, struct rq *rq, u64 capacity)
> +{
> + return 0;
> +}

static inline u64 thermal_load_avg(struct rq *rq)
{
return 0;
}
> +#endif

Would help with patch 4 and 5.