[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250226165619.64998576@gandalf.local.home>
Date: Wed, 26 Feb 2025 16:56:19 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Martin Uecker <uecker@...raz.at>, Ralf Jung <post@...fj.de>, "Paul E.
McKenney" <paulmck@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>, Ventura
Jack <venturajack85@...il.com>, Kent Overstreet
<kent.overstreet@...ux.dev>, Gary Guo <gary@...yguo.net>,
airlied@...il.com, boqun.feng@...il.com, david.laight.linux@...il.com,
ej@...i.de, gregkh@...uxfoundation.org, hch@...radead.org, hpa@...or.com,
ksummit@...ts.linux.dev, linux-kernel@...r.kernel.org,
miguel.ojeda.sandonis@...il.com, rust-for-linux@...r.kernel.org
Subject: Re: C aggregate passing (Rust kernel policy)
On Wed, 26 Feb 2025 13:42:29 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Wed, 26 Feb 2025 at 13:26, Steven Rostedt <rostedt@...dmis.org> wrote:
> >
> > As a bystander here, I just want to ask, do you mean basically to treat all
> > reads as READ_ONCE() and all writes as WRITE_ONCE()?
>
> Absolutely not.
>
> I thought I made that clear:
Sorry, I didn't make myself clear. I shouldn't have said "all reads". What
I meant was the the "initial read".
Basically:
r = READ_ONCE(*p);
and use what 'r' is from then on.
Where the compiler reads the source once and works with what it got.
To keep it from changing:
r = *p;
if (r > 1000)
goto out;
x = r;
to:
if (*p > 1000)
goto out;
x = *p;
-- Steve
Powered by blists - more mailing lists