spinlock_t and tagged memory block size

Catalin Marinas catalin.marinas at arm.com
Fri Mar 16 10:40:01 EDT 2012


On 16 March 2012 11:44, Rui Sousa <rui.p.m.sousa at gmail.com> wrote:
> Cortex-A9 architecture defines the minimum size of tagged memory block
> (used on load/store exclusives) to be 2^3 = 8bytes (Cortex A9 r2p2,
> Technical Reference Manual, page 4-8).
> However, the spinlock_t structure size (if preemption and spinlock
> debug options are all disabled) is only 4bytes.
> AFAICS, this will break spinlocks if two spinlocks are linked next to
> each other. Am I right, or did I miss something?

It won't break, only that if two CPUs try to acquire the different
locks at the same time, only one will succeed the first time, the
other will need to go through the LDREX/STREX loop once more.

-- 
Catalin



More information about the linux-arm-kernel mailing list