diff mbox

arm64: hw-breakpoint: Remove superfluous SMP function call

Message ID 1459766569-17237-1-git-send-email-anna-maria@linutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Anna-Maria Behnsen April 4, 2016, 10:42 a.m. UTC
Since commit 1cf4f629d9d2 ("cpu/hotplug: Move online calls to
hotplugged cpu") it is ensured that callbacks of CPU_ONLINE and
CPU_DOWN_PREPARE are processed on the hotplugged cpu. Due to this SMP
function calls are no longer required.

Replace smp_call_function_single() with a direct call of
hw_breakpoint_reset(). To keep the calling convention, interrupts are
explicitely disabled around the call.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
 arch/arm64/kernel/hw_breakpoint.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Sergei Shtylyov April 4, 2016, 2:06 p.m. UTC | #1
On 4/4/2016 1:42 PM, Anna-Maria Gleixner wrote:

> Since commit 1cf4f629d9d2 ("cpu/hotplug: Move online calls to
> hotplugged cpu") it is ensured that callbacks of CPU_ONLINE and
> CPU_DOWN_PREPARE are processed on the hotplugged cpu. Due to this SMP

   CPU. My spell checker also trips over "hotplugged"...

> function calls are no longer required.
>
> Replace smp_call_function_single() with a direct call of
> hw_breakpoint_reset(). To keep the calling convention, interrupts are
> explicitely disabled around the call.

    Explicitly.

> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
[...]

MBR, Sergei
Suzuki K Poulose April 5, 2016, 9:26 a.m. UTC | #2
On 04/04/16 11:42, Anna-Maria Gleixner wrote:
> Since commit 1cf4f629d9d2 ("cpu/hotplug: Move online calls to
> hotplugged cpu") it is ensured that callbacks of CPU_ONLINE and
> CPU_DOWN_PREPARE are processed on the hotplugged cpu. Due to this SMP
> function calls are no longer required.
>
> Replace smp_call_function_single() with a direct call of
> hw_breakpoint_reset(). To keep the calling convention, interrupts are
> explicitely disabled around the call.

While you are at it, could you please also fix a similar instance
in arch/arm64/kernel/debug-monitors.c: hw_breakpoint_reset_notify() ?

Thanks
Suzuki
Anna-Maria Behnsen April 5, 2016, 9:39 a.m. UTC | #3
On Tue, 5 Apr 2016, Suzuki K. Poulose wrote:

> On 04/04/16 11:42, Anna-Maria Gleixner wrote:
> > Since commit 1cf4f629d9d2 ("cpu/hotplug: Move online calls to
> > hotplugged cpu") it is ensured that callbacks of CPU_ONLINE and
> > CPU_DOWN_PREPARE are processed on the hotplugged cpu. Due to this SMP
> > function calls are no longer required.
> > 
> > Replace smp_call_function_single() with a direct call of
> > hw_breakpoint_reset(). To keep the calling convention, interrupts are
> > explicitely disabled around the call.
> 
> While you are at it, could you please also fix a similar instance
> in arch/arm64/kernel/debug-monitors.c: hw_breakpoint_reset_notify() ?

I already sent a patch for it, but I misspelled the arm mailinglist
address... I bounced it to the mailinglist.

Anna-Maria
diff mbox

Patch

--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -886,9 +886,11 @@  static int hw_breakpoint_reset_notify(st
 						unsigned long action,
 						void *hcpu)
 {
-	int cpu = (long)hcpu;
-	if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE)
-		smp_call_function_single(cpu, hw_breakpoint_reset, NULL, 1);
+	if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE) {
+		local_irq_disable();
+		hw_breakpoint_reset(NULL);
+		local_irq_enable();
+	}
 	return NOTIFY_OK;
 }