linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Peter Zijlstra <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:sched/urgent] sched/fair: Fix wake_affine_llc() balancing rules
Date: Thu, 7 Sep 2017 01:16:24 -0700	[thread overview]
Message-ID: <tip-a731ebe6f17bff9e7ca12ef227f9da4d5bdf8425@git.kernel.org> (raw)
In-Reply-To: <20170906105131.gqjmaextmn3u6tj2@hirez.programming.kicks-ass.net>

Commit-ID:  a731ebe6f17bff9e7ca12ef227f9da4d5bdf8425
Gitweb:     http://git.kernel.org/tip/a731ebe6f17bff9e7ca12ef227f9da4d5bdf8425
Author:     Peter Zijlstra <peterz@infradead.org>
AuthorDate: Wed, 6 Sep 2017 12:51:31 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
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 <chris@chris-wilson.co.uk>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
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 <mingo@kernel.org>
---
 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;
 
 	/*

      reply	other threads:[~2017-09-07  8:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06  5:13 Abysmal scheduler performance in Linus' tree? Andy Lutomirski
2017-09-06  8:25 ` Peter Zijlstra
2017-09-06  8:59   ` Andy Lutomirski
2017-09-06  9:03     ` Peter Zijlstra
2017-09-06 16:14       ` Peter Zijlstra
2017-09-07  6:15         ` Mike Galbraith
2017-09-07  7:31           ` Ingo Molnar
2017-09-07  9:13           ` [PATCH] sched/cpuset/pm: Fix cpuset vs suspend-resume Peter Zijlstra
2017-09-07  9:26             ` Peter Zijlstra
2017-09-07 10:54               ` Rafael J. Wysocki
2017-09-07 20:38               ` Tejun Heo
2017-09-07 10:33             ` [tip:sched/urgent] sched/cpuset/pm: Fix cpuset vs. suspend-resume bugs tip-bot for Peter Zijlstra
2017-09-06  9:15 ` Abysmal scheduler performance in Linus' tree? Chris Wilson
2017-09-06  9:24   ` Peter Zijlstra
     [not found]     ` <150469312649.28581.17626550155735691534@mail.alporthouse.com>
2017-09-06 10:44       ` Peter Zijlstra
2017-09-06 10:51         ` Peter Zijlstra
2017-09-07  8:16           ` tip-bot for Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-a731ebe6f17bff9e7ca12ef227f9da4d5bdf8425@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).