[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47bfda8f-304e-5283-c6d6-0753037b0b2c@redhat.com>
Date: Tue, 6 Oct 2020 16:16:26 +0100
From: Nick Clifton <nickc@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>,
"stern@...land.harvard.edu" <stern@...land.harvard.edu>
Cc: David Laight <David.Laight@...lab.com>,
"linux-toolchains@...r.kernel.org" <linux-toolchains@...r.kernel.org>,
Will Deacon <will@...nel.org>,
Paul McKenney <paulmck@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"parri.andrea@...il.com" <parri.andrea@...il.com>,
"boqun.feng@...il.com" <boqun.feng@...il.com>,
"npiggin@...il.com" <npiggin@...il.com>,
"dhowells@...hat.com" <dhowells@...hat.com>,
"j.alglave@....ac.uk" <j.alglave@....ac.uk>,
"luc.maranget@...ia.fr" <luc.maranget@...ia.fr>,
"akiyks@...il.com" <akiyks@...il.com>,
"dlustig@...dia.com" <dlustig@...dia.com>,
"joel@...lfernandes.org" <joel@...lfernandes.org>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>
Subject: Re: Control Dependencies vs C Compilers
Hi Guys,
OK, so playing the devils advocate here...
> Mostly I just want the compiler people to say they'll guarantee the
> behaviour if we do 'X'. If 'X' happens to be 'any dynamic branch headed
> by a volatile load' that's fine by me.
Is a compiler hack really the right way to go here ?
After all, if you do get this feature added it will make it
harder to compile the kernel with other compilers (*cough
LLVM cough*), or older versions of gcc. Plus code like this
is often subject to very aggressive optimization and all it
takes is one bug in the compiler implementation and you lose
the gains you were trying for.
My suggestion as an alternative is to use assembler instead.
That way you can guarantee that you get the instructions you
want in the order that you want them. It should be fairly
straightforward to create a macro or inline function that
contains the necessary code and this can be done once and
then used wherever the functionality is required.
Cheers
Nick
Powered by blists - more mailing lists