summaryrefslogtreecommitdiffstats
path: root/arch/arm64/lib
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2015-05-29 13:31:10 +0100
committerWill Deacon <will.deacon@arm.com>2015-07-27 15:28:53 +0100
commit0ea366f5e1b6413a6095dce60ea49ae51e468b61 (patch)
treefce4fc690edf16784d21a714415a74a8ce53eb2b /arch/arm64/lib
parenta82e62382fcbbf5c3348e802af73583e0cac39c0 (diff)
downloadtalos-op-linux-0ea366f5e1b6413a6095dce60ea49ae51e468b61.tar.gz
talos-op-linux-0ea366f5e1b6413a6095dce60ea49ae51e468b61.zip
arm64: atomics: prefetch the destination word for write prior to stxr
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 makes use of prfm to prefetch cachelines for write prior to ldxr/stxr loops when using the ll/sc atomic routines. Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/lib')
-rw-r--r--arch/arm64/lib/bitops.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/lib/bitops.S b/arch/arm64/lib/bitops.S
index bc18457c2bba..43ac736baa5b 100644
--- a/arch/arm64/lib/bitops.S
+++ b/arch/arm64/lib/bitops.S
@@ -31,6 +31,7 @@ ENTRY( \name )
eor w0, w0, w3 // Clear low bits
mov x2, #1
add x1, x1, x0, lsr #3 // Get word offset
+alt_lse " prfm pstl1strm, [x1]", "nop"
lsl x3, x2, x3 // Create mask
alt_lse "1: ldxr x2, [x1]", "\lse x3, [x1]"
@@ -48,6 +49,7 @@ ENTRY( \name )
eor w0, w0, w3 // Clear low bits
mov x2, #1
add x1, x1, x0, lsr #3 // Get word offset
+alt_lse " prfm pstl1strm, [x1]", "nop"
lsl x4, x2, x3 // Create mask
alt_lse "1: ldxr x2, [x1]", "\lse x4, x2, [x1]"
OpenPOWER on IntegriCloud