ARM: 7983/1: atomics: implement a better __atomic_add_unless for v6+
authorWill Deacon <will.deacon@arm.com>
Fri, 21 Feb 2014 16:01:48 +0000 (17:01 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 25 Feb 2014 11:35:08 +0000 (11:35 +0000)
commitdb38ee874c48713d0723221d08332242e0088970
tree065fee530d0374306564ea37606617f007af6c64
parentd98b90ea22b0a28d9d787769704a9cf1ea5a513a
ARM: 7983/1: atomics: implement a better __atomic_add_unless for v6+

Looking at perf profiles of multi-threaded hackbench runs, a significant
performance hit appears to manifest from the cmpxchg loop used to
implement the 32-bit atomic_add_unless function. This can be mitigated
by writing a direct implementation of __atomic_add_unless which doesn't
require iteration outside of the atomic operation.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/atomic.h