All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Catalin Iacob <iacobcatalin@gmail.com>,
	Dave Jones <davej@redhat.com>, Ingo Molnar <mingo@kernel.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [RFC PATCH 9/9] nohz: nohz full depends on irq work self IPI support
Date: Thu, 21 Aug 2014 16:52:57 +0200	[thread overview]
Message-ID: <1408632777-3348-10-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1408632777-3348-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 as it may well be completely stopped.

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. Some lockup have been reported due to the kick trying to cancel
the tick hrtimer from the tick itself, which of course doesn't work.

Cc: Catalin Iacob <iacobcatalin@gmail.com>
Cc: Dave Jones <davej@redhat.com>
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>
---
 include/linux/irq_work.h |  1 +
 kernel/time/tick-sched.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
index 708c895..cffdf47 100644
--- a/include/linux/irq_work.h
+++ b/include/linux/irq_work.h
@@ -33,6 +33,7 @@ void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
 #define DEFINE_IRQ_WORK(name, _f) struct irq_work name = { .func = (_f), }
 
 bool irq_work_queue(struct irq_work *work);
+int arch_irq_work_has_own_interrupt(void);
 
 #ifdef CONFIG_SMP
 bool irq_work_queue_on(struct irq_work *work, int cpu);
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index eb4af01..767a081 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_own_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)) {
-- 
1.8.3.1


      parent reply	other threads:[~2014-08-21 14:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 14:52 [RFC PATCH 0/9] nohz: Nohz full kick fixes Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 1/9] nohz: Restore NMI safe local irq work for local nohz kick Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 2/9] nohz: Move nohz full init call to tick init Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 3/9] irq_work: Force raised irq work to run on irq work interrupt Frederic Weisbecker
2014-09-04  6:11   ` Peter Zijlstra
2014-09-04 13:33     ` Frederic Weisbecker
2014-09-04 15:40       ` Peter Zijlstra
2014-09-05 13:54         ` Frederic Weisbecker
2014-09-06 13:35     ` Frederic Weisbecker
2014-09-06 15:45       ` Peter Zijlstra
2014-09-06 17:12         ` Frederic Weisbecker
2014-09-08  6:11           ` Peter Zijlstra
2014-08-21 14:52 ` [RFC PATCH 4/9] x86: Build irq work only if local apic support Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 5/9] x86: Tell irq work about self IPI support Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 6/9] arm: " Frederic Weisbecker
2014-08-21 15:21   ` Russell King - ARM Linux
2014-08-21 17:35     ` Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 7/9] arm64: " Frederic Weisbecker
2014-08-21 14:52 ` [RFC PATCH 8/9] nohz: Consolidate nohz full init code Frederic Weisbecker
2014-08-21 14:52 ` 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=1408632777-3348-10-git-send-email-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=davej@redhat.com \
    --cc=iacobcatalin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.