Skip to content

Commit 18cec7e

Browse files
Joel FernandesIngo Molnar
authored andcommitted
sched/fair: Remove impossible condition from find_idlest_group_cpu()
find_idlest_group_cpu() goes through CPUs of a group previous selected by find_idlest_group(). find_idlest_group() returns NULL if the local group is the selected one and doesn't execute find_idlest_group_cpu if the group to which 'cpu' belongs to is chosen. So we're always guaranteed to call find_idlest_group_cpu() with a group to which 'cpu' is non-local. This makes one of the conditions in find_idlest_group_cpu() an impossible one, which we can get rid off. Signed-off-by: Joel Fernandes <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Brendan Jackman <[email protected]> Reviewed-by: Vincent Guittot <[email protected]> Cc: Android Kernel <[email protected]> Cc: Atish Patra <[email protected]> Cc: Chris Redpath <[email protected]> Cc: Dietmar Eggemann <[email protected]> Cc: EAS Dev <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Josef Bacik <[email protected]> Cc: Juri Lelli <[email protected]> Cc: Len Brown <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Morten Ramussen <[email protected]> Cc: Patrick Bellasi <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Rohit Jain <[email protected]> Cc: Saravana Kannan <[email protected]> Cc: Srinivas Pandruvada <[email protected]> Cc: Steve Muckle <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vikram Mulukutla <[email protected]> Cc: Viresh Kumar <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 5083452 commit 18cec7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5950,7 +5950,7 @@ find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, int this
59505950
}
59515951
} else if (shallowest_idle_cpu == -1) {
59525952
load = weighted_cpuload(cpu_rq(i));
5953-
if (load < min_load || (load == min_load && i == this_cpu)) {
5953+
if (load < min_load) {
59545954
min_load = load;
59555955
least_loaded_cpu = i;
59565956
}

0 commit comments

Comments
 (0)