Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755100AbcKQSgh (ORCPT ); Thu, 17 Nov 2016 13:36:37 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:49701 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755009AbcKQSgd (ORCPT ); Thu, 17 Nov 2016 13:36:33 -0500 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: rt@linuxtronix.de, Anna-Maria Gleixner , Robert Richter , x86@kernel.org, oprofile-list@lists.sf.net, Sebastian Andrzej Siewior Subject: [PATCH 18/20] x86/oprofile/nmi: Remove superfluous smp_function_call_single() Date: Thu, 17 Nov 2016 19:35:39 +0100 Message-Id: <20161117183541.8588-19-bigeasy@linutronix.de> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161117183541.8588-1-bigeasy@linutronix.de> References: <20161117183541.8588-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2270 Lines: 77 From: Anna-Maria Gleixner 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. Cc: Robert Richter Cc: x86@kernel.org Cc: oprofile-list@lists.sf.net Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/oprofile/nmi_int.c | 22 ++++++++++++---------- 1 file 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) nmi_cpu_restore_registers(msrs); } =20 -static void nmi_cpu_up(void *dummy) +static void nmi_cpu_up(void) { + local_irq_disable(); if (nmi_enabled) - nmi_cpu_setup(dummy); + nmi_cpu_setup(NULL); if (ctr_running) - nmi_cpu_start(dummy); + nmi_cpu_start(NULL); + local_irq_enable(); } =20 -static void nmi_cpu_down(void *dummy) +static void nmi_cpu_down(void) { + local_irq_disable(); if (ctr_running) - nmi_cpu_stop(dummy); + nmi_cpu_stop(NULL); if (nmi_enabled) - nmi_cpu_shutdown(dummy); + nmi_cpu_shutdown(NULL); + local_irq_enable(); } =20 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 a= ction, void *data) { - int cpu =3D (unsigned long)data; - switch (action & ~CPU_TASKS_FROZEN) { case CPU_DOWN_FAILED: case CPU_ONLINE: - smp_call_function_single(cpu, nmi_cpu_up, NULL, 0); + nmi_cpu_up(); break; case CPU_DOWN_PREPARE: - smp_call_function_single(cpu, nmi_cpu_down, NULL, 1); + nmi_cpu_down(); break; } return NOTIFY_DONE; --=20 2.10.2