LDREX/STREX and pre-emption on SMP hardware

Catalin Marinas catalin.marinas at arm.com
Mon Aug 24 11:44:52 EDT 2009


On Fri, 2009-08-21 at 14:29 -0700, David Xiao wrote:
> The DDI0406A ARM V7 Architecture Reference Manual (section A3.4.1) seems
> to indicate that the exclusive monitor is tagging/matching the physical
> memory address accessed by the LDREX/STREX instructions.
> 
> And in the same document (section A3.4.5), it seems to suggest that the
> reason we need to do CLREX during the context switch is that because the
> IsExclusiveLocal() implementation does not have to do memory
> address/size check, but just the exclusive state check.

Yes, that's correct. And the reason we don't need this in interrupt
handlers is that we would never call a STREX without a preceding LDREX
or just a LDREX without a being followed by a STREX and interrupt
handlers are in the worst case nested rather than freely preemptible.

-- 
Catalin




More information about the linux-arm-kernel mailing list