[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210604191756.GE68208@worktop.programming.kicks-ass.net>
Date: Fri, 4 Jun 2021 21:17:56 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Segher Boessenkool <segher@...nel.crashing.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Will Deacon <will@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Alan Stern <stern@...land.harvard.edu>,
Andrea Parri <parri.andrea@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Nick Piggin <npiggin@...il.com>,
David Howells <dhowells@...hat.com>,
Jade Alglave <j.alglave@....ac.uk>,
Luc Maranget <luc.maranget@...ia.fr>,
Akira Yokosawa <akiyks@...il.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-toolchains@...r.kernel.org,
linux-arch <linux-arch@...r.kernel.org>
Subject: Re: [RFC] LKMM: Add volatile_if()
On Fri, Jun 04, 2021 at 12:24:07PM -0500, Segher Boessenkool wrote:
> On Fri, Jun 04, 2021 at 10:10:29AM -0700, Linus Torvalds wrote:
> > The compiler *cannot* just say "oh, I'll do that 'volatile asm
> > barrier' whether the condition is true or not". That would be a
> > fundamental compiler bug.
>
> Yes.
So we can all agree on something like this?
#define volatile_if(x) \
if (({ _Bool __x = (x); BUILD_BUG_ON(__builtin_constant_p(__x)); __x; }) && \
({ barrier(); 1; }))
Do we keep volatile_if() or do we like ctrl_dep_if() better?
Powered by blists - more mailing lists