public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiang Liu <liuj97@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Shaohua Li <shli@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Sam Ravnborg <sam@ravnborg.org>, Kirill Tkhai <tkhai@yandex.ru>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Jiang Liu <jiang.liu@huawei.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jiang Liu <liuj97@gmail.com>, Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>,
	Jiri Kosina <trivial@kernel.org>,
	Wang YanQing <udknight@gmail.com>,
	linux-arch@vger.kernel.org
Subject: [RFC PATCH v3 16/19] smp, sparc: kill SMP single function call interrupt
Date: Thu,  5 Dec 2013 00:13:07 +0800	[thread overview]
Message-ID: <1386173591-28514-17-git-send-email-liuj97@gmail.com> (raw)
In-Reply-To: <1386173591-28514-1-git-send-email-liuj97@gmail.com>

Commit 9a46ad6d6df3b54 "smp: make smp_call_function_many() use logic
similar to smp_call_function_single()" has unified the way to handle
single and multiple cross-CPU function calls. Now only one intterupt
is needed for architecture specific code to support generic SMP function
call interfaces, so kill the redundant single function call interrupt.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Shaohua Li <shli@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Kosina <trivial@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Jiang Liu <liuj97@gmail.com>
---
 arch/sparc/include/asm/smp_32.h |  4 +---
 arch/sparc/kernel/entry.S       | 10 ++--------
 arch/sparc/kernel/leon_smp.c    | 31 +++++++------------------------
 arch/sparc/kernel/smp_32.c      | 14 ++------------
 arch/sparc/kernel/sun4d_smp.c   | 31 +++++++------------------------
 arch/sparc/kernel/sun4m_smp.c   | 11 ++---------
 6 files changed, 21 insertions(+), 80 deletions(-)

diff --git a/arch/sparc/include/asm/smp_32.h b/arch/sparc/include/asm/smp_32.h
index 3c8917f..6aec01a 100644
--- a/arch/sparc/include/asm/smp_32.h
+++ b/arch/sparc/include/asm/smp_32.h
@@ -48,7 +48,6 @@ void smp_callin(void);
 void smp_store_cpu_info(int);
 
 void smp_resched_interrupt(void);
-void smp_call_function_single_interrupt(void);
 void smp_call_function_interrupt(void);
 
 struct seq_file;
@@ -60,8 +59,7 @@ struct sparc32_ipi_ops {
 			   unsigned long arg2, unsigned long arg3,
 			   unsigned long arg4);
 	void (*resched)(int cpu);
-	void (*single)(int cpu);
-	void (*mask_one)(int cpu);
+	void (*func_call)(int cpu);
 };
 extern const struct sparc32_ipi_ops *sparc32_ipi_ops;
 
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index 33c02b1..98bacfb 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -263,7 +263,7 @@ smp4m_ticker:
 	 * on some level other than 15 which is the NMI and only used
 	 * for cross calls.  That has a separate entry point below.
 	 *
-	 * IPIs are sent on Level 12, 13 and 14. See IRQ_IPI_*.
+	 * IPIs are sent on Level 13 and 14. See IRQ_IPI_*.
 	 */
 maybe_smp4m_msg:
 	GET_PROCESSOR4M_ID(o3)
@@ -287,14 +287,8 @@ maybe_smp4m_msg:
 	wr	%l4, PSR_ET, %psr
 	WRITE_PAUSE
 	srl	%o3, 28, %o2		! shift for simpler checks below
-maybe_smp4m_msg_check_single:
-	andcc	%o2, 0x1, %g0
-	beq,a	maybe_smp4m_msg_check_mask
-	 andcc	%o2, 0x2, %g0
-	call	smp_call_function_single_interrupt
-	 nop
-	andcc	%o2, 0x2, %g0
 maybe_smp4m_msg_check_mask:
+	andcc	%o2, 0x2, %g0
 	beq,a	maybe_smp4m_msg_check_resched
 	 andcc	%o2, 0x4, %g0
 	call	smp_call_function_interrupt
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 6edf955..396b71d 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -271,8 +271,7 @@ void leon_irq_rotate(int cpu)
 }
 
 struct leon_ipi_work {
-	int single;
-	int msk;
+	int func_call;
 	int resched;
 };
 
@@ -308,7 +307,7 @@ static void __init leon_ipi_init(void)
 
 	for_each_possible_cpu(cpu) {
 		work = &per_cpu(leon_ipi_work, cpu);
-		work->single = work->msk = work->resched = 0;
+		work->func_call = work->resched = 0;
 	}
 }
 
@@ -319,23 +318,12 @@ static void leon_send_ipi(int cpu, int level)
 	LEON3_BYPASS_STORE_PA(&leon3_irqctrl_regs->force[cpu], mask);
 }
 
-static void leon_ipi_single(int cpu)
+static void leon_ipi_func_call(int cpu)
 {
 	struct leon_ipi_work *work = &per_cpu(leon_ipi_work, cpu);
 
 	/* Mark work */
-	work->single = 1;
-
-	/* Generate IRQ on the CPU */
-	leon_send_ipi(cpu, leon_ipi_irq);
-}
-
-static void leon_ipi_mask_one(int cpu)
-{
-	struct leon_ipi_work *work = &per_cpu(leon_ipi_work, cpu);
-
-	/* Mark work */
-	work->msk = 1;
+	work->func_call = 1;
 
 	/* Generate IRQ on the CPU */
 	leon_send_ipi(cpu, leon_ipi_irq);
@@ -356,12 +344,8 @@ void leonsmp_ipi_interrupt(void)
 {
 	struct leon_ipi_work *work = &__get_cpu_var(leon_ipi_work);
 
-	if (work->single) {
-		work->single = 0;
-		smp_call_function_single_interrupt();
-	}
-	if (work->msk) {
-		work->msk = 0;
+	if (work->func_call) {
+		work->func_call = 0;
 		smp_call_function_interrupt();
 	}
 	if (work->resched) {
@@ -467,8 +451,7 @@ void leon_cross_call_irq(void)
 static const struct sparc32_ipi_ops leon_ipi_ops = {
 	.cross_call = leon_cross_call,
 	.resched    = leon_ipi_resched,
-	.single     = leon_ipi_single,
-	.mask_one   = leon_ipi_mask_one,
+	.func_call   = leon_ipi_func_call,
 };
 
 void __init leon_init_smp(void)
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c
index a102bfb..0530d67 100644
--- a/arch/sparc/kernel/smp_32.c
+++ b/arch/sparc/kernel/smp_32.c
@@ -138,17 +138,15 @@ void smp_send_stop(void)
 
 void arch_send_call_function_single_ipi(int cpu)
 {
-	/* trigger one IPI single call on one CPU */
-	sparc32_ipi_ops->single(cpu);
+	sparc32_ipi_ops->func_call(cpu);
 }
 
 void arch_send_call_function_ipi_mask(const struct cpumask *mask)
 {
 	int cpu;
 
-	/* trigger IPI mask call on each CPU */
 	for_each_cpu(cpu, mask)
-		sparc32_ipi_ops->mask_one(cpu);
+		sparc32_ipi_ops->func_call(cpu);
 }
 
 void smp_resched_interrupt(void)
@@ -160,14 +158,6 @@ void smp_resched_interrupt(void)
 	/* re-schedule routine called by interrupt return code. */
 }
 
-void smp_call_function_single_interrupt(void)
-{
-	irq_enter();
-	generic_smp_call_function_single_interrupt();
-	local_cpu_data().irq_call_count++;
-	irq_exit();
-}
-
 void smp_call_function_interrupt(void)
 {
 	irq_enter();
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index d5c3195..72f3797 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -181,8 +181,7 @@ void __init smp4d_smp_done(void)
 
 /* Memory structure giving interrupt handler information about IPI generated */
 struct sun4d_ipi_work {
-	int single;
-	int msk;
+	int func_call;
 	int resched;
 };
 
@@ -198,7 +197,7 @@ static void __init smp4d_ipi_init(void)
 
 	for_each_possible_cpu(cpu) {
 		work = &per_cpu(sun4d_ipi_work, cpu);
-		work->single = work->msk = work->resched = 0;
+		work->func_call = work->resched = 0;
 	}
 }
 
@@ -206,12 +205,8 @@ void sun4d_ipi_interrupt(void)
 {
 	struct sun4d_ipi_work *work = &__get_cpu_var(sun4d_ipi_work);
 
-	if (work->single) {
-		work->single = 0;
-		smp_call_function_single_interrupt();
-	}
-	if (work->msk) {
-		work->msk = 0;
+	if (work->func_call) {
+		work->func_call = 0;
 		smp_call_function_interrupt();
 	}
 	if (work->resched) {
@@ -233,23 +228,12 @@ static void sun4d_send_ipi(int cpu, int level)
 	cc_set_igen(IGEN_MESSAGE(0, cpu << 3, 6 + ((level >> 1) & 7), 1 << (level - 1)));
 }
 
-static void sun4d_ipi_single(int cpu)
-{
-	struct sun4d_ipi_work *work = &per_cpu(sun4d_ipi_work, cpu);
-
-	/* Mark work */
-	work->single = 1;
-
-	/* Generate IRQ on the CPU */
-	sun4d_send_ipi(cpu, SUN4D_IPI_IRQ);
-}
-
-static void sun4d_ipi_mask_one(int cpu)
+static void sun4d_ipi_func_call(int cpu)
 {
 	struct sun4d_ipi_work *work = &per_cpu(sun4d_ipi_work, cpu);
 
 	/* Mark work */
-	work->msk = 1;
+	work->func_call = 1;
 
 	/* Generate IRQ on the CPU */
 	sun4d_send_ipi(cpu, SUN4D_IPI_IRQ);
@@ -392,8 +376,7 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs)
 static const struct sparc32_ipi_ops sun4d_ipi_ops = {
 	.cross_call = sun4d_cross_call,
 	.resched    = sun4d_ipi_resched,
-	.single     = sun4d_ipi_single,
-	.mask_one   = sun4d_ipi_mask_one,
+	.func_call   = sun4d_ipi_func_call,
 };
 
 void __init sun4d_init_smp(void)
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index d3408e7..d4b7d01 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -20,7 +20,6 @@
 #include "irq.h"
 #include "kernel.h"
 
-#define IRQ_IPI_SINGLE		12
 #define IRQ_IPI_MASK		13
 #define IRQ_IPI_RESCHED		14
 #define IRQ_CROSS_CALL		15
@@ -145,12 +144,7 @@ static void sun4m_ipi_resched(int cpu)
 	sun4m_send_ipi(cpu, IRQ_IPI_RESCHED);
 }
 
-static void sun4m_ipi_single(int cpu)
-{
-	sun4m_send_ipi(cpu, IRQ_IPI_SINGLE);
-}
-
-static void sun4m_ipi_mask_one(int cpu)
+static void sun4m_ipi_func_call(int cpu)
 {
 	sun4m_send_ipi(cpu, IRQ_IPI_MASK);
 }
@@ -262,8 +256,7 @@ void smp4m_percpu_timer_interrupt(struct pt_regs *regs)
 static const struct sparc32_ipi_ops sun4m_ipi_ops = {
 	.cross_call = sun4m_cross_call,
 	.resched    = sun4m_ipi_resched,
-	.single     = sun4m_ipi_single,
-	.mask_one   = sun4m_ipi_mask_one,
+	.func_call   = sun4m_ipi_func_call,
 };
 
 void __init sun4m_init_smp(void)
-- 
1.8.1.2


  parent reply	other threads:[~2013-12-04 16:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-04 16:12 [RFC PATCH v3 00/19] simplify generic cross CPU function call implementation Jiang Liu
2013-12-04 16:12 ` [RFC PATCH v3 01/19] Revert "kernel/smp.c: free related resources when failure occurs in hotplug_cfd()" Jiang Liu
2013-12-04 16:12 ` [RFC PATCH v3 02/19] Revert "smp: Fix SMP function call empty cpu mask race" Jiang Liu
2013-12-04 16:12 ` [RFC PATCH v3 03/19] smp, alpha: kill SMP single function call interrupt Jiang Liu
2013-12-04 16:12 ` [RFC PATCH v3 04/19] smp, ARM: " Jiang Liu
2013-12-04 16:12 ` [RFC PATCH v3 05/19] smp, ARM64: " Jiang Liu
2013-12-04 16:12 ` [RFC PATCH v3 06/19] smp, blackfin: " Jiang Liu
2013-12-04 16:12 ` [RFC PATCH v3 07/19] smp, hexagon: " Jiang Liu
2013-12-05  1:42   ` rkuo
2013-12-04 16:12 ` [RFC PATCH v3 08/19] smp, IA64: " Jiang Liu
2013-12-04 16:13 ` [RFC PATCH v3 09/19] smp, m32r: " Jiang Liu
2013-12-04 16:13 ` [RFC PATCH v3 10/19] smp, metag: " Jiang Liu
2013-12-04 16:38   ` James Hogan
2013-12-05 16:31     ` Jiang Liu
2013-12-04 16:13 ` [RFC PATCH v3 11/19] smp, mn10300: " Jiang Liu
2013-12-04 16:13 ` [RFC PATCH v3 12/19] smp, mn10300: enable arch_send_call_function_ipi_mask() Jiang Liu
2013-12-04 16:13 ` [RFC PATCH v3 13/19] smp, s390: prepare for killing generic_smp_call_function_single_interrupt() Jiang Liu
2013-12-06  9:43   ` Heiko Carstens
2013-12-04 16:13 ` [RFC PATCH v3 14/19] smp, sh: kill SMP single function call interrupt Jiang Liu
2013-12-04 16:13 ` [RFC PATCH v3 15/19] smp, sparc64: " Jiang Liu
2013-12-04 16:13 ` Jiang Liu [this message]
2013-12-04 16:13 ` [RFC PATCH v3 17/19] smp, tile: " Jiang Liu
2013-12-05 21:08   ` Chris Metcalf
2013-12-04 16:13 ` [RFC PATCH v3 18/19] " Jiang Liu
2013-12-04 16:13 ` [RFC PATCH v3 19/19] smp, x86: " Jiang Liu
2013-12-04 16:19 ` [RFC PATCH v3 00/19] simplify generic cross CPU function call implementation Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386173591-28514-17-git-send-email-liuj97@gmail.com \
    --to=liuj97@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=jiang.liu@huawei.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paul.gortmaker@windriver.com \
    --cc=rostedt@goodmis.org \
    --cc=sam@ravnborg.org \
    --cc=shli@kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tkhai@yandex.ru \
    --cc=trivial@kernel.org \
    --cc=udknight@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wangkefeng.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox