LDREX/STREX and pre-emption on SMP hardware

Catalin Marinas catalin.marinas at arm.com
Mon Sep 14 10:26:15 EDT 2009

On Mon, 2009-09-14 at 15:21 +0100, Russell King - ARM Linux wrote:
> On Mon, Sep 14, 2009 at 03:09:09PM +0100, Russell King - ARM Linux wrote:
> > On Mon, Sep 14, 2009 at 01:21:21PM +0100, Catalin Marinas wrote:
> > > And here's an untested patch to clear the exclusive monitor on the
> > > exception return path. If you are OK with the idea, I'll do some testing
> > > before pushing it for upstream:
> > 
> > However, a plain STR is not guaranteed to change the state of the
> > exclusive monitor - it is implementation defined whether STR does
> > or not.
> > 
> > This is true for both the local and global exclusive monitors.
> ... only for the same local CPU.  A STR done by another CPU to the
> address being monitored clears the global monitor.

Yes, that's A3.4.2 in the ARM ARM. And with this patch, we take care for
the local monitor by clearing the monitor state on exception return.

I think the reason we weren't seeing any issues is that many locking
operations take place with interrupts disabled.


More information about the linux-arm-kernel mailing list