]> Pileus Git - ~andy/linux/commit
ARM: atomics: prefetch the destination word for write prior to strex
authorWill Deacon <will.deacon@arm.com>
Thu, 4 Jul 2013 10:43:18 +0000 (11:43 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 30 Sep 2013 15:42:56 +0000 (16:42 +0100)
commitf38d999c4d16fc0fce4270374f15fbb2d8713c09
treec91a2a9fd5505a27ee0e8d03141842b07cc4e0c9
parent9bb17be062de6f5a9c9643258951aa0935652ec3
ARM: atomics: 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 atomic access implementations with pldw
instructions (on CPUs which support them) to try and grab the line in
exclusive state from the start. Only the barrier-less functions are
updated, since memory barriers can limit the usefulness of prefetching
data.

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