From: "Paul E. McKenney" <paulmck@kernel.org>
To: Jan Engelhardt <ej@inai.de>
Cc: David Laight <david.laight.linux@gmail.com>,
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: Tue, 3 Nov 2026 12:33:03 -0800 [thread overview]
Message-ID: <dffbdb02-0093-409a-aa20-1cf2a33b8f94@paulmck-laptop> (raw)
In-Reply-To: <so31o447-8o91-0pop-06qq-92q0o584q8n5@vanv.qr>
On Tue, Nov 03, 2026 at 09:11:17PM +0100, Jan Engelhardt wrote:
>
> On Tuesday 2026-11-03 19:19, Paul E. McKenney wrote:
> >> >>
> >> >> 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?
> >>
> >> 12.0.0-20210420 behaves the same. I just chose 17 because that was
> >> convenient to try first.
> >
> >Are you also advocating ditching the single-byte cmpxchg() emulation?
>
> There is more?
Indeed there is, and has been for some years. See cmpxchg_emu_u8()
in that same file.
> Please note, I have not looked at the code at all. The patch
> description _alone_ was enough to make me ask, such conflicting
> rationale it had when presented to me.
>
> I had not planned to go on an expedition to see what gcc would
> produce, and was hoping the patch author had done that initially,
> to provide a good case for his patch rather than against it.
I am also not planning to go on such an expedition. ;-)
The case for the patch is that it is a simple and small change that
enables cmpxchg() on two-byte arguments to be used in common code.
Another advantage is that it works on all compilers currently supported
by the Linux kernel, no expeditions required.
When and if someone comes up with a better patch, then yes, we should
of course consider it.
Thanx, Paul
next prev parent reply other threads:[~2026-11-03 20:33 UTC|newest]
Thread overview: 19+ 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
2026-11-03 2:03 ` Jan Engelhardt
2026-11-03 18:19 ` Paul E. McKenney
2026-11-03 18:49 ` Bradley Morgan
2026-11-03 20:11 ` Jan Engelhardt
2026-11-03 20:33 ` Paul E. McKenney [this message]
2026-11-03 22:47 ` David Laight
2026-11-03 23:03 ` Paul E. McKenney
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=dffbdb02-0093-409a-aa20-1cf2a33b8f94@paulmck-laptop \
--to=paulmck@kernel.org \
--cc=arnd@kernel.org \
--cc=brads@mainlining.org \
--cc=david.laight.linux@gmail.com \
--cc=ej@inai.de \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.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®