On 08-Mar 10:48, Peter Zijlstra wrote:
> On Thu, Feb 22, 2018 at 05:01:53PM +0000, Patrick Bellasi wrote:
> > +#define UTIL_EST_NEED_UPDATE_FLAG 0x1
> 
> > @@ -5321,12 +5345,19 @@ static inline void util_est_dequeue(struct cfs_rq 
> > *cfs_rq,
> >     if (!task_sleep)
> >             return;
> >  
> > +   /*
> > +    * Skip update of task's estimated utilization if the PELT signal has
> > +    * never been updated (at least once) since last enqueue time.
> > +    */
> > +   ue = READ_ONCE(p->se.avg.util_est);
> > +   if (ue.enqueued & UTIL_EST_NEED_UPDATE_FLAG)
> > +           return;
> 
> The name and function seem inverted, if the flag is set, we do _NOT_
> update util_est.

My reading was along the line "when the flag is set we need an
update of util_avg to collect a new util_est sample"...

... but I agree that's confusing... and unnecessary long.

> How about something like UTIL_EST_UNCHANGED ? That would give:

I would prefer UTIL_AVG_UNCHANGED, since the flags is reset when we
have a change in util_avg, thus enabling util_est updates.

>       /*
>        * If the PELT values haven't changed since enqueue time,
>        * skip the util_est update.
>        */
>       if (enqueue & UTIL_EST_UNCHANGED)
>               return;

-- 
#include <best/regards.h>

Patrick Bellasi

Reply via email to