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.

Reply via email to