[PATCH 1/1] [RFC] arm: add half-word __xchg

Jamie Lokier jamie at shareable.org
Thu Mar 18 21:49:06 EDT 2010


Mathieu Desnoyers wrote:
> But.. thinking about it. It's bad to have a 2-byte xchg primitive that
> only works on UP and breaks the build on SMP. We should instead
> implement a workaround based on __cmpxchg4 to perform the 2-byte xchg().

This exposes why there should be __cmpxchg_bool() versions, which do
not loop, preferably in the generic kernel API, because the workaround
using __cmpxchg4 has to add yet another pointless loop nesting to all
cmpxchg users.

--- Jamie



More information about the linux-arm-kernel mailing list