From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932497AbdLOPk7 (ORCPT ); Fri, 15 Dec 2017 10:40:59 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34398 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932168AbdLOPkC (ORCPT ); Fri, 15 Dec 2017 10:40:02 -0500 X-Google-Smtp-Source: ACJfBotehlWaACwt1MAvCMIOnJzkW6RdoWQkhJzDXFaNUsQr9FdjuNTeb9l8ZxCQaPxIgsxafeKpuw== From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: Joel Fernandes , Srinivas Pandruvada , Len Brown , "Rafael J. Wysocki" , Viresh Kumar , Ingo Molnar , Peter Zijlstra , Juri Lelli , Patrick Bellasi , Chris Redpath , Steve Muckle , Dietmar Eggemann , Vincent Guittot , Morten Ramussen , Frederic Weisbecker , Thomas Gleixner , Steven Rostedt , Saravana Kannan , Vikram Mulukutla , Rohit Jain , Atish Patra , Josef Bacik , EAS Dev , Android Kernel Subject: [PATCH 3/3] sched/fair: remove impossible condition from find_idlest_group_cpu Date: Fri, 15 Dec 2017 07:39:44 -0800 Message-Id: <20171215153944.220146-3-joelaf@google.com> X-Mailer: git-send-email 2.15.1.504.g5279b80103-goog In-Reply-To: <20171215153944.220146-1-joelaf@google.com> References: <20171215153944.220146-1-joelaf@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reviewed-by: Brendan Jackman Reviewed-by: Vincent Guittot Signed-off-by: Joel Fernandes --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1b10821d8380..44407e703b5f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5948,7 +5948,7 @@ find_idlest_group_cpu(struct sched_group *group, struct task_struct *p, int this } } else if (shallowest_idle_cpu == -1) { load = weighted_cpuload(cpu_rq(i)); - if (load < min_load || (load == min_load && i == this_cpu)) { + if (load < min_load) { min_load = load; least_loaded_cpu = i; } -- 2.15.1.504.g5279b80103-goog