]> Pileus Git - ~andy/linux/commit
ARM: locks: prefetch the destination word for write prior to strex
authorWill Deacon <will.deacon@arm.com>
Tue, 2 Jul 2013 13:54:33 +0000 (14:54 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 30 Sep 2013 15:42:55 +0000 (16:42 +0100)
commit9bb17be062de6f5a9c9643258951aa0935652ec3
treecf430be919c709f50752dc856a5384d329abcaee
parentd8f57aa4bc5860df68d4c332d2a89c131417ee7b
ARM: locks: prefetch the destination word for write prior to strex

The cost of changing a cacheline from shared to exclusive state can be
significant, especially when this is triggered by an exclusive store,
since it may result in having to retry the transaction.

This patch prefixes our {spin,read,write}_[try]lock implementations with
pldw instructions (on CPUs which support them) to try and grab the line
in exclusive state from the start. arch_rwlock_t is changed to avoid
using a volatile member, since this generates compiler warnings when
falling back on the __builtin_prefetch intrinsic which expects a const
void * argument.

Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm/include/asm/spinlock.h
arch/arm/include/asm/spinlock_types.h