From: Yong Zhang <redacted>
Both pi_stress and sigwaittest in rt-test show performance gain with
__HAVE_ARCH_CMPXCHG. Testing result on coretile_express_a9x4:
pi_stress -p 99 --duration=300 (on linux-3.4-rc5; bigger is better)
vanilla: Total inversion performed: 5493381
patched: Total inversion performed: 5621746
sigwaittest -p 99 -l 100000 (on linux-3.4-rc5-rt6; less is better)
3.4-rc5-rt6: Min 24, Cur 27, Avg 30, Max 98
patched: Min 19, Cur 21, Avg 23, Max 96
Signed-off-by: Yong Zhang <redacted>
Cc: Russell King <redacted>
Cc: Nicolas Pitre <redacted>
Cc: Will Deacon <redacted>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Thomas Gleixner <redacted>
Cc: linux-arm-kernel at lists.infradead.org
---
arch/arm/include/asm/cmpxchg.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
@@ -127,6 +127,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size#else /* min ARCH >= ARMv6 */+#define __HAVE_ARCH_CMPXCHG 1+externvoid__bad_cmpxchg(volatilevoid*ptr,intsize);
As long as this only requires 4-byte cmpxchg support then I think this is
fine. It looks like that's currently the case, so:
Acked-by: Will Deacon <redacted>
Will