alistair23-linux/arch/x86/oprofile
Robert Richter 3d2606f429 oprofile, x86: Enable preemption during pci device setup in IBS init
IBS initialization is a mix of per-core register access and per-node
pci device setup. Register access should be pinned to the cpu, but pci
setup must run with preemption enabled.

This patch better separates the code into non-/preemptible sections
and fixes sleeping with preemption disabled. See bug message below.

Fixes also freeing the eilvt entry by introducing put_eilvt().

BUG: sleeping function called from invalid context at mm/slub.c:824
in_atomic(): 1, irqs_disabled(): 0, pid: 32357, name: modprobe
INFO: lockdep is turned off.
Pid: 32357, comm: modprobe Not tainted 2.6.39-rc7+ #14
Call Trace:
 [<ffffffff8104bdc8>] __might_sleep+0x112/0x117
 [<ffffffff81129693>] kmem_cache_alloc_trace+0x4b/0xe7
 [<ffffffff81278f14>] kzalloc.constprop.0+0x29/0x2b
 [<ffffffff81278f4c>] pci_get_subsys+0x36/0x78
 [<ffffffff81022689>] ? setup_APIC_eilvt+0xfb/0x139
 [<ffffffff81278fa4>] pci_get_device+0x16/0x18
 [<ffffffffa06c8b5d>] op_amd_init+0xd3/0x211 [oprofile]
 [<ffffffffa064d000>] ? 0xffffffffa064cfff
 [<ffffffffa064d298>] op_nmi_init+0x21e/0x26a [oprofile]
 [<ffffffffa064d062>] oprofile_arch_init+0xe/0x26 [oprofile]
 [<ffffffffa064d010>] oprofile_init+0x10/0x42 [oprofile]
 [<ffffffff81002099>] do_one_initcall+0x7f/0x13a
 [<ffffffff81096524>] sys_init_module+0x132/0x281
 [<ffffffff814cc682>] system_call_fastpath+0x16/0x1b

Reported-by: Dave Jones <davej@redhat.com>
Cc: <stable@kernel.org>         [2.6.37.x]
Signed-off-by: Robert Richter <robert.richter@amd.com>
2011-05-20 17:11:10 +02:00
..
backtrace.c x86, dumpstack: Correct stack dump info when frame pointer is available 2011-03-18 10:51:42 +01:00
init.c
Makefile
nmi_int.c Merge branch 'core' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile into perf/urgent 2011-03-29 09:32:28 +02:00
nmi_timer_int.c x86, NMI: Add priorities to handlers 2011-01-07 15:08:52 +01:00
op_counter.h oprofile, x86: Allow setting EDGE/INV/CMASK for counter events 2011-03-24 18:45:44 +01:00
op_model_amd.c oprofile, x86: Enable preemption during pci device setup in IBS init 2011-05-20 17:11:10 +02:00
op_model_p4.c Kill off warning: ‘inline’ is not at beginning of declaration 2011-01-19 15:43:08 +01:00
op_model_ppro.c x86: Replace uses of current_cpu_data with this_cpu ops 2010-12-30 12:22:03 +01:00
op_x86_model.h oprofile/x86: make AMD IBS hotplug capable 2010-05-06 15:11:15 +02:00