From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754717AbdIGIVj (ORCPT ); Thu, 7 Sep 2017 04:21:39 -0400 Received: from terminus.zytor.com ([65.50.211.136]:37297 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753018AbdIGIVi (ORCPT ); Thu, 7 Sep 2017 04:21:38 -0400 Date: Thu, 7 Sep 2017 01:16:24 -0700 From: tip-bot for Peter Zijlstra Message-ID: Cc: luto@kernel.org, efault@gmx.de, mingo@kernel.org, chris@chris-wilson.co.uk, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, peterz@infradead.org, tglx@linutronix.de Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, luto@kernel.org, efault@gmx.de, mingo@kernel.org, chris@chris-wilson.co.uk, torvalds@linux-foundation.org, peterz@infradead.org, tglx@linutronix.de In-Reply-To: <20170906105131.gqjmaextmn3u6tj2@hirez.programming.kicks-ass.net> References: <20170906105131.gqjmaextmn3u6tj2@hirez.programming.kicks-ass.net> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/urgent] sched/fair: Fix wake_affine_llc() balancing rules Git-Commit-ID: a731ebe6f17bff9e7ca12ef227f9da4d5bdf8425 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: a731ebe6f17bff9e7ca12ef227f9da4d5bdf8425 Gitweb: http://git.kernel.org/tip/a731ebe6f17bff9e7ca12ef227f9da4d5bdf8425 Author: Peter Zijlstra AuthorDate: Wed, 6 Sep 2017 12:51:31 +0200 Committer: Ingo Molnar CommitDate: Thu, 7 Sep 2017 09:29:31 +0200 sched/fair: Fix wake_affine_llc() balancing rules Chris Wilson reported that the SMT balance rules got the +1 on the wrong side, resulting in a bias towards the current LLC; which the load-balancer would then try and undo. Reported-by: Chris Wilson Tested-by: Chris Wilson Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Fixes: 90001d67be2f ("sched/fair: Fix wake_affine() for !NUMA_BALANCING") Link: http://lkml.kernel.org/r/20170906105131.gqjmaextmn3u6tj2@hirez.programming.kicks-ass.net Signed-off-by: Ingo Molnar --- 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 8d58687..9dd2ce1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5435,7 +5435,7 @@ wake_affine_llc(struct sched_domain *sd, struct task_struct *p, return false; /* if this cache has capacity, come here */ - if (this_stats.has_capacity && this_stats.nr_running < prev_stats.nr_running+1) + if (this_stats.has_capacity && this_stats.nr_running+1 < prev_stats.nr_running) return true; /*