From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756249AbdJJLF1 (ORCPT ); Tue, 10 Oct 2017 07:05:27 -0400 Received: from terminus.zytor.com ([65.50.211.136]:56039 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756200AbdJJLFU (ORCPT ); Tue, 10 Oct 2017 07:05:20 -0400 Date: Tue, 10 Oct 2017 04:00:17 -0700 From: tip-bot for Brendan Jackman Message-ID: Cc: tglx@linutronix.de, josef@toxicpanda.com, morten.rasmussen@arm.com, jbacik@fb.com, dietmar.eggemann@arm.com, peterz@infradead.org, hpa@zytor.com, torvalds@linux-foundation.org, vincent.guittot@linaro.org, efault@gmx.de, mingo@kernel.org, brendan.jackman@arm.com, linux-kernel@vger.kernel.org Reply-To: brendan.jackman@arm.com, mingo@kernel.org, linux-kernel@vger.kernel.org, efault@gmx.de, vincent.guittot@linaro.org, peterz@infradead.org, hpa@zytor.com, torvalds@linux-foundation.org, jbacik@fb.com, dietmar.eggemann@arm.com, tglx@linutronix.de, morten.rasmussen@arm.com, josef@toxicpanda.com In-Reply-To: <20171005114516.18617-4-brendan.jackman@arm.com> References: <20171005114516.18617-4-brendan.jackman@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Fix find_idlest_group() when local group is not allowed Git-Commit-ID: 0d10ab952e99f3e9f374898e93f45452b81e5711 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0d10ab952e99f3e9f374898e93f45452b81e5711 Gitweb: https://git.kernel.org/tip/0d10ab952e99f3e9f374898e93f45452b81e5711 Author: Brendan Jackman AuthorDate: Thu, 5 Oct 2017 12:45:14 +0100 Committer: Ingo Molnar CommitDate: Tue, 10 Oct 2017 11:45:34 +0200 sched/fair: Fix find_idlest_group() when local group is not allowed When the local group is not allowed we do not modify this_*_load from their initial value of 0. That means that the load checks at the end of find_idlest_group cause us to incorrectly return NULL. Fixing the initial values to ULONG_MAX means we will instead return the idlest remote group in that case. Signed-off-by: Brendan Jackman Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Reviewed-by: Josef Bacik Cc: Dietmar Eggemann Cc: Josef Bacik Cc: Linus Torvalds Cc: Mike Galbraith Cc: Morten Rasmussen Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20171005114516.18617-4-brendan.jackman@arm.com Signed-off-by: Ingo Molnar --- kernel/sched/fair.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index bdd28fb..cca1835 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5737,8 +5737,9 @@ find_idlest_group(struct sched_domain *sd, struct task_struct *p, { struct sched_group *idlest = NULL, *group = sd->groups; struct sched_group *most_spare_sg = NULL; - unsigned long min_runnable_load = ULONG_MAX, this_runnable_load = 0; - unsigned long min_avg_load = ULONG_MAX, this_avg_load = 0; + unsigned long min_runnable_load = ULONG_MAX; + unsigned long this_runnable_load = ULONG_MAX; + unsigned long min_avg_load = ULONG_MAX, this_avg_load = ULONG_MAX; unsigned long most_spare = 0, this_spare = 0; int load_idx = sd->forkexec_idx; int imbalance_scale = 100 + (sd->imbalance_pct-100)/2;