[PATCH 3/9] ARM: smp: avoid using bitmasks and locks for IPIs, use hardware instead

Catalin Marinas catalin.marinas at arm.com
Wed Nov 17 12:28:00 EST 2010


On Wed, 2010-11-17 at 17:19 +0000, Russell King - ARM Linux wrote:
> On Wed, Nov 17, 2010 at 05:06:39PM +0000, Catalin Marinas wrote:
> > On Mon, 2010-11-15 at 17:58 +0000, Russell King - ARM Linux wrote:
> > > Avoid using bitmasks and locks in the percpu area for IPIs, and instead
> > > use individual software generated interrupts to identify the reason for
> > > the IPI.  This avoids the problems of having spinlocks in the percpu
> > > area.
> > >
> > > Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
> > > ---
> > >  arch/arm/kernel/smp.c |   87 ++++++++++++++----------------------------------
> > >  1 files changed, 26 insertions(+), 61 deletions(-)
> > >
> > > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
> > > index 7a236db..78d55c6 100644
> > > --- a/arch/arm/kernel/smp.c
> > > +++ b/arch/arm/kernel/smp.c
> > [...]
> > >  enum ipi_msg_type {
> > > -       IPI_TIMER,
> > > +       IPI_TIMER = 2,
> > >         IPI_RESCHEDULE,
> > >         IPI_CALL_FUNC,
> > >         IPI_CALL_FUNC_SINGLE,
> >
> > Maybe a comment here on why this starts at 2. People may wonder in the
> > future.
> 
> I would like to get rid of the 'starts at 2' but we can only do this once
> we're sure that the use of SGI1 to wake up the CPUs is not something that
> is a hard requirement for boot loaders.
> 
> I've not yet tested whether Realview and Versatile Express are fine with
> a different SGI number.

AFAIK, the ARM boot monitor doesn't care about the IPI number, it just
needs something to take it out of the WFI.

BTW, in boot_secondary() we could issue a SEV as well from the primary
CPU. That's mainly useful when you don't have a full boot monitor to set
up the GIC and it uses WFE in a loop (I have some simple wrapper for
this, mainly used on software models).

-- 
Catalin




More information about the linux-arm-kernel mailing list