Re: BUILD_BUG_ON(!__builtin_constant_p(feature)) breaks bcc trace tool

From
Arnd Bergmann <arnd@arndb.de>
Date
2017-01-25 15:44:08
Reply to
David Laight, 2017-01-25
On Wed, Jan 25, 2017 at 11:35 AM, David Laight [off-list ref] wrote:
From: Michael Ellerman
quoted
#define inline                inline          __attribute__((always_inline)) notrace

So in fact every inline function is marked always_inline all the time,
which seems dubious.
I've had to do that in the past to get gcc to inline some small leaf functions
that were only called once.
(That was for some embedded code where I don't actually want any function calls
at all.)

To my mind 'inline' should mean 'always_inline' since you need to explicitly
stop functions being inlined even when not marked 'inline'.
On x86, this is configurable using OPTIMIZE_INLINING, but IIRC no
other architecture
supports it in mainline Linux. I have played a bit with enabling it on
ARM, which
showed a couple of build warnings and errors from the changed inlining, but
they were all fixable. I have not submitted that since I have not actually been
able to do extensive runtime testing on it.

It may turn out to be worthwhile for powerpc, where you have a much more limited
set of configurations you care about and you already do some regular testing.
Potentially this is more efficient than the current default, and any
function that
actually requires being forced inline can be annotated as __always_inline rather
than plain inline.

     Arnd
Thread (8 messages) 8 messages, 5 authors, last reply 2017-01-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help