linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] prevent powerpc from invoking irq handlers on offline CPUs
@ 2008-08-31 17:31 Paul E. McKenney
  2008-09-01  0:34 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2008-08-31 17:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: tnt, manfred, linuxppc-dev, paulus, akpm

Make powerpc refrain from clearing a given to-be-offlined CPU's bit in the
cpu_online_mask until it has processed pending irqs.  This change
prevents other CPUs from being blindsided by an apparently offline CPU
nevertheless changing globally visible state.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---

 smp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 5337ca7..1fedd7d 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -250,11 +250,11 @@ int generic_cpu_disable(void)
 	if (cpu == boot_cpuid)
 		return -EBUSY;
 
-	cpu_clear(cpu, cpu_online_map);
 #ifdef CONFIG_PPC64
 	vdso_data->processorCount--;
 	fixup_irqs(cpu_online_map);
 #endif
+	cpu_clear(cpu, cpu_online_map);
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] prevent powerpc from invoking irq handlers on offline CPUs
  2008-08-31 17:31 [PATCH] prevent powerpc from invoking irq handlers on offline CPUs Paul E. McKenney
@ 2008-09-01  0:34 ` Benjamin Herrenschmidt
  2008-09-01  2:06   ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-09-01  0:34 UTC (permalink / raw)
  To: paulmck; +Cc: tnt, manfred, linux-kernel, linuxppc-dev, paulus, akpm

On Sun, 2008-08-31 at 10:31 -0700, Paul E. McKenney wrote:
> Make powerpc refrain from clearing a given to-be-offlined CPU's bit in the
> cpu_online_mask until it has processed pending irqs.  This change
> prevents other CPUs from being blindsided by an apparently offline CPU
> nevertheless changing globally visible state.
> 
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> ---

Sounds reasonable... the only possible worry here is if somebody tries
an IPI ... The IPI code will and the target CPU mask with the online
map, so it may try to send to the to-be-offlined CPU and timeout, no ?

Cheers,
Ben.

>  smp.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> index 5337ca7..1fedd7d 100644
> --- a/arch/powerpc/kernel/smp.c
> +++ b/arch/powerpc/kernel/smp.c
> @@ -250,11 +250,11 @@ int generic_cpu_disable(void)
>  	if (cpu == boot_cpuid)
>  		return -EBUSY;
>  
> -	cpu_clear(cpu, cpu_online_map);
>  #ifdef CONFIG_PPC64
>  	vdso_data->processorCount--;
>  	fixup_irqs(cpu_online_map);
>  #endif
> +	cpu_clear(cpu, cpu_online_map);
>  	return 0;
>  }
>  

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] prevent powerpc from invoking irq handlers on offline CPUs
  2008-09-01  0:34 ` Benjamin Herrenschmidt
@ 2008-09-01  2:06   ` Paul E. McKenney
  2008-09-01  3:14     ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2008-09-01  2:06 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: tnt, manfred, linux-kernel, linuxppc-dev, paulus, akpm

On Mon, Sep 01, 2008 at 10:34:44AM +1000, Benjamin Herrenschmidt wrote:
> On Sun, 2008-08-31 at 10:31 -0700, Paul E. McKenney wrote:
> > Make powerpc refrain from clearing a given to-be-offlined CPU's bit in the
> > cpu_online_mask until it has processed pending irqs.  This change
> > prevents other CPUs from being blindsided by an apparently offline CPU
> > nevertheless changing globally visible state.
> > 
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > ---
> 
> Sounds reasonable... the only possible worry here is if somebody tries
> an IPI ... The IPI code will and the target CPU mask with the online
> map, so it may try to send to the to-be-offlined CPU and timeout, no ?

OK.  Do we need separate IPI and online masks?

							Thanx, Paul

> Cheers,
> Ben.
> 
> >  smp.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
> > index 5337ca7..1fedd7d 100644
> > --- a/arch/powerpc/kernel/smp.c
> > +++ b/arch/powerpc/kernel/smp.c
> > @@ -250,11 +250,11 @@ int generic_cpu_disable(void)
> >  	if (cpu == boot_cpuid)
> >  		return -EBUSY;
> >  
> > -	cpu_clear(cpu, cpu_online_map);
> >  #ifdef CONFIG_PPC64
> >  	vdso_data->processorCount--;
> >  	fixup_irqs(cpu_online_map);
> >  #endif
> > +	cpu_clear(cpu, cpu_online_map);
> >  	return 0;
> >  }
> >  
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] prevent powerpc from invoking irq handlers on offline CPUs
  2008-09-01  2:06   ` Paul E. McKenney
@ 2008-09-01  3:14     ` Benjamin Herrenschmidt
  2008-09-01  5:00       ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-09-01  3:14 UTC (permalink / raw)
  To: paulmck; +Cc: tnt, manfred, linux-kernel, linuxppc-dev, paulus, akpm

On Sun, 2008-08-31 at 19:06 -0700, Paul E. McKenney wrote:
> On Mon, Sep 01, 2008 at 10:34:44AM +1000, Benjamin Herrenschmidt wrote:
> > On Sun, 2008-08-31 at 10:31 -0700, Paul E. McKenney wrote:
> > > Make powerpc refrain from clearing a given to-be-offlined CPU's bit in the
> > > cpu_online_mask until it has processed pending irqs.  This change
> > > prevents other CPUs from being blindsided by an apparently offline CPU
> > > nevertheless changing globally visible state.
> > > 
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > ---
> > 
> > Sounds reasonable... the only possible worry here is if somebody tries
> > an IPI ... The IPI code will and the target CPU mask with the online
> > map, so it may try to send to the to-be-offlined CPU and timeout, no ?
> 
> OK.  Do we need separate IPI and online masks?

Shouldn't we already have routed all interrupts to other CPUs anyway ?

IE. The affinity of all interrupts should have been updated. So the
only thing we're going to get here are possibly IPIs and decrementer, 
I don't see it being a big deal making sure we test we are online when
receiving it.

Ben.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] prevent powerpc from invoking irq handlers on offline CPUs
  2008-09-01  3:14     ` Benjamin Herrenschmidt
@ 2008-09-01  5:00       ` Paul E. McKenney
  0 siblings, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2008-09-01  5:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: tnt, manfred, linux-kernel, linuxppc-dev, paulus, akpm

On Mon, Sep 01, 2008 at 01:14:40PM +1000, Benjamin Herrenschmidt wrote:
> On Sun, 2008-08-31 at 19:06 -0700, Paul E. McKenney wrote:
> > On Mon, Sep 01, 2008 at 10:34:44AM +1000, Benjamin Herrenschmidt wrote:
> > > On Sun, 2008-08-31 at 10:31 -0700, Paul E. McKenney wrote:
> > > > Make powerpc refrain from clearing a given to-be-offlined CPU's bit in the
> > > > cpu_online_mask until it has processed pending irqs.  This change
> > > > prevents other CPUs from being blindsided by an apparently offline CPU
> > > > nevertheless changing globally visible state.
> > > > 
> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > > > ---
> > > 
> > > Sounds reasonable... the only possible worry here is if somebody tries
> > > an IPI ... The IPI code will and the target CPU mask with the online
> > > map, so it may try to send to the to-be-offlined CPU and timeout, no ?
> > 
> > OK.  Do we need separate IPI and online masks?
> 
> Shouldn't we already have routed all interrupts to other CPUs anyway ?
> 
> IE. The affinity of all interrupts should have been updated. So the
> only thing we're going to get here are possibly IPIs and decrementer, 
> I don't see it being a big deal making sure we test we are online when
> receiving it.

It did look to me that the CPU removed itself from the interrupt queue
before re-enabling interrupts, so makes sense to me...

							Thanx, Paul

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-01  5:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-31 17:31 [PATCH] prevent powerpc from invoking irq handlers on offline CPUs Paul E. McKenney
2008-09-01  0:34 ` Benjamin Herrenschmidt
2008-09-01  2:06   ` Paul E. McKenney
2008-09-01  3:14     ` Benjamin Herrenschmidt
2008-09-01  5:00       ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).