Re: [PATCH v5 3/4] sched/cpufreq_schedutil: use util_est for OPP selection

From: Peter Zijlstra
Date: Wed Mar 07 2018 - 05:12:43 EST


On Thu, Feb 22, 2018 at 05:01:52PM +0000, Patrick Bellasi wrote:
> static inline unsigned long cpu_util_cfs(struct rq *rq)
> {
> + if (!sched_feat(UTIL_EST))
> + return READ_ONCE(rq->cfs.avg.util_avg);
> +
> + return max_t(unsigned long,
> + READ_ONCE(rq->cfs.avg.util_avg),
> + READ_ONCE(rq->cfs.avg.util_est.enqueued));
> }

static inline unsigned long cpu_util_cfs(struct rq *rq)
{
unsigned long util = READ_ONCE(rq->cfs.avg.util_avg);

if (sched_feat(UTIL_EST)) {
util = max_t(unsigned long, util,
READ_ONCE(rq->cfs.avg.util_est.enqueued));
}

return util;
}

Seems like a more readable variant.