提交 93e1ade5 编写于 作者: V Vegard Nossum 提交者: Ingo Molnar

x86/oprofile: disable preemption in nmi_shutdown

fix:

    BUG: using smp_processor_id() in preemptible [00000000] code: oprofiled/27301
    caller is nmi_shutdown+0x11/0x60
    Pid: 27301, comm: oprofiled Not tainted 2.6.26-rc7 #25
     [<c028a90d>] debug_smp_processor_id+0xbd/0xc0
     [<c045fba1>] nmi_shutdown+0x11/0x60
     [<c045dd4a>] oprofile_shutdown+0x2a/0x60

Note that we don't need this for the other functions, since they are all
called with on_each_cpu() (which disables preemption for us anyway).
Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
Cc: Philippe Elie <phil.el@wanadoo.fr>
Cc: oprofile-list@lists.sf.net
Cc: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 62786b9e
...@@ -269,12 +269,13 @@ static void nmi_cpu_shutdown(void *dummy) ...@@ -269,12 +269,13 @@ static void nmi_cpu_shutdown(void *dummy)
static void nmi_shutdown(void) static void nmi_shutdown(void)
{ {
struct op_msrs *msrs = &__get_cpu_var(cpu_msrs); struct op_msrs *msrs = &get_cpu_var(cpu_msrs);
nmi_enabled = 0; nmi_enabled = 0;
on_each_cpu(nmi_cpu_shutdown, NULL, 0, 1); on_each_cpu(nmi_cpu_shutdown, NULL, 0, 1);
unregister_die_notifier(&profile_exceptions_nb); unregister_die_notifier(&profile_exceptions_nb);
model->shutdown(msrs); model->shutdown(msrs);
free_msrs(); free_msrs();
put_cpu_var(cpu_msrs);
} }
static void nmi_cpu_start(void *dummy) static void nmi_cpu_start(void *dummy)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册