Commit 08ed487c authored by Anna-Maria Gleixner's avatar Anna-Maria Gleixner Committed by Thomas Gleixner

x86/oprofile/nmi: Remove superfluous smp_function_call_single()

Since commit 1cf4f629 ("cpu/hotplug: Move online calls to
hotplugged cpu") the CPU_ONLINE and CPU_DOWN_PREPARE notifiers are
always run on the hot plugged CPU, and as of commit 3b9d6da6
("cpu/hotplug: Fix rollback during error-out in __cpu_disable()")
the CPU_DOWN_FAILED notifier also runs on the hot plugged CPU.
This patch converts the SMP functional calls into direct calls.

smp_call_function_single() executes the function with interrupts
disabled. This calling convention is preserved.
Signed-off-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Robert Richter <rric@kernel.org>
Cc: rt@linuxtronix.de
Cc: oprofile-list@lists.sf.net
Link: http://lkml.kernel.org/r/20161117183541.8588-19-bigeasy@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent e5355cd6
...@@ -387,20 +387,24 @@ static void nmi_cpu_shutdown(void *dummy) ...@@ -387,20 +387,24 @@ static void nmi_cpu_shutdown(void *dummy)
nmi_cpu_restore_registers(msrs); nmi_cpu_restore_registers(msrs);
} }
static void nmi_cpu_up(void *dummy) static void nmi_cpu_up(void)
{ {
local_irq_disable();
if (nmi_enabled) if (nmi_enabled)
nmi_cpu_setup(dummy); nmi_cpu_setup(NULL);
if (ctr_running) if (ctr_running)
nmi_cpu_start(dummy); nmi_cpu_start(NULL);
local_irq_enable();
} }
static void nmi_cpu_down(void *dummy) static void nmi_cpu_down(void)
{ {
local_irq_disable();
if (ctr_running) if (ctr_running)
nmi_cpu_stop(dummy); nmi_cpu_stop(NULL);
if (nmi_enabled) if (nmi_enabled)
nmi_cpu_shutdown(dummy); nmi_cpu_shutdown(NULL);
local_irq_enable();
} }
static int nmi_create_files(struct dentry *root) static int nmi_create_files(struct dentry *root)
...@@ -436,15 +440,13 @@ static int nmi_create_files(struct dentry *root) ...@@ -436,15 +440,13 @@ static int nmi_create_files(struct dentry *root)
static int oprofile_cpu_notifier(struct notifier_block *b, unsigned long action, static int oprofile_cpu_notifier(struct notifier_block *b, unsigned long action,
void *data) void *data)
{ {
int cpu = (unsigned long)data;
switch (action & ~CPU_TASKS_FROZEN) { switch (action & ~CPU_TASKS_FROZEN) {
case CPU_DOWN_FAILED: case CPU_DOWN_FAILED:
case CPU_ONLINE: case CPU_ONLINE:
smp_call_function_single(cpu, nmi_cpu_up, NULL, 0); nmi_cpu_up();
break; break;
case CPU_DOWN_PREPARE: case CPU_DOWN_PREPARE:
smp_call_function_single(cpu, nmi_cpu_down, NULL, 1); nmi_cpu_down();
break; break;
} }
return NOTIFY_DONE; return NOTIFY_DONE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment