From: Peter Zijlstra Date: Fri, 1 May 2009 10:23:17 +0000 (+0200) Subject: perf_counter: fix nmi-watchdog interaction X-Git-Tag: v2.6.31-rc1~383^2~316 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63a809a2dc53b91268dd915bbcbd425063893676;p=platform%2Fkernel%2Flinux-3.10.git perf_counter: fix nmi-watchdog interaction When we don't have any perf-counters active, don't act like we know what the NMI is for. [ Impact: fix hard hang with nmi_watchdog=2 ] Signed-off-by: Peter Zijlstra Cc: Paul Mackerras Cc: Corey Ashford LKML-Reference: <20090501102533.109867793@chello.nl> Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c index fc06f4d..d4c0cc9 100644 --- a/arch/x86/kernel/cpu/perf_counter.c +++ b/arch/x86/kernel/cpu/perf_counter.c @@ -871,6 +871,9 @@ perf_counter_nmi_handler(struct notifier_block *self, struct pt_regs *regs; int ret; + if (!atomic_read(&num_counters)) + return NOTIFY_DONE; + switch (cmd) { case DIE_NMI: case DIE_NMI_IPI: