Patchwork [1/2] sparc64: Add self-IPI support for smp_send_reschedule()

login
register
mail settings
Submitter Kirill Tkhai
Date Sept. 14, 2013, noon
Message ID <147951379160009@web12j.yandex.ru>
Download mbox | patch
Permalink /patch/274913/
State Accepted
Delegated to: David Miller
Headers show

Comments

Kirill Tkhai - Sept. 14, 2013, noon
CONFIG_NO_HZ_FULL requires possibility of smp_send_reschedule()
for the calling CPU. Currently, it is used in inc_nr_running()
scheduler primitive only.
    
Nobody calls smp_send_reschedule() from preemptible context
(furthermore, it looks like it will be save if anybody use it
another way in the future). But anyway I add WARN_ON() here
just to return here if anything changes.

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
CC: David Miller <davem@davemloft.net>
---
 arch/sparc/kernel/smp_64.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Nov. 14, 2013, 10:59 p.m.
From: Kirill Tkhai <tkhai@yandex.ru>
Date: Sat, 14 Sep 2013 16:00:09 +0400

> CONFIG_NO_HZ_FULL requires possibility of smp_send_reschedule()
> for the calling CPU. Currently, it is used in inc_nr_running()
> scheduler primitive only.
>     
> Nobody calls smp_send_reschedule() from preemptible context
> (furthermore, it looks like it will be save if anybody use it
> another way in the future). But anyway I add WARN_ON() here
> just to return here if anything changes.
> 
> Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index e142545..b66a533 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1399,8 +1399,13 @@  void __init smp_cpus_done(unsigned int max_cpus)
 
 void smp_send_reschedule(int cpu)
 {
-	xcall_deliver((u64) &xcall_receive_signal, 0, 0,
-		      cpumask_of(cpu));
+	if (cpu == smp_processor_id()) {
+		WARN_ON_ONCE(preemptible());
+		set_softint(1 << PIL_SMP_RECEIVE_SIGNAL);
+	} else {
+		xcall_deliver((u64) &xcall_receive_signal,
+			      0, 0, cpumask_of(cpu));
+	}
 }
 
 void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs)