ARM: mutex: use generic atomic_dec-based implementation for ARMv6+
authorWill Deacon <will.deacon@arm.com>
Mon, 13 Aug 2012 17:38:48 +0000 (17:38 +0000)
committerVarun Colbert <vcolbert@nvidia.com>
Tue, 11 Sep 2012 17:19:20 +0000 (10:19 -0700)
commitd61ac1c6bf4f7ce4d37ca788a5cec306b6487294
treefcb51de4b02bd2d086d6102dd3fbdb496ea45016
parent1e93e0cea3dab97191255b783911e7868b02b5cf
ARM: mutex: use generic atomic_dec-based implementation for ARMv6+

Commit a76d7bd96d65 ("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 in 0bce9c46bf3b ("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.

Change-Id: I80a3a692d3fea595dbcd14874759800d1b6c0827
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Reviewed-on: http://git-master/r/130778
Tested-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Daniel Parker <dparker@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
arch/arm/include/asm/mutex.h