From: David Laight <david.laight.linux@gmail.com>
To: Jan Engelhardt <ej@inai.de>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, Bradley Morgan <brads@mainlining.org>,
Arnd Bergmann <arnd@kernel.org>
Subject: Re: [GIT PULL] Add two-byte cmpxchg emulation function for v7.4
Date: Mon, 2 Nov 2026 16:34:48 +0000 [thread overview]
Message-ID: <20261102163448.3956dde3@pumpkin> (raw)
In-Reply-To: <qnrr9sr7-19rq-6rp9-0oq9-5939r07no828@vanv.qr>
On Mon, 2 Nov 2026 13:21:04 +0100 (CET)
Jan Engelhardt <ej@inai.de> wrote:
> On Friday 2026-10-23 18:12, 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?
>
> I can get gcc-17.0.0-20261102 with no further command line options
> to turn `atomic_compare_exchange_strong`+uint16 into some object code
> that does not contain a call to libatomic, for sh2, sh3, sh4. Haven't
> tried xtensa or the others.
> Thus, is the patch really needed?
>
Won't that need a big jump in the minimum supported compiler version?
Probably less of a problem than x86 since I guess cross compiles are
a lot more common?
David
next prev parent reply other threads:[~2026-11-02 16:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 3:51 Paul E. McKenney
2026-10-20 18:48 ` John Paul Adrian Glaubitz
2026-10-20 18:54 ` Bradley Morgan
2026-10-20 19:21 ` Paul E. McKenney
2026-10-20 19:26 ` Bradley Morgan
2026-10-20 19:14 ` Paul E. McKenney
2026-10-21 9:13 ` John Paul Adrian Glaubitz
2026-10-21 1:08 ` pr-tracker-bot
2026-10-23 11:26 ` Jan Engelhardt
2026-10-23 16:12 ` Paul E. McKenney
2026-11-02 12:21 ` Jan Engelhardt
2026-11-02 16:34 ` David Laight [this message]
2026-11-03 2:03 ` Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261102163448.3956dde3@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=arnd@kernel.org \
--cc=brads@mainlining.org \
--cc=ej@inai.de \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®