Re: [PATCH] sched/fair: Rearrange select_task_rq_fair() to optimize it

From: Quentin Perret
Date: Wed Apr 25 2018 - 05:39:28 EST


On Wednesday 25 Apr 2018 at 14:33:27 (+0530), Viresh Kumar wrote:
> On 25-04-18, 09:13, Quentin Perret wrote:
> > While you're at it, you could probably remove the one in wake_cap() ? I
> > think having just one in select_task_rq_fair() should be enough.
>
> Just make it clear, you are asking me to remove sync_entity_load_avg()
> in wake_cap() ? But aren't we required to do that, as in the very next
> line we call task_util(p) ?

Right, we do need to call sync_entity_load_avg() at some point before
calling task_util(), but we don't need to re-call it in strf()
after in this case. So my point was just that if you want to re-work
the wake-up path and make sure we don't call sync_entity_load_avg()
if not needed then this might need fixing as well ... Or maybe we don't
care since re-calling sync_entity_load_avg() should be really cheap ...