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

From: [email-masked] (Jamie Lokier)
Date: Fri, 19 Mar 2010 01:49:06 +0000

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