LDREX/STREX and pre-emption on SMP hardware
Catalin Marinas
catalin.marinas at arm.com
Mon Sep 14 07:47:12 EDT 2009
On Mon, 2009-09-14 at 11:06 +0100, Catalin Marinas wrote:
> On Mon, 2009-09-14 at 11:00 +0100, Russell King - ARM Linux wrote:
> > It doesn't matter though - consider two threads using LDREX on the same
> > location:
> >
> > T1 T2
> > LDREX
> > LDREX
> > STREXEQ (not satsified)
> > STREX
>
> As I replied to Jamie on a similar issue, you can have:
>
> T1 T2
> LDREX
> LDREX
> STREXEQ (satisfied, succeeds)
> LDREX
> STREXEQ (not satisfied)
> STREX (succeeds)
>
> Though this may be an unlikely sequence.
Searching for STREXEQ, it looks like there are several other locking
functions using it in spinlock.h. Do we have a real problem with these?
--
Catalin
More information about the linux-arm-kernel
mailing list