lkml.org 
[lkml]   [2015]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] enforce function inlining for hot functions
On 2015.04.24 at 22:39 +0200, Hagen Paul Pfeifer wrote:
> On 24 April 2015 at 21:49, Andrew Morton <akpm@linux-foundation.org> wrote:
> > I can't reproduce this with either gcc-4.8.2 or gcc-4.4.4. The patch
> > makes zero difference to `size vmlinux' and a bit of poking around with
> > nm doesn't show any out-of-lined versions of the functions you
> > identify.
> >
> > So. More details, please. How to demonstrate this, gcc versions, etc.
>
> first of all you should probably scan over https://lkml.org/lkml/2015/4/21/178
> Some questions are already answered there.
>
> Here is the situation: the inlining problem occur with the 4.9.x
> branch - I tried to reproduce it with 4.8.x and saw *no* problems. So
> it is probably limited to 4.9 - which is sad. I don't checked it with
> 5.0 or 5.1 yet. Then, if CONFIG_OPTIMIZE_INLINING is disabled inlining
> is enforced anyway, so there is no problem because all inlined marked
> functions are always inlined - gcc heuristic is defacto disabled. This
> patch makes sure that the hot functions always inlined, no matter what
> config is selected or compiler version is used. Yes, in an ideal world
> gcc had inlined most of them - now we enforce the ideal world.

Please note that this only happens with -Os (aka
CONFIG_CC_OPTIMIZE_FOR_SIZE). The reason for this is that gcc simply
doesn't inline when the function body would grow if the call is
considered cold.

--
Markus


\
 
 \ /
  Last update: 2015-04-25 13:21    [W:0.062 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site