Re: [GIT PULL] Add two-byte cmpxchg emulation function for v7.4

From: Paul E. McKenney

Date: Fri Oct 23 2026 - 12:12:36 EST


On Fri, Oct 23, 2026 at 01:26:25PM +0200, Jan Engelhardt wrote:
>
> On Saturday 2026-10-17 05:51, Paul E. McKenney wrote:
> >
> >Add emulation of two-byte cmpxchg()
> >
> >These commits add a cmpxchg_emu_u16() function that emulates two-byte
> >cmpxchg() in terms of four-byte cmpxchg() [...]
> >namely sh, arc, csky, and xtensa.
> >
> >There is reason to believe that these systems will soon no longer be
> >supported by Linux.
>
> riscv64 also only has two exchange operations
> (lr.w.aqrl/lr.d.aqrl/sc.w.rl/sc.d.rl).
> (atomic_compare_exchange_strong with uint8/16_t, in userspace, gets
> replaced by the compiler to a lot more instructions thanks to
> implied -finline-atomics.)
>
> Are you saying riscv64 is going to go unsupported too? ;-)

Given that the compiler can make it work in userspace, then the riscv64
architecture-specific code should be able to make it work in the Linux
kernel. At which point there is absolutely no reason that Linux-kernel
support for riscv64 should be dropped.

Or am I missing something here?

Thanx, Paul