From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753200AbdIFKvg (ORCPT ); Wed, 6 Sep 2017 06:51:36 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33710 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752951AbdIFKvf (ORCPT ); Wed, 6 Sep 2017 06:51:35 -0400 Date: Wed, 6 Sep 2017 12:51:31 +0200 From: Peter Zijlstra To: Chris Wilson Cc: Andy Lutomirski , Ingo Molnar , "linux-kernel@vger.kernel.org" Subject: Re: Abysmal scheduler performance in Linus' tree? Message-ID: <20170906105131.gqjmaextmn3u6tj2@hirez.programming.kicks-ass.net> References: <150468933360.28581.16446660443497682079@mail.alporthouse.com> <20170906092427.poloe4aczytwtggk@hirez.programming.kicks-ass.net> <150469312649.28581.17626550155735691534@mail.alporthouse.com> <20170906104420.ic5lbpacpyyz53w5@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170906104420.ic5lbpacpyyz53w5@hirez.programming.kicks-ass.net> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 06, 2017 at 12:44:20PM +0200, Peter Zijlstra wrote: > > > + /* if this cache has capacity, come here */ > > > + if (this_stats.has_capacity && this_stats.nr_running < prev_stats.nr_running+1) > > > + return true; > > > > This is still not working as intended, it should be > > > > if (this_stats.has_capacity && this_stats.nr_running+1 < prev_stats.nr_running) > > return true; > > > > to fix the regression. > > Argh, you're quite right. Let me do a patch for that. --- Subject: sched/fair: Fix wake_affine_llc() balance rules From: Peter Zijlstra Date: Wed Sep 6 12:45:45 CEST 2017 Chris 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 Fixes: 90001d67be2f ("sched/fair: Fix wake_affine() for !NUMA_BALANCING") Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5435,7 +5435,7 @@ wake_affine_llc(struct sched_domain *sd, 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; /*