Skip to contentSkip to conversation

BUG: NMI Watchdog detected LOCKUP on CPU0

sparc Ben Hutchings 2 participants 4 messages Apr 7, 2012 – Apr 8, 2012

lore
Share & tools
lore
#0 lore raw

Summary for the SPARC maintainers:

The NMI watchdog is firing on Sunfire 280R and Sun Blade2500 systems with one or both processors in cheetah_xcall_deliver(). This has been seen under 3.0, 3.2 and 3.3 and seems to be associated with disk I/O.

Full bug log is at: http://bugs.debian.org/648766

Quoted 5 lines · Kieron Gillespie

I have also noticed, that if I am reading the trace correctly that in both of my cases, and the original bug submitter's, and a bug posted on old.nabble.com's case the crash always seems to happen when one CPU is doing cheetah_xcall_deliver, and the other CPU is in the same instruction in tl0_irq15. Here is a link to the post.

[...]

tl0_irq15 seems to be part of the NMI watchdog (for detecting that the kernel has hung), so you should always see that in a backtrace when the NMI watchdog fires. It's not part of the problem.

cheetah_xcall_deliver() does appear to be relevant to the problem and it looks like it could loop indefinitely - though presumably only if a processor is behaving strangely? It appears to periodically enable and disable interrupts, but then I'm not sure how the PSTATE.IE and PIL interrupt control fields interact and I don't think this will reset the NMI watchdog. In any case, it seems like there's a serious problem if it's looping for a long time, whether or not interrupts remain disabled.

Ben.

Signature · 2 lines
Ben Hutchings
Larkinson's Law: All laws are basically false.
#1 lore raw

From: Ben Hutchings <[email protected]>
Date: Sat, 07 Apr 2012 18:21:38 +0100

Quoted 3 lines

cheetah_xcall_deliver() does appear to be relevant to the problem and it looks like it could loop indefinitely - though presumably only if a processor is behaving strangely?

I can only loop indefinitely if one of the cpus is hung and does not respond to the cross-call interrupt.

Quoted 3 lines

It appears to periodically enable and disable interrupts, but then I'm not sure how the PSTATE.IE and PIL interrupt control fields interact and I don't think this will reset the NMI watchdog.

PSTATE.IE controls delivery of all interrupts, both PIL based and vectored interrupts.

PIL only controls delivery of PIL interrupts.

The NMI watchdog interrupt is a special PIL interrupt, and most of the standard local_irq_disable() et al. routines on sparc will adjust the %pil such that NMI watchdog interrupts are still delivered.

See include/asm/pil.h for details.

#2 lore raw
In reply to Ben Hutchings
Quoted 9 lines · David Miller

From: Ben Hutchings <[email protected]>
Date: Sat, 07 Apr 2012 18:21:38 +0100

Quoted 3 lines

cheetah_xcall_deliver() does appear to be relevant to the problem and it looks like it could loop indefinitely - though presumably only if a processor is behaving strangely?

I can only loop indefinitely if one of the cpus is hung and does not respond to the cross-call interrupt.

Well, it has to keep responding with a NACK, right?

Will the recipient NACK if the cross-call interrupt is disabled, or do the processors have a buffer/FIFO for such IRQs?

If there's no buffer then what stops two processors live-locking here? (The 'random time' where some interrupts are enabled isn't really very random, so it seems to be possible for two processors to go round the loop in lock-step.)

Quoted 7 lines
Quoted 3 lines

It appears to periodically enable and disable interrupts, but then I'm not sure how the PSTATE.IE and PIL interrupt control fields interact and I don't think this will reset the NMI watchdog.

PSTATE.IE controls delivery of all interrupts, both PIL based and vectored interrupts.

Quoted 8 lines

PIL only controls delivery of PIL interrupts.

The NMI watchdog interrupt is a special PIL interrupt, and most of the standard local_irq_disable() et al. routines on sparc will adjust the %pil such that NMI watchdog interrupts are still delivered.

See include/asm/pil.h for details.

Obviously the NMI watchdog is not being disabled, but I was wondering how its timer gets reset.

Having RTFS, it appears that it is never really reset but is held off by either an hrtimer interrupt or an explicit call to watchdog_nmi_touch() during each interval. If I'm not mistaken, the hrtimer interrupt is being disabled by xcall_deliver() and remains disabled.

Ben.

Signature · 2 lines
Ben Hutchings
If more than one person is responsible for a bug, no one is at fault.
#3 lore raw
In reply to Ben Hutchings

From: Ben Hutchings <[email protected]>
Date: Sun, 08 Apr 2012 22:12:06 +0100

Quoted 2 lines

Will the recipient NACK if the cross-call interrupt is disabled, or do the processors have a buffer/FIFO for such IRQs?

Recipient's NACK when their incoming cross-call queue is full. A cpu hung with PSTATE_IE clear will not take vectorred interrupts and therefore not empty the queue.

Quoted 2 lines

Obviously the NMI watchdog is not being disabled, but I was wondering how its timer gets reset.

The NMI watchdog is controlled by the performance counter infrastructure.

When the performance counters are not being used for 'perf', they are used to implement the NMI watchdog.

See arch/sparc/kernel/{pcr,nmi}.c