arm64: percpu: Implement this_cpu operations
authorSteve Capper <steve.capper@linaro.org>
Wed, 19 Nov 2014 16:53:43 +0000 (16:53 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 20 Nov 2014 12:05:18 +0000 (12:05 +0000)
commitf97fc810798c261b2790c2a1660461a508a479e0
treed0778121159f47b0337c368e5f2f1be35082d1fb
parent15670ef1eac9817cf48da12c885aabcdd88e9add
arm64: percpu: Implement this_cpu operations

The generic this_cpu operations disable interrupts to ensure that the
requested operation is protected from pre-emption. For arm64, this is
overkill and can hurt throughput and latency.

This patch provides arm64 specific implementations for the this_cpu
operations. Rather than disable interrupts, we use the exclusive
monitor or atomic operations as appropriate.

The following operations are implemented: add, add_return, and, or,
read, write, xchg. We also wire up a cmpxchg implementation from
cmpxchg.h.

Testing was performed using the percpu_test module and hackbench on a
Juno board running 3.18-rc4.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/cmpxchg.h
arch/arm64/include/asm/percpu.h