mirror of
https://github.com/torvalds/linux.git
synced 2024-12-30 14:52:05 +00:00
08928e7aea
Commita76d7bd96d
("ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+") removed the barrier-less, ARM-specific mutex implementation in favour of the generic xchg-based code. Since then, a bug was uncovered in the xchg code when running on SMP platforms, due to interactions between the locking paths and the MUTEX_SPIN_ON_OWNER code. This was fixed in0bce9c46bf
("mutex: place lock in contended state after fastpath_lock failure"), however, the atomic_dec-based mutex algorithm is now marginally more efficient for ARM (~0.5% improvement in hackbench scores on dual A15). This patch moves ARMv6+ platforms to the atomic_dec-based mutex code. Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
22 lines
577 B
C
22 lines
577 B
C
/*
|
|
* arch/arm/include/asm/mutex.h
|
|
*
|
|
* ARM optimized mutex locking primitives
|
|
*
|
|
* Please look into asm-generic/mutex-xchg.h for a formal definition.
|
|
*/
|
|
#ifndef _ASM_MUTEX_H
|
|
#define _ASM_MUTEX_H
|
|
/*
|
|
* On pre-ARMv6 hardware this results in a swp-based implementation,
|
|
* which is the most efficient. For ARMv6+, we have exclusive memory
|
|
* accessors and use atomic_dec to avoid the extra xchg operations
|
|
* on the locking slowpaths.
|
|
*/
|
|
#if __LINUX_ARM_ARCH__ < 6
|
|
#include <asm-generic/mutex-xchg.h>
|
|
#else
|
|
#include <asm-generic/mutex-dec.h>
|
|
#endif
|
|
#endif /* _ASM_MUTEX_H */
|