All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Trippelsdorf <markus@trippelsdorf.de>
To: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	x86@kernel.org
Subject: Re: [PATCH] enforce function inlining for hot functions
Date: Sat, 25 Apr 2015 12:53:42 +0200	[thread overview]
Message-ID: <20150425105342.GA396@x4> (raw)
In-Reply-To: <CAPh34mcy+c-m3Pw-r=4JijPWDN8=fpVHM7UrNr-XSz6DJXsuug@mail.gmail.com>

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

      reply	other threads:[~2015-04-25 10:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 21:40 [PATCH] enforce function inlining for hot functions Hagen Paul Pfeifer
2015-04-24 19:49 ` Andrew Morton
2015-04-24 20:13   ` Paul E. McKenney
2015-04-24 20:44     ` Hagen Paul Pfeifer
2015-04-24 23:10     ` Hagen Paul Pfeifer
2015-04-25 10:31       ` Paul E. McKenney
2015-04-25 13:26         ` Hagen Paul Pfeifer
2015-04-25 13:51           ` Paul E. McKenney
2015-04-24 20:39   ` Hagen Paul Pfeifer
2015-04-25 10:53     ` Markus Trippelsdorf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150425105342.GA396@x4 \
    --to=markus@trippelsdorf.de \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=hagen@jauu.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.