From: Peter Zijlstra Date: Fri, 1 May 2009 10:23:17 +0000 (+0200) Subject: perf_counter: fix nmi-watchdog interaction X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=63a809a2dc53b91268dd915bbcbd425063893676;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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 fc06f4d32644..d4c0cc9d3263 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: