Skip to content

Commit 9dfbc26

Browse files
Byte-LabIngo Molnar
authored andcommitted
sched/fair: Remove unnecessary goto in update_sd_lb_stats()
In update_sd_lb_stats(), when we're iterating over the sched groups that comprise a sched domain, we're skipping the call to update_sd_pick_busiest() for the sched group that contains the local / destination CPU. We use a goto to skip the call, but we could just as easily check !local_group, as there's no other logic that we need to skip with the goto. Let's remove the goto, and check for !local_group in the if statement instead. Signed-off-by: David Vernet <void@manifault.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org> Reviewed-by: Valentin Schneider <vschneid@redhat.com> Link: https://lore.kernel.org/r/20240206043921.850302-2-void@manifault.com
1 parent 23d04d8 commit 9dfbc26

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10580,16 +10580,11 @@ static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sd
1058010580

1058110581
update_sg_lb_stats(env, sds, sg, sgs, &sg_status);
1058210582

10583-
if (local_group)
10584-
goto next_group;
10585-
10586-
10587-
if (update_sd_pick_busiest(env, sds, sg, sgs)) {
10583+
if (!local_group && update_sd_pick_busiest(env, sds, sg, sgs)) {
1058810584
sds->busiest = sg;
1058910585
sds->busiest_stat = *sgs;
1059010586
}
1059110587

10592-
next_group:
1059310588
/* Now, start updating sd_lb_stats */
1059410589
sds->total_load += sgs->group_load;
1059510590
sds->total_capacity += sgs->group_capacity;

0 commit comments

Comments
 (0)