Re: [PATCH v3 10/13] sched/fair: Compute task/cpu utilization at wake-up more correctly

From: Morten Rasmussen
Date: Thu Aug 18 2016 - 04:51:53 EST


On Mon, Aug 15, 2016 at 04:42:37PM +0100, Morten Rasmussen wrote:
> On Mon, Aug 15, 2016 at 04:23:42PM +0200, Peter Zijlstra wrote:
> > But unlike that function, it doesn't actually use __update_load_avg().
> > Why not?
>
> Fair question :)
>
> We currently exploit the fact that the task utilization is _not_ updated
> in wake-up balancing to make sure we don't under-estimate the capacity
> requirements for tasks that have slept for a while. If we update it, we
> loose the non-decayed 'peak' utilization, but I guess we could just
> store it somewhere when we do the wake-up decay.
>
> I thought there was a better reason when I wrote the patch, but I don't
> recall right now. I will look into it again and see if we can use
> __update_load_avg() to do a proper update instead of doing things twice.

AFAICT, we should be able to synchronize the task utilization to the
previous rq utilization using __update_load_avg() as you suggest. The
patch below is should work as a replacement without any changes to
subsequent patches. It doesn't solve the under-estimation issue, but I
have another patch for that.

---8<---