linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Dave Jones <davej@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Russell King <linux@arm.linux.org.uk>,
	Catalin Iacob <iacobcatalin@gmail.com>,
	"Paul E . McKenney" <paulmck@linux.vnet.ibm.com>,
	Will Deacon <will.deacon@arm.com>, Ingo Molnar <mingo@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: [PATCH 8/8] nohz: nohz full depends on irq work self IPI support
Date: Sat, 20 Sep 2014 22:30:24 +0200	[thread overview]
Message-ID: <1411245024-10339-9-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1411245024-10339-1-git-send-email-fweisbec@gmail.com>

The nohz full functionality depends on IRQ work to trigger its own
interrupts. As it's used to restart the tick, we can't rely on the tick
fallback for irq work callbacks, ie: we can't use the tick to restart
the tick itself.

Lets reject the full dynticks initialization if that arch support isn't
available.

As a side effect, this makes sure that nohz kick is never called from
the tick. That otherwise would result in illegal hrtimer self-cancellation
and lockup.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 kernel/time/tick-sched.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index eb4af01..5a9ff24 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -365,6 +365,20 @@ void __init tick_nohz_init(void)
 		return;
 	}
 
+	/*
+	 * Full dynticks uses irq work to drive the tick rescheduling on safe
+	 * locking contexts. But then we need irq work to raise its own
+	 * interrupts to avoid circular dependency on the tick
+	 */
+	if (!arch_irq_work_has_interrupt()) {
+		pr_warning("NO_HZ: Can't run full dynticks because arch doesn't "
+			   "support irq work self-IPIs\n");
+		cpumask_clear(tick_nohz_full_mask);
+		cpumask_copy(housekeeping_mask, cpu_possible_mask);
+		tick_nohz_full_running = false;
+		return;
+	}
+
 	cpu = smp_processor_id();
 
 	if (cpumask_test_cpu(cpu, tick_nohz_full_mask)) {
-- 
2.1.0


  parent reply	other threads:[~2014-09-20 20:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-20 20:30 [PATCH 0/8] nohz: Fix nohz kick irq work on tick v3 Frederic Weisbecker
2014-09-20 20:30 ` [PATCH 1/8] nohz: Move nohz full init call to tick init Frederic Weisbecker
2014-09-20 20:30 ` [PATCH 2/8] irq_work: Introduce arch_irq_work_has_interrupt() Frederic Weisbecker
2014-09-20 20:30 ` [PATCH 3/8] irq_work: Force raised irq work to run on irq work interrupt Frederic Weisbecker
2014-09-20 20:30 ` [PATCH 4/8] x86: Tell irq work about self IPI support Frederic Weisbecker
2014-09-20 20:30 ` [PATCH 5/8] arm: " Frederic Weisbecker
2014-09-20 20:30 ` [PATCH 6/8] arm64: " Frederic Weisbecker
2014-09-20 20:30 ` [PATCH 7/8] nohz: Consolidate nohz full init code Frederic Weisbecker
2014-09-20 20:30 ` Frederic Weisbecker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-09-10 21:33 [PATCH 0/8] nohz: Fix nohz kick irq work on tick v2 Frederic Weisbecker
2014-09-10 21:33 ` [PATCH 8/8] nohz: nohz full depends on irq work self IPI support Frederic Weisbecker

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=1411245024-10339-9-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=davej@redhat.com \
    --cc=iacobcatalin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.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).