From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752683AbdJ3PmH (ORCPT ); Mon, 30 Oct 2017 11:42:07 -0400 Received: from foss.arm.com ([217.140.101.70]:54326 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbdJ3PmG (ORCPT ); Mon, 30 Oct 2017 11:42:06 -0400 References: <20171028095941.4773-1-joelaf@google.com> <20171028095941.4773-6-joelaf@google.com> User-agent: mu4e 0.9.18; emacs 25.2.2 From: Brendan Jackman To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Peter Zijlstra , Dietmar , "Cc\: Srinivas Pandruvada" , "Cc\: Len Brown" , "Cc\: Rafael J. Wysocki" , "Cc\: Viresh Kumar" , "Cc\: Juri Lelli" , "Cc\: Patrick Bellasi" , "Cc\: Steve Muckle" , "Cc\: Chris Redpath" , "Cc\: Atish Patra" , "Cc\: Vincent Guittot" , "Cc\: Morten Ramussen" , "Cc\: Frederic Weisbecker" , "Cc\: Thomas Gleixner" , "Cc\: EAS Dev" , "Cc\: Android Kernel" Subject: Re: [PATCH RFC 5/5] sched/fair: remove impossible condition from find_idlest_group_cpu In-reply-to: <20171028095941.4773-6-joelaf@google.com> Date: Mon, 30 Oct 2017 15:41:58 +0000 Message-ID: <87tvygk5h5.fsf@arm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 28 2017 at 09:59, Joel Fernandes wrote: > 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. > > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Brendan Jackman > Cc: Dietmar > Signed-off-by: Joel Fernandes FWIW: Reviewed-by: Brendan Jackman > --- > 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 5c49fdb4c508..740602ce799f 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -5922,7 +5922,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; > }