Skip to contentSkip to conversation

Uhhuh. NMI received for unknown reason 2d on CPU 0.

DISCUSSION George Spelvin 2 participants 4 messages Apr 13, 2011 – Apr 14, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This problem which I thought was fixed by commit 7d44ec193d, appears to be still very much present in 2.6.39-rc3:

Apr 12 22:16:00 horizon kernel: Uhhuh. NMI received for unknown reason 3d on CPU 0.
Apr 12 22:16:00 horizon kernel: Do you have a strange power saving mode enabled?
Apr 12 22:16:00 horizon kernel: Dazed and confused, but trying to continue
Apr 12 22:17:22 horizon kernel: Uhhuh. NMI received for unknown reason 2d on CPU 0.
Apr 12 22:17:22 horizon kernel: Do you have a strange power saving mode enabled?
Apr 12 22:17:22 horizon kernel: Dazed and confused, but trying to continue
Apr 12 22:21:17 horizon kernel: Uhhuh. NMI received for unknown reason 2d on CPU 0.
Apr 12 22:21:17 horizon kernel: Do you have a strange power saving mode enabled?
Apr 12 22:21:17 horizon kernel: Dazed and confused, but trying to continue
Apr 12 22:25:02 horizon kernel: Uhhuh. NMI received for unknown reason 2d on CPU 0.
Apr 12 22:25:02 horizon kernel: Do you have a strange power saving mode enabled?
Apr 12 22:25:02 horizon kernel: Dazed and confused, but trying to continue
Apr 12 22:28:24 horizon kernel: Uhhuh. NMI received for unknown reason 3d on CPU 0.
Apr 12 22:28:24 horizon kernel: Do you have a strange power saving mode enabled?
Apr 12 22:28:24 horizon kernel: Dazed and confused, but trying to continue
Apr 12 22:31:28 horizon kernel: Uhhuh. NMI received for unknown reason 2d on CPU 0.
Apr 12 22:31:28 horizon kernel: Do you have a strange power saving mode enabled?
Apr 12 22:31:28 horizon kernel: Dazed and confused, but trying to continue
Apr 12 22:34:20 horizon kernel: Uhhuh. NMI received for unknown reason 3d on CPU 0.
Apr 12 22:34:20 horizon kernel: Do you have a strange power saving mode enabled?
Apr 12 22:34:20 horizon kernel: Dazed and confused, but trying to continue
Apr 12 22:37:01 horizon kernel: Uhhuh. NMI received for unknown reason 3d on CPU 0.
Apr 12 22:37:01 horizon kernel: Do you have a strange power saving mode enabled?
Apr 12 22:37:01 horizon kernel: Dazed and confused, but trying to continue

Same system as before: 1.6 GHz P4, ASUS P4B266LA, Intel 845 chipset.

I suspect commit 242214f9c1 wasn't quite as effective as hoped.

A message that is not in the archive (sent off-list or not yet received): [email protected]

Tested-by Shaun Ruffell Tested-by Acked-by
#2 lore raw
Quoted 3 lines · Cyrill Gorcunov

There is a patch fromDon we are testing now, i will resend it in a couple of hours.

George, mind to give these patches a shot please? (Sorry for sending it as attachment).

From: Don Zickus <[email protected]>
Date: Tue, 12 Apr 2011 12:30:31 -0400
Subject: [PATCH] perf, x86: fix unknown NMIs on a Pentium4 box

When using perf on a Pentium4 box, lots of unknown NMIs would be generated. This is the result of a P4 quirk that is subtle. The P4 generates an NMI when the counter overflow and unlike other arches where the NMI is a one time event, the P4 continues to assert its NMI until clear by the OS.

As a side effect to this quirk, the NMI on the apic is masked off to prevent a stream of NMIs until the overflow flag is cleared. During the perf re-design, this subtle-ness was overlooked and the apic was unmasked _before_ the overflow flag was cleared. As a result, this generated an extra NMI on the P4 mchines.

The fix is trivial, wait until the NMI is properly handled before un-masking the apic.

Sadly, in the old nmi watchdog there was a note that explained this exact behaviour.

---
 arch/x86/kernel/cpu/perf_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/cpu/perf_event.c +1 -1
index eed3673a..e108ef8 100644
@@ -1370,9 +1370,9 @@ perf_event_nmi_handler(struct notifier_block *self,
 		return NOTIFY_DONE;
 	}
 
-	apic_write(APIC_LVTPC, APIC_DM_NMI);
 
 	handled = x86_pmu.handle_irq(args->regs);
+	apic_write(APIC_LVTPC, APIC_DM_NMI);
 	if (!handled)
 		return NOTIFY_DONE;
 
Signature · 1 line
1.7.4.2
author Acked-by
#3 lore raw
Quoted 2 lines

George, mind to give these patches a shot please? (Sorry for sending it as attachment).

It ran overnight with no problems. (Well, I'm having a problem with udev using 100% of CPU, but that appears to be unrelated.)

Thank you very much!

#4 lore raw
Quoted 9 lines · George Spelvin
Quoted 2 lines

George, mind to give these patches a shot please? (Sorry for sending it as attachment).

It ran overnight with no problems. (Well, I'm having a problem with udev using 100% of CPU, but that appears to be unrelated.)

Thank you very much!

Thanks a lot for testing! Kudo goes to Don :)

Signature · 1 line
    Cyrill