[PATCH] ARM: 7467/1: mutex: use generic xchg-based implementation for ARMv6+

Ben Hutchings ben at decadent.org.uk
Sun Sep 9 12:51:16 EDT 2012


On Fri, 2012-08-24 at 13:36 +0100, Will Deacon wrote:
> The open-coded mutex implementation for ARMv6+ cores suffers from a
> severe lack of barriers, so in the uncontended case we don't actually
> protect any accesses performed during the critical section.
> 
> Furthermore, the code is largely a duplication of the ARMv6+ atomic_dec
> code but optimised to remove a branch instruction, as the mutex fastpath
> was previously inlined. Now that this is executed out-of-line, we can
> reuse the atomic access code for the locking (in fact, we use the xchg
> code as this produces shorter critical sections).
> 
> This patch uses the generic xchg based implementation for mutexes on
> ARMv6+, which introduces barriers to the lock/unlock operations and also
> has the benefit of removing a fair amount of inline assembly code.
> 
> Cc: <stable at vger.kernel.org> : 0bce9c46: mutex: Place lock in contended...
> Cc: <stable at vger.kernel.org>
> Acked-by: Arnd Bergmann <arnd at arndb.de>
> Acked-by: Nicolas Pitre <nico at linaro.org>
> Reported-by: Shan Kang <kangshan0910 at gmail.com>
> Signed-off-by: Will Deacon <will.deacon at arm.com>
> Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
> ---
> 
> Greg, Ben: Here's a re-send of this mutex patch now that the dependency
> has been merged into mainline. Although that patch also has a CC: stable,
> I added an explicit dependency here too.
[...]

I thought this had been deferred, but it actually already went into
3.2.27.  The fix you refer to is queued up for the next 3.2 update.

Ben.

-- 
Ben Hutchings
Time is nature's way of making sure that everything doesn't happen at once.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120909/c5b0d547/attachment.sig>


More information about the linux-arm-kernel mailing list