All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Yong Zhang <yong.zhang0@gmail.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: Re: [PATCH 08/10] SPARC: smp: remove call to ipi_call_lock_irq()/ipi_call_unlock_irq()
Date: Tue, 29 May 2012 08:13:54 +0000	[thread overview]
Message-ID: <4FC48272.9040904@linux.vnet.ibm.com> (raw)
In-Reply-To: <1338275765-3217-9-git-send-email-yong.zhang0@gmail.com>

On 05/29/2012 12:46 PM, Yong Zhang wrote:

> From: Yong Zhang <yong.zhang@windriver.com>
> 
> 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.
> 
> 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 |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
> index f591598..60e745c 100644
> --- a/arch/sparc/kernel/smp_64.c
> +++ b/arch/sparc/kernel/smp_64.c
> @@ -124,9 +124,9 @@ void __cpuinit smp_callin(void)
>  	while (!cpumask_test_cpu(cpuid, &smp_commenced_mask))
>  		rmb();
> 
> -	ipi_call_lock_irq();
> +	local_irq_disable();


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().

>  	set_cpu_online(cpuid, true);
> -	ipi_call_unlock_irq();
> +	local_irq_enable();
> 

>  	/* idle thread is expected to have preempt disabled */

>  	preempt_disable();
> @@ -1308,9 +1308,7 @@ int __cpu_disable(void)
>  	mdelay(1);
>  	local_irq_disable();
> 
> -	ipi_call_lock();
>  	set_cpu_online(cpu, false);
> -	ipi_call_unlock();
> 
>  	cpu_map_rebuild();
> 



Regards,
Srivatsa S. Bhat


WARNING: multiple messages have this Message-ID (diff)
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Yong Zhang <yong.zhang0@gmail.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: Re: [PATCH 08/10] SPARC: smp: remove call to ipi_call_lock_irq()/ipi_call_unlock_irq()
Date: Tue, 29 May 2012 13:31:54 +0530	[thread overview]
Message-ID: <4FC48272.9040904@linux.vnet.ibm.com> (raw)
In-Reply-To: <1338275765-3217-9-git-send-email-yong.zhang0@gmail.com>

On 05/29/2012 12:46 PM, Yong Zhang wrote:

> From: Yong Zhang <yong.zhang@windriver.com>
> 
> 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.
> 
> 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 |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
> index f591598..60e745c 100644
> --- a/arch/sparc/kernel/smp_64.c
> +++ b/arch/sparc/kernel/smp_64.c
> @@ -124,9 +124,9 @@ void __cpuinit smp_callin(void)
>  	while (!cpumask_test_cpu(cpuid, &smp_commenced_mask))
>  		rmb();
> 
> -	ipi_call_lock_irq();
> +	local_irq_disable();


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().

>  	set_cpu_online(cpuid, true);
> -	ipi_call_unlock_irq();
> +	local_irq_enable();
> 

>  	/* idle thread is expected to have preempt disabled */

>  	preempt_disable();
> @@ -1308,9 +1308,7 @@ int __cpu_disable(void)
>  	mdelay(1);
>  	local_irq_disable();
> 
> -	ipi_call_lock();
>  	set_cpu_online(cpu, false);
> -	ipi_call_unlock();
> 
>  	cpu_map_rebuild();
> 



Regards,
Srivatsa S. Bhat


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

Thread overview: 49+ 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-05-29  7:16   ` 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  7:16   ` Yong Zhang
2012-05-29  8:01   ` Srivatsa S. Bhat [this message]
2012-05-29  8:13     ` Srivatsa S. Bhat
2012-05-29  8:14     ` David Miller
2012-05-29  8:14       ` David Miller
2012-05-29  8:27     ` [UPDATED] [RFC PATCH " Yong Zhang
2012-05-29  8:27       ` Yong Zhang
2012-05-29  8:30       ` Srivatsa S. Bhat
2012-05-29  8:42         ` Srivatsa S. Bhat
2012-05-29  8:36       ` David Miller
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-05-29  7:16   ` 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 16:32     ` Paul E. McKenney
2012-06-16 17:30     ` Peter Zijlstra
2012-06-16 17:30       ` Peter Zijlstra
2012-06-16 20:57       ` Paul E. McKenney
2012-06-16 20:57         ` Paul E. McKenney
2012-06-18  2:51     ` Yong Zhang
2012-06-18  2:51       ` Yong Zhang
2012-06-18 17:05       ` Paul E. McKenney
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=4FC48272.9040904@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.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=sshtylyov@mvista.com \
    --cc=tglx@linutronix.de \
    --cc=yong.zhang0@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.