public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yong Zhang <yong.zhang0@gmail.com>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, ralf@linux-mips.org,
	sshtylyov@mvista.com, david.daney@cavium.com,
	nikunj@linux.vnet.ibm.com, paulmck@linux.vnet.ibm.com,
	axboe@kernel.dk, mingo@kernel.org, tglx@linutronix.de,
	peterz@infradead.org, akpm@linux-foundation.org,
	"David S. Miller" <davem@davemloft.net>,
	sparclinux@vger.kernel.org
Subject: [UPDATED] [RFC PATCH 08/10] SPARC: smp: remove call to ipi_call_lock_irq()/ipi_call_unlock_irq()
Date: Tue, 29 May 2012 16:27:33 +0800	[thread overview]
Message-ID: <20120529082732.GA4250@zhy> (raw)
In-Reply-To: <4FC48272.9040904@linux.vnet.ibm.com>

On Tue, May 29, 2012 at 01:31:54PM +0530, Srivatsa S. Bhat wrote:
> This looks odd. IRQs must not have been enabled at this point.
> Just remove the call to local_irq_enable() that is found a few lines above
> this line and then you won't have to add this call to local_irq_disable().

Yeah, have thought about it. But because I was not sure there is
special need to enalbe irq that early (don't know much about sparc),
I decided to make minor change :)

Since we have gotten confirmation from David, I'm sending out the
new version. Please check it.

Thanks,
Yong

---
From: Yong Zhang <yong.zhang@windriver.com>
Date: Tue, 29 May 2012 12:56:08 +0800
Subject: [UPDATED] [RFC PATCH 8/10] SPARC: smp: remove call to
 ipi_call_lock_irq()/ipi_call_unlock_irq()

1) call_function.lock used in smp_call_function_many() is just to protect
   call_function.queue and &data->refs, cpu_online_mask is outside of the
   lock. And it's not necessary to protect cpu_online_mask,
   because data->cpumask is pre-calculate and even if a cpu is brougt up
   when calling arch_send_call_function_ipi_mask(), it's harmless because
   validation test in generic_smp_call_function_interrupt() will take care
   of it.

2) For cpu down issue, stop_machine() will guarantee that no concurrent
   smp_call_fuction() is processing.

And also delay irq enable to after set_cpu_online().

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
 arch/sparc/kernel/smp_64.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index f591598..781bcb1 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -103,8 +103,6 @@ void __cpuinit smp_callin(void)
 	if (cheetah_pcache_forced_on)
 		cheetah_enable_pcache();
 
-	local_irq_enable();
-
 	callin_flag = 1;
 	__asm__ __volatile__("membar #Sync\n\t"
 			     "flush  %%g6" : : : "memory");
@@ -124,9 +122,8 @@ void __cpuinit smp_callin(void)
 	while (!cpumask_test_cpu(cpuid, &smp_commenced_mask))
 		rmb();
 
-	ipi_call_lock_irq();
 	set_cpu_online(cpuid, true);
-	ipi_call_unlock_irq();
+	local_irq_enable();
 
 	/* idle thread is expected to have preempt disabled */
 	preempt_disable();
@@ -1308,9 +1305,7 @@ int __cpu_disable(void)
 	mdelay(1);
 	local_irq_disable();
 
-	ipi_call_lock();
 	set_cpu_online(cpu, false);
-	ipi_call_unlock();
 
 	cpu_map_rebuild();
 
-- 
1.7.5.4


  parent reply	other threads:[~2012-05-29  8:27 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29  7:15 [RFC PATCH 00/10] Cleanup ipi_call_lock[_irq]()/ipi_call_unlock[_irq]() Yong Zhang
2012-05-29  7:15 ` [RFC PATCH 01/10] hexagon: smp: remove call to ipi_call_lock()/ipi_call_unlock() Yong Zhang
2012-06-05 15:43   ` [tip:smp/hotplug] hexagon: SMP: Remove call to ipi_call_lock()/ ipi_call_unlock() tip-bot for Yong Zhang
2012-05-29  7:15 ` [RFC PATCH 02/10] mn10300: smp: remove call to ipi_call_lock()/ipi_call_unlock() Yong Zhang
2012-06-05 15:44   ` [tip:smp/hotplug] mn10300: SMP: Remove call to ipi_call_lock()/ ipi_call_unlock() tip-bot for Yong Zhang
2012-05-29  7:15 ` [RFC PATCH 03/10] parisc: smp: remove call to ipi_call_lock()/ipi_call_unlock() Yong Zhang
2012-06-05 15:45   ` [tip:smp/hotplug] parisc: Smp: remove call to ipi_call_lock()/ ipi_call_unlock() tip-bot for Yong Zhang
2012-05-29  7:15 ` [RFC PATCH 04/10] S390: smp: remove call to ipi_call_lock()/ipi_call_unlock() Yong Zhang
2012-06-05 15:46   ` [tip:smp/hotplug] S390: Smp: remove call to ipi_call_lock()/ ipi_call_unlock() tip-bot for Yong Zhang
2012-05-29  7:16 ` [RFC PATCH 05/10] tile: smp: remove call to ipi_call_lock()/ipi_call_unlock() Yong Zhang
2012-06-05 15:47   ` [tip:smp/hotplug] tile: SMP: Remove call to ipi_call_lock()/ ipi_call_unlock() tip-bot for Yong Zhang
2012-05-29  7:16 ` [RFC PATCH 06/10] x86: smp: remove call to ipi_call_lock()/ipi_call_unlock() Yong Zhang
2012-06-05 15:47   ` [tip:smp/hotplug] x86-smp-remove-call-to-ipi_call_lock-ipi_call_unlock tip-bot for Yong Zhang
2012-05-29  7:16 ` [RFC PATCH 07/10] ia64: smp: remove call to ipi_call_lock_irq()/ipi_call_unlock_irq() Yong Zhang
2012-06-05 15:48   ` [tip:smp/hotplug] ia64: SMP: Remove call to ipi_call_lock_irq()/ ipi_call_unlock_irq() tip-bot for Yong Zhang
2012-05-29  7:16 ` [PATCH 08/10] SPARC: smp: remove call to ipi_call_lock_irq()/ipi_call_unlock_irq() Yong Zhang
2012-05-29  8:01   ` Srivatsa S. Bhat
2012-05-29  8:14     ` David Miller
2012-05-29  8:27     ` Yong Zhang [this message]
2012-05-29  8:30       ` [UPDATED] [RFC PATCH " Srivatsa S. Bhat
2012-05-29  8:36       ` David Miller
2012-06-05 15:49       ` [tip:smp/hotplug] SPARC: SMP: Remove call to ipi_call_lock_irq()/ ipi_call_unlock_irq() tip-bot for Yong Zhang
2012-05-29  7:16 ` [RFC PATCH 09/10] POWERPC: smp: remove call to ipi_call_lock()/ipi_call_unlock() Yong Zhang
2012-06-05 15:50   ` [tip:smp/hotplug] POWERPC: Smp: remove call to ipi_call_lock()/ ipi_call_unlock() tip-bot for Yong Zhang
2012-06-16 16:32   ` [RFC PATCH 09/10] POWERPC: smp: remove call to ipi_call_lock()/ipi_call_unlock() Paul E. McKenney
2012-06-16 17:30     ` Peter Zijlstra
2012-06-16 20:57       ` Paul E. McKenney
2012-06-18  2:51     ` Yong Zhang
2012-06-18 17:05       ` Paul E. McKenney
2012-05-29  7:16 ` [RFC PATCH 10/10] smp: remove ipi_call_lock[_irq]()/ipi_call_unlock[_irq]() Yong Zhang
2012-06-05 15:51   ` [tip:smp/hotplug] smp: Remove ipi_call_lock[_irq]()/ ipi_call_unlock[_irq]() tip-bot for Yong Zhang
2012-05-29  8:02 ` [RFC PATCH 00/10] Cleanup ipi_call_lock[_irq]()/ipi_call_unlock[_irq]() Srivatsa S. Bhat
2012-05-29  8:28 ` Peter Zijlstra
2012-05-29  8:32   ` Peter Zijlstra
2012-05-29  8:34   ` Srivatsa S. Bhat
2012-06-16 16:30 ` Paul E. McKenney

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=20120529082732.GA4250@zhy \
    --to=yong.zhang0@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=davem@davemloft.net \
    --cc=david.daney@cavium.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=ralf@linux-mips.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=sshtylyov@mvista.com \
    --cc=tglx@linutronix.de \
    /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