From: "Arnd Bergmann" <arnd@arndb.de>
To: "Kunwu Chan" <kunwu.chan@gmail.com>,
"Anna-Maria Gleixner" <anna-maria@linutronix.de>,
"Frederic Weisbecker" <frederic@kernel.org>,
"Ingo Molnar" <mingo@kernel.org>,
"Thomas Gleixner" <tglx@kernel.org>
Cc: Linux-Arch <linux-arch@vger.kernel.org>,
linux-kernel@vger.kernel.org,
"Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: [PATCH v3 1/2] rwonce: Add READ_ONCE_THIS_CPU() and WRITE_ONCE_THIS_CPU()
Date: Wed, 07 Oct 2026 12:50:18 +0200 [thread overview]
Message-ID: <66d8d340-ff50-4fcb-bf19-05fa68c27238@app.fastmail.com> (raw)
In-Reply-To: <20261007022859.60101-2-kunwu.chan@gmail.com>
On Wed, Oct 7, 2026, at 04:28, Kunwu Chan wrote:
> Per-CPU variables are sometimes accessed from different execution
> contexts on the same CPU, typically task context and an interrupt or
> NMI handler.
>
> A plain READ_ONCE() or WRITE_ONCE() marks such an access as an
> intentional race but does not express where the racing accesses are
> expected to come from. This distinction allows concurrency tools such
> as KCSAN to tell an intentional same-CPU context race apart from an
> access that may race across CPUs.
>
> Add READ_ONCE_THIS_CPU() and WRITE_ONCE_THIS_CPU() to identify accesses
> to a per-CPU variable which are intended to race only with accesses
> from other execution contexts on the same CPU. For now, they are
> simple wrappers around READ_ONCE() and WRITE_ONCE(), so generated code
> and tool behaviour are unchanged.
>
> Suggested-by: Thomas Gleixner <tglx@kernel.org>
> Suggested-by: Paul E. McKenney <paulmck@kernel.org>
> Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
> Acked-by: Frederic Weisbecker <frederic@kernel.org>
> Signed-off-by: Kunwu Chan <kunwu.chan@gmail.com>
No objections here, but since I missed the background, I don't
see what a future implementation of the new macros might do
that is different from the existing macros, maybe you can still
clarify that.
For taking this through something other than my asm-generic tree:
Acked-by: Arnd Bergmann <arnd@arndb.de>
next prev parent reply other threads:[~2026-10-07 10:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 2:28 [PATCH v3 0/2] rwonce: Introduce {READ,WRITE}_ONCE_THIS_CPU() Kunwu Chan
2026-10-07 2:28 ` [PATCH v3 1/2] rwonce: Add READ_ONCE_THIS_CPU() and WRITE_ONCE_THIS_CPU() Kunwu Chan
2026-10-07 10:50 ` Arnd Bergmann [this message]
2026-10-08 5:56 ` KunWu Chan
2026-10-07 2:28 ` [PATCH v3 2/2] timers/nohz: Mark got_idle_tick accesses as same-CPU races Kunwu Chan
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=66d8d340-ff50-4fcb-bf19-05fa68c27238@app.fastmail.com \
--to=arnd@arndb.de \
--cc=anna-maria@linutronix.de \
--cc=frederic@kernel.org \
--cc=kunwu.chan@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@kernel.org \
--cc=tglx@kernel.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®