aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna-Maria Gleixner <anna-maria@linutronix.de>2016-11-17 13:35:39 -0500
committerThomas Gleixner <tglx@linutronix.de>2016-11-22 17:34:42 -0500
commit08ed487c819d285c3f6ceafd156094102acdfec2 (patch)
tree8fef90deb0a85eb12d628d16b4a377dafd8eb427
parente5355cd6e78c096b66c26de8c9e5680ddba71c1f (diff)
x86/oprofile/nmi: Remove superfluous smp_function_call_single()
Since commit 1cf4f629d9d2 ("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 3b9d6da67e11 ("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: Anna-Maria Gleixner <anna-maria@linutronix.de> Signed-off-by: Sebastian 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.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/oprofile/nmi_int.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 28c04123b6dd..c39172cd6c87 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -387,20 +387,24 @@ static void nmi_cpu_shutdown(void *dummy)
387 nmi_cpu_restore_registers(msrs); 387 nmi_cpu_restore_registers(msrs);
388} 388}
389 389
390static void nmi_cpu_up(void *dummy) 390static void nmi_cpu_up(void)
391{ 391{
392 local_irq_disable();
392 if (nmi_enabled) 393 if (nmi_enabled)
393 nmi_cpu_setup(dummy); 394 nmi_cpu_setup(NULL);
394 if (ctr_running) 395 if (ctr_running)
395 nmi_cpu_start(dummy); 396 nmi_cpu_start(NULL);
397 local_irq_enable();
396} 398}
397 399
398static void nmi_cpu_down(void *dummy) 400static void nmi_cpu_down(void)
399{ 401{
402 local_irq_disable();
400 if (ctr_running) 403 if (ctr_running)
401 nmi_cpu_stop(dummy); 404 nmi_cpu_stop(NULL);
402 if (nmi_enabled) 405 if (nmi_enabled)
403 nmi_cpu_shutdown(dummy); 406 nmi_cpu_shutdown(NULL);
407 local_irq_enable();
404} 408}
405 409
406static int nmi_create_files(struct dentry *root) 410static int nmi_create_files(struct dentry *root)
@@ -436,15 +440,13 @@ static int nmi_create_files(struct dentry *root)
436static int oprofile_cpu_notifier(struct notifier_block *b, unsigned long action, 440static int oprofile_cpu_notifier(struct notifier_block *b, unsigned long action,
437 void *data) 441 void *data)
438{ 442{
439 int cpu = (unsigned long)data;
440
441 switch (action & ~CPU_TASKS_FROZEN) { 443 switch (action & ~CPU_TASKS_FROZEN) {
442 case CPU_DOWN_FAILED: 444 case CPU_DOWN_FAILED:
443 case CPU_ONLINE: 445 case CPU_ONLINE:
444 smp_call_function_single(cpu, nmi_cpu_up, NULL, 0); 446 nmi_cpu_up();
445 break; 447 break;
446 case CPU_DOWN_PREPARE: 448 case CPU_DOWN_PREPARE:
447 smp_call_function_single(cpu, nmi_cpu_down, NULL, 1); 449 nmi_cpu_down();
448 break; 450 break;
449 } 451 }
450 return NOTIFY_DONE; 452 return NOTIFY_DONE;