mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lei Wen <leiwen@marvell.com>
To: Mike Galbraith <bitbucket@online.de>,
	Lei Wen <leiwen@marvell.com>,
	Peter Zijlstra <peterz@infradead.org>, <mingo@redhat.com>,
	<preeti.lkml@gmail.com>, <daniel.lezcano@linaro.org>,
	<viresh.kumar@linaro.org>, <xjian@marvell.com>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH v3] sched: keep quiescent cpu out of idle balance loop
Date: Fri, 21 Feb 2014 17:15:08 +0800	[thread overview]
Message-ID: <1392974108-28778-1-git-send-email-leiwen@marvell.com> (raw)
In-Reply-To: <1392971691.5451.84.camel@marge.simpson.net>

Cpu which is put into quiescent mode, would set its sd
member as NULL, and want others not disturb its task running.
But current scheduler would not checking whether that cpu is
setting in such mode, and still insist the quiescent
cpu to response the nohz load balance.

Fix it by preventing such cpu set nohz.idle_cpus_mask in the
first place.

Signed-off-by: Lei Wen <leiwen@marvell.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <bitbucket@online.de>
---
Much thanks to Mike Pointing out the root span would be merged when the
last cpu becomes isolated from the crash result checking!

 kernel/sched/fair.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 235cfa7..af30b6a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6883,6 +6883,14 @@ void nohz_balance_enter_idle(int cpu)
 	if (!cpu_active(cpu))
 		return;
 
+	/*
+	 * If this cpu is isolated, its rq's sd member would becomes NULL.
+	 * Base on this observation, we could exclude this cpu from nohz
+	 * idle balance, so that it would not be disturbed.
+	 */
+	if (!this_rq()->sd)
+		return;
+
 	if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
 		return;
 
-- 
1.8.3.2


  reply	other threads:[~2014-02-21  9:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19  5:20 [PATCH] " Lei Wen
2014-02-19  9:04 ` Peter Zijlstra
2014-02-20  2:42   ` Lei Wen
2014-02-20  8:50     ` Peter Zijlstra
2014-02-20  9:15       ` Lei Wen
2014-02-20  9:17       ` Lei Wen
2014-02-20 12:04         ` Peter Zijlstra
2014-02-20 12:23         ` Peter Zijlstra
2014-02-21  2:23           ` [PATCH v2] " Lei Wen
2014-02-21  5:51             ` Mike Galbraith
2014-02-21  7:28               ` Lei Wen
2014-02-21  8:34                 ` Mike Galbraith
2014-02-21  9:15                   ` Lei Wen [this message]
2014-02-21  9:41                     ` [PATCH v3] " Mike Galbraith
2014-02-21  9:15                   ` [PATCH v2] " Mike Galbraith

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=1392974108-28778-1-git-send-email-leiwen@marvell.com \
    --to=leiwen@marvell.com \
    --cc=bitbucket@online.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=preeti.lkml@gmail.com \
    --cc=viresh.kumar@linaro.org \
    --cc=xjian@marvell.com \
    /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

all inboxes | Powered by JetHome®