summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndrea Righi <righi.andrea@gmail.com>2008-09-20 12:58:40 +0200
committerIngo Molnar <mingo@elte.hu>2008-09-22 12:27:47 +0200
commit45f197ade73ba95681b9803680c75352fc0a1c0a (patch)
tree2a066d86abc126a5f8c096fd475859d056f4f2fd /arch
parent2879a927bb7a3cf91ae3906a5e59215f9c17dd75 (diff)
x86, oprofile: BUG: using smp_processor_id() in preemptible code
Add __raw access before setting per cpu variable switch_index, to avoid the following BUG: [ 449.166827] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/6998 [ 449.166848] caller is op_nmi_init+0xf0/0x2b0 [oprofile] [ 449.166855] Pid: 6998, comm: modprobe Not tainted 2.6.27-rc5-mm1 #29 [ 449.166860] Call Trace: [ 449.166872] [<ffffffff80362d67>] debug_smp_processor_id+0xd7/0xe0 [ 449.166887] [<ffffffffa00181c0>] op_nmi_init+0xf0/0x2b0 [oprofile] [ 449.166902] [<ffffffffa0018000>] oprofile_init+0x0/0x60 [oprofile] [ 449.166915] [<ffffffffa00180a9>] oprofile_arch_init+0x9/0x30 [oprofile] [ 449.166928] [<ffffffffa001801e>] oprofile_init+0x1e/0x60 [oprofile] [ 449.166937] [<ffffffff8020903b>] _stext+0x3b/0x160 [ 449.166946] [<ffffffff80477985>] __mutex_unlock_slowpath+0xe5/0x190 [ 449.166955] [<ffffffff80262c1a>] trace_hardirqs_on_caller+0xca/0x140 [ 449.166965] [<ffffffff8026f7fc>] sys_init_module+0xdc/0x210 [ 449.166972] [<ffffffff8020b7cb>] system_call_fastpath+0x16/0x1b Signed-off-by: Andrea Righi <righi.andrea@gmail.com> Acked-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/oprofile/nmi_int.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index fb4902bc6f1..4108d02c529 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -551,7 +551,7 @@ int __init op_nmi_init(struct oprofile_operations *ops)
}
/* default values, can be overwritten by model */
- __get_cpu_var(switch_index) = 0;
+ __raw_get_cpu_var(switch_index) = 0;
ops->create_files = nmi_create_files;
ops->setup = nmi_setup;
ops->shutdown = nmi_shutdown;