Skip to content

Commit 6c8116c

Browse files
Tao ZhouPeter Zijlstra
authored andcommitted
sched/fair: Fix condition of avg_load calculation
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: 57abff0 ("sched/fair: Rework find_idlest_group()") Signed-off-by: Tao Zhou <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Vincent Guittot <[email protected]> Acked-by: Mel Gorman <[email protected]> Link: https://lkml.kernel.org/r/Message-ID:
1 parent e94f80f commit 6c8116c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/sched/fair.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8631,7 +8631,8 @@ static inline void update_sg_wakeup_stats(struct sched_domain *sd,
86318631
* Computing avg_load makes sense only when group is fully busy or
86328632
* overloaded
86338633
*/
8634-
if (sgs->group_type < group_fully_busy)
8634+
if (sgs->group_type == group_fully_busy ||
8635+
sgs->group_type == group_overloaded)
86358636
sgs->avg_load = (sgs->group_load * SCHED_CAPACITY_SCALE) /
86368637
sgs->group_capacity;
86378638
}

0 commit comments

Comments
 (0)