Re: [PATCH] sched/fair: fix condition of avg_load calculation

From: Mel Gorman
Date: Thu Mar 19 2020 - 13:12:14 EST


On Thu, Mar 19, 2020 at 11:39:20AM +0800, Tao Zhou wrote:
> In update_sg_wakeup_stats(), the comment says:
>
> Computing avg_load makes sense only when group is fully
> busy or overloaded.
>
> But, the code below this comment does not check like this.
>
> From reading the code about avg_load in other functions, I
> confirm that avg_load should be calculated in fully busy or
> overloaded case. The comment is correct and the checking
> condition is wrong. So, change that condition.
>
> Fixes: 57abff067a08 ("sched/fair: Rework find_idlest_group()")
> Signed-off-by: Tao Zhou <ouwen210@xxxxxxxxxxx>


Actual impact is variable, some machines for stressed overload benefit
but it's not universal. That is somewhat expected given that the heavily
overloaded case is tricky at the best of times. For tbench ramping up
load, it's also not universally beneficial but some machines heavily
benefit. Despite the range of results that are machine-dependant, the
patch looks correct so;

Acked-by: Mel Gorman <mgorman@xxxxxxx>

--
Mel Gorman
SUSE Labs