[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241219175333.GE26279@noisy.programming.kicks-ass.net>
Date: Thu, 19 Dec 2024 18:53:33 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Florian Weimer <fweimer@...hat.com>
Cc: "Paul E. McKenney" <paulmck@...nel.org>, Daniel Xu <dxu@...uu.xyz>,
mingo@...hat.com, will@...nel.org, longman@...hat.com,
boqun.feng@...il.com, linux-kernel@...r.kernel.org,
linux-toolchains@...r.kernel.org
Subject: Re: [PATCH] seqlock: Use WRITE_ONCE() when updating sequence
On Thu, Dec 19, 2024 at 05:45:15PM +0100, Florian Weimer wrote:
> > Peter's "(*(volatile unsigned int *)&s->sequence)++;" qualifies as sane.
>
> I think the reference was originally to machine code.
Correct; however more tinkering with godbolt got me:
https://godbolt.org/z/6xoxjdYPx
Where we can see that clang can even optimize the WRITE_ONCE(foo,
READ_ONCE(foo) + 1) case, which I though it would not be able to do.
So perhaps we just need to get GCC fixed.
Powered by blists - more mailing lists