public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* nmi_watchdog fix for x86_64 to be more like i386
@ 2007-09-26 18:03 David Bahi
  2007-10-01 17:36 ` Andi Kleen
  0 siblings, 1 reply; 24+ messages in thread
From: David Bahi @ 2007-09-26 18:03 UTC (permalink / raw)
  To: linux-kernel, linux-rt-users; +Cc: tglx, Gregory Haskins

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]

Thanks to tglx and ghaskins for all the help in tracking down a very
early nmi_watchdog crash on certain x86_64 machines.


[-- Attachment #2: watchdog_use_timer_and_hpet_on_x86_64.patch --]
[-- Type: text/plain, Size: 1144 bytes --]

This modifies nmi_watchdog_tick behavior for 
x86_64 arch to consider both timer and hpet IRQs
just as the i386 arch does.

Signed-off-by: David Bahi <dbahi@novell.com>

---
 arch/x86_64/kernel/nmi.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: linux-2.6.22.8-rt9_1267/arch/x86_64/kernel/nmi.c
===================================================================
--- linux-2.6.22.8-rt9_1267.orig/arch/x86_64/kernel/nmi.c
+++ linux-2.6.22.8-rt9_1267/arch/x86_64/kernel/nmi.c
@@ -369,8 +369,6 @@ int notrace __kprobes nmi_watchdog_tick(
 		touched = 1;
 	}
 
-	sum = read_pda(apic_timer_irqs);
-
 	if (__get_cpu_var(nmi_touch)) {
 		__get_cpu_var(nmi_touch) = 0;
 		touched = 1;
@@ -386,6 +384,12 @@ int notrace __kprobes nmi_watchdog_tick(
 		cpu_clear(cpu, backtrace_mask);
 	}
 
+	/*
+	 * Take the local apic timer and PIT/HPET into account. We don't
+	 * know which one is active, when we have highres/dyntick on
+	 */
+	sum = read_pda(apic_timer_irqs) + kstat_cpu(cpu).irqs[0];
+
 #ifdef CONFIG_X86_MCE
 	/* Could check oops_in_progress here too, but it's safer
 	   not too */

[-- Attachment #3: signature.asc --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: nmi_watchdog fix for x86_64 to be more like i386
@ 2007-10-05 16:01 David Bahi
  2007-10-05 16:03 ` Andi Kleen
  0 siblings, 1 reply; 24+ messages in thread
From: David Bahi @ 2007-10-05 16:01 UTC (permalink / raw)
  To: ak; +Cc: mingo, arjan, tglx, akpm, Gregory Haskins, linux-kernel,
	linux-rt-users

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

On Mon, 2007-10-01 at 23:41 +0200, Andi Kleen wrote:
> > IRQ_NOBALANCING is not preventing cpu unplug. It moves the affinity to the
> > next CPU, but the check in NMI watchdog for CPU == 0 would not longer
> > work.
> 
> That cannot happen right now because cpu_disable() on both i386/x86-64
> reject CPU #0. So just setting IRQ_NOBALANCING is sufficient and both
> do that already. I was wrong earlier in being concerned about this.
> 
> >  int tick_do_broadcast(cpumask_t mask)
> > @@ -137,6 +147,7 @@ int tick_do_broadcast(cpumask_t mask)
> >  		cpu_clear(cpu, mask);
> >  		td = &per_cpu(tick_cpu_device, cpu);
> >  		td->evtdev->event_handler(td->evtdev);
> > +		tick_broadcast_account(cpu);
> 
> That would not handle the case with a single CPU running only
> irq  0 but not broadcasting I think.
> 
> I believe ftp://ftp.firstfloor.org/pub/ak/x86_64/quilt/patches/fix-watchdog
> is the correct fix
> 
> -Andi

Andi, 

If it's agreed that this is the fix - can you submit a proper [PATCH] so
all users of watchdog_use_timer_and_hpet_on_x86_64.patch can be removed,
and replaced with yours.

Thank you very much



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2007-10-05 20:37 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-26 18:03 nmi_watchdog fix for x86_64 to be more like i386 David Bahi
2007-10-01 17:36 ` Andi Kleen
2007-10-01 18:54   ` Thomas Gleixner
2007-10-01 19:16     ` Andi Kleen
2007-10-01 19:27       ` Thomas Gleixner
2007-10-01 19:56         ` Arjan van de Ven
2007-10-01 20:10           ` Dave Jones
2007-10-01 20:11           ` Paul E. McKenney
2007-10-01 21:17           ` Thomas Gleixner
2007-10-01 21:41             ` Andi Kleen
2007-10-01 21:58               ` Thomas Gleixner
2007-10-01 22:07                 ` Andi Kleen
2007-10-01 22:47                   ` Thomas Gleixner
2007-10-01 22:52                     ` Arjan van de Ven
2007-10-02  4:56                     ` Mika Penttilä
2007-10-02  5:00                       ` Arjan van de Ven
2007-10-02  5:51                     ` Andi Kleen
2007-10-02  6:18                       ` Thomas Gleixner
2007-10-05  4:37                         ` Pallipadi, Venkatesh
2007-10-05 20:37                           ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2007-10-05 16:01 David Bahi
2007-10-05 16:03 ` Andi Kleen
2007-10-05 17:38   ` Peter W. Morreale
2007-10-05 18:00     ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox