Re: [PATCH 0/5] Provide two-byte cmpxchg() emulation

From: Paul E. McKenney

Date: Wed Oct 07 2026 - 16:54:32 EST


On Wed, Oct 07, 2026 at 09:44:02PM +0100, Bradley Morgan wrote:
> On 7 October 2026 21:36:01 BST, "Paul E. McKenney" <paulmck@xxxxxxxxxx>
> wrote:
> >Hello!
>
> [OFF-LIST]

Well, off of most lists, anyway! Been there, done that! ;-)

> I mean, I did what you wanted, hmm?

You did just fine.

Thanx, Paul

> >This series provides emulation of two-byte cmpxchg(). Note that this
> >does not (yet) allow free use of atomic operations on two-byte operands
> >in core code because there are still a few supported systems that do not
> >have two-byte store instructions. However, this emulation does permit use
> >of wide range of two-byte atomic operations, so is worth putting forward.
> >
> >This series is being reposted on request in order to ease testing efforts.
> >
> >The individual patches are as follows:
> >
> >1. Add two-byte cmpxchg emulation function, courtesy of Bradley
> > Morgan.
> >
> >2. sh: Emulate two-byte cmpxchg, courtesy of Bradley Morgan.
> >
> >3. ARC: Emulate two-byte cmpxchg, courtesy of Bradley Morgan.
> >
> >4. csky: Emulate two-byte cmpxchg, courtesy of Bradley Morgan.
> >
> >5. xtensa: Emulate two-byte cmpxchg, courtesy of Bradley Morgan.
> >
> >#1 and #2 have the acks required to go into the upcoming v7.4 merge
> >window.
> >
> > Thanx, Paul
> >
> >------------------------------------------------------------------------
> >
> > arch/arc/include/asm/cmpxchg.h | 3 +++
> > arch/csky/include/asm/cmpxchg.h | 9 +++++++++
> > arch/sh/include/asm/cmpxchg.h | 2 ++
> > arch/xtensa/include/asm/cmpxchg.h | 1 +
> > include/linux/cmpxchg-emu.h | 4 +++-
> > lib/cmpxchg-emu.c | 38
> > ++++++++++++++++++++++++++++++++++----
> > 6 files changed, 52 insertions(+), 5 deletions(-)
>
> --- Thanks!
> "I'm not a very positive person" - Linus torvalds