android_kernel_motorola_sm6225/arch/x86/oprofile
Ingo Molnar 82aa9a1829 perfcounters: fix "perf counters kills oprofile" bug, v2
Impact: fix kernel crash

Both oprofile and perfcounters register an NMI die handler, but only one
can handle the NMI.  Conveniently, oprofile unregisters it's notifier
when not actively in use, so setting it's notifier priority higher than
perfcounter's allows oprofile to borrow the NMI for the duration of it's
run.  Tested/works both as module and built-in.

While testing, I found that if kerneltop was generating NMIs at very
high frequency, the kernel may panic when oprofile registered it's
handler.  This turned out to be because oprofile registers it's handler
before reset_value has been allocated, so if an NMI comes in while it's
still setting up, kabOom.  Rather than try more invasive changes, I
followed the lead of other places in op_model_ppro.c, and simply
returned in that highly unlikely event.  (debug warnings attached)

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-02-05 15:24:14 +01:00
..
backtrace.c oprofile: fixing whitespaces in arch/x86/oprofile/* 2008-10-16 17:17:46 +02:00
init.c x86: coding style fixes to arch/x86/oprofile/init.c 2008-04-17 17:40:49 +02:00
Makefile x86/oprofile: reanaming op_model_athlon.c to op_model_amd.c 2008-07-26 11:48:14 +02:00
nmi_int.c perfcounters: fix "perf counters kill oprofile" bug 2009-02-04 17:36:18 +01:00
nmi_timer_int.c x86: coding style fixes to arch/x86/oprofile/nmi_timer_int.c 2008-04-17 17:40:50 +02:00
op_counter.h oprofile: fixing whitespaces in arch/x86/oprofile/* 2008-10-16 17:17:46 +02:00
op_model_amd.c oprofile: make new cpu buffer functions part of the api 2009-01-07 22:48:15 +01:00
op_model_p4.c oprofile: whitespace fixes 2008-10-15 20:47:41 +02:00
op_model_ppro.c perfcounters: fix "perf counters kills oprofile" bug, v2 2009-02-05 15:24:14 +01:00
op_x86_model.h Merge branch 'oprofile/x86-oprofile-for-tip' into oprofile/oprofile-for-tip 2008-10-15 22:19:41 +02:00