linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Frederic Weisbecker <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, peterz@infradead.org, fweisbec@gmail.com,
	tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com,
	riel@redhat.com, torvalds@linux-foundation.org
Subject: [tip:sched/core] nohz: Move idle balancer registration to the idle path
Date: Thu, 22 Jun 2017 04:11:18 -0700	[thread overview]
Message-ID: <tip-a0db971e4eb69fc84eb3d7ef94f718b483550b4a@git.kernel.org> (raw)
In-Reply-To: <1497838322-10913-3-git-send-email-fweisbec@gmail.com>

Commit-ID:  a0db971e4eb69fc84eb3d7ef94f718b483550b4a
Gitweb:     http://git.kernel.org/tip/a0db971e4eb69fc84eb3d7ef94f718b483550b4a
Author:     Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Mon, 19 Jun 2017 04:12:01 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 22 Jun 2017 11:30:01 +0200

nohz: Move idle balancer registration to the idle path

The idle load balancing registration path assumes that we only stop the
tick when the CPU is idle, ignoring the nohz full case. As a result, a
nohz full CPU that is running a task may be chosen to perform idle load
balancing.

Lets make sure that only CPUs in dynticks idle mode can be picked as
idle load balancers.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Rik van Riel <riel@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1497838322-10913-3-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/time/tick-sched.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index b1b58a0..db023e9 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -782,7 +782,6 @@ static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts,
 	 * the scheduler tick in nohz_restart_sched_tick.
 	 */
 	if (!ts->tick_stopped) {
-		nohz_balance_enter_idle(cpu);
 		calc_load_nohz_start();
 		cpu_load_update_nohz_start();
 
@@ -923,8 +922,10 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts)
 			ts->idle_expires = expires;
 		}
 
-		if (!was_stopped && ts->tick_stopped)
+		if (!was_stopped && ts->tick_stopped) {
 			ts->idle_jiffies = ts->last_jiffies;
+			nohz_balance_enter_idle(cpu);
+		}
 	}
 }
 

  parent reply	other threads:[~2017-06-22 11:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19  2:11 [PATCH 0/3] sched: A few nohz_full improvements Frederic Weisbecker
2017-06-19  2:12 ` [PATCH 1/3] sched/loadavg: Generalize idle naming to nohz Frederic Weisbecker
2017-06-20 17:38   ` Rik van Riel
2017-06-22 11:10   ` [tip:sched/core] sched/loadavg: Generalize "_idle" naming to "_nohz" tip-bot for Frederic Weisbecker
2017-06-19  2:12 ` [PATCH 2/3] nohz: Move idle balancer registration to idle path Frederic Weisbecker
2017-06-20 17:39   ` Rik van Riel
2017-06-22 11:11   ` tip-bot for Frederic Weisbecker [this message]
2017-06-19  2:12 ` [PATCH 3/3] sched: Spare idle load balancing on nohz_full CPUs Frederic Weisbecker
2017-06-20 17:42   ` Rik van Riel
2017-06-20 19:06     ` Mike Galbraith
2017-06-21 13:23       ` Frederic Weisbecker
2017-06-20 20:26     ` Frederic Weisbecker
2017-06-22 11:11   ` [tip:sched/core] sched/fair: " tip-bot for Frederic Weisbecker
2017-06-22 13:52     ` Frederic Weisbecker
2017-06-22 19:47       ` Ingo Molnar

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-a0db971e4eb69fc84eb3d7ef94f718b483550b4a@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --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).