public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"David S. Miller" <davem@davemloft.net>,
	x86@kernel.org
Subject: Re: [PATCH] enforce function inlining for hot functions
Date: Fri, 24 Apr 2015 13:13:40 -0700	[thread overview]
Message-ID: <20150424201340.GD5561@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150424124905.07e29a3b1392513144cd1568@linux-foundation.org>

On Fri, Apr 24, 2015 at 12:49:05PM -0700, Andrew Morton wrote:
> On Thu, 23 Apr 2015 23:40:01 +0200 Hagen Paul Pfeifer <hagen@jauu.net> wrote:
> 
> > GCC inlining heuristics are sometimes quizzical. Especially with inline
> > assembler constructs GCC seems to have issues. A allyesconfig show a rather
> > long list of functions where GCC inlining decisions are questionable (not
> > inlined).
> 
> 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.
> 
> > Furthermore, because the functions are declared with static
> > linkage each function is copied n times - and n can be rather high:
> > 
> >               atomic_inc: 544 duplicates
> >          rcu_read_unlock: 453 duplicates
> >            rcu_read_lock: 383 duplicates

Hmmm...  allyesconfig would have PROVE_RCU=y, which would mean that the
above two would contain lockdep calls that might in some cases defeat
inlining.  With the more typical production choice of PROVE_RCU=n, I would
expect these to just be a call instruction, which should get inlined.

							Thanx, Paul

> >              get_dma_ops: 271 duplicates
> >   arch_local_irq_restore: 258 duplicates
> >               atomic_dec: 215 duplicates
> >                  kzalloc: 185 duplicates
> >            cpumask_check: 157 duplicates
> >         test_and_set_bit: 156 duplicates
> >             cpumask_next: 146 duplicates
> >                 list_del: 131 duplicates
> >                 kref_get: 126 duplicates
> 
> That's pretty pathetic.
> 


  reply	other threads:[~2015-04-24 20:13 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 [this message]
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

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=20150424201340.GD5561@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox