From: tip-bot for Frederic Weisbecker <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, preeti@linux.vnet.ibm.com,
linux-kernel@vger.kernel.org, peterz@infradead.org,
torvalds@linux-foundation.org, hpa@zytor.com, mingo@kernel.org,
cmetcalf@ezchip.com, fweisbec@gmail.com, cl@linux.com,
vatikaharlalka@gmail.com, paulmck@linux.vnet.ibm.com
Subject: [tip:sched/urgent] nohz: Assert existing housekeepers when nohz full enabled
Date: Wed, 2 Sep 2015 08:57:59 -0700 [thread overview]
Message-ID: <tip-7c8bb6cb95061b3143759459ed6c6b0c73bcfecb@git.kernel.org> (raw)
In-Reply-To: <1441119060-2230-3-git-send-email-fweisbec@gmail.com>
Commit-ID: 7c8bb6cb95061b3143759459ed6c6b0c73bcfecb
Gitweb: http://git.kernel.org/tip/7c8bb6cb95061b3143759459ed6c6b0c73bcfecb
Author: Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Tue, 1 Sep 2015 16:51:00 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 2 Sep 2015 10:33:22 +0200
nohz: Assert existing housekeepers when nohz full enabled
The code ensures that when nohz full is running, at least the
boot CPU serves as a housekeeper and it can't be later offlined.
Let's assert this assumption to make sure that we have CPUs to
handle unbound jobs like workqueues and timers while nohz full
CPUs run undisturbed.
Also improve the comments on housekeeper offlining prevention.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: Vatika Harlalka <vatikaharlalka@gmail.com>
Link: http://lkml.kernel.org/r/1441119060-2230-3-git-send-email-fweisbec@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/time/tick-sched.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 3319e16..7c7ec45 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -290,16 +290,17 @@ static int __init tick_nohz_full_setup(char *str)
__setup("nohz_full=", tick_nohz_full_setup);
static int tick_nohz_cpu_down_callback(struct notifier_block *nfb,
- unsigned long action,
- void *hcpu)
+ unsigned long action,
+ void *hcpu)
{
unsigned int cpu = (unsigned long)hcpu;
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_DOWN_PREPARE:
/*
- * If we handle the timekeeping duty for full dynticks CPUs,
- * we can't safely shutdown that CPU.
+ * The boot CPU handles housekeeping duty (unbound timers,
+ * workqueues, timekeeping, ...) on behalf of full dynticks
+ * CPUs. It must remain online when nohz full is enabled.
*/
if (tick_nohz_full_running && tick_do_timer_cpu == cpu)
return NOTIFY_BAD;
@@ -370,6 +371,12 @@ void __init tick_nohz_init(void)
cpu_notifier(tick_nohz_cpu_down_callback, 0);
pr_info("NO_HZ: Full dynticks CPUs: %*pbl.\n",
cpumask_pr_args(tick_nohz_full_mask));
+
+ /*
+ * We need at least one CPU to handle housekeeping work such
+ * as timekeeping, unbound timers, workqueues, ...
+ */
+ WARN_ON_ONCE(cpumask_empty(housekeeping_mask));
}
#endif
prev parent reply other threads:[~2015-09-02 15:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-01 14:50 [GIT PULL] sched/nohz: Affine unpinned timers to housekeepers Frederic Weisbecker
2015-09-01 14:50 ` [PATCH 1/2] nohz: " Frederic Weisbecker
2015-09-01 19:14 ` Jiang, Yunhong
2015-09-01 20:47 ` Frederic Weisbecker
2015-09-02 9:38 ` Mike Galbraith
2015-09-02 12:33 ` Mike Galbraith
2015-09-02 16:16 ` Chris Metcalf
2015-09-02 19:03 ` Jiang, Yunhong
2015-09-03 1:29 ` Mike Galbraith
2015-09-04 15:56 ` Luiz Capitulino
2015-09-04 17:19 ` Frederic Weisbecker
2015-09-02 15:57 ` [tip:sched/urgent] " tip-bot for Vatika Harlalka
2015-09-01 14:51 ` [PATCH 2/2] nohz: Assert existing housekeepers when nohz full enabled Frederic Weisbecker
2015-09-02 15:57 ` tip-bot for Frederic Weisbecker [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-7c8bb6cb95061b3143759459ed6c6b0c73bcfecb@git.kernel.org \
--to=tipbot@zytor.com \
--cc=cl@linux.com \
--cc=cmetcalf@ezchip.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=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=preeti@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vatikaharlalka@gmail.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;
as well as URLs for NNTP newsgroup(s).