Re: [PATCH] prepare kconfig inline optimization for all architectures

Christoph Hellwig
2008-04-27T18:14:14Z

On Sun, Apr 27, 2008 at 08:09:57PM +0200, Sam Ravnborg wrote:
> With the config option we pass the inline hint to gcc (if enabled).
> So with the config option we have the possibility to pass a _hint_ to
> gcc about inlining.
>
> Before the config option there were no difference between
> static int alwyas_inline foo() {}
> and
> static int inline foo() {}
>
> With the config option we now have a situation where they actually
> differ as they should do (assuming gcc > 4.x).

As Linus mentioned the hint doesn't make any sense because gcc will
get it wrong anyway. In fact when you look at kernel code it tends
to inline the everything and the kitchensink as long as there's just
one caller and this bloat the stack but doesn't inline where it needs
to. Better don't try to mess with that and do it explicit.

> So you say that it is safe to assume all places where we really need
> always_inline are annotedted such - and we do not need a simple
> config option that the user can uncheck.

I don't say it is that, it certainly isn't on powerpc and probably most
other architectures right now, because only x86 got the fixup so far.
But making it a user-visible option instead of an architecture opt
in/out selection doesn't make any sense.