From: Rob Landley <rob@landley.net>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: Adrian Bunk <bunk@stusta.de>,
Arjan van de Ven <arjan@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: Status of CONFIG_FORCED_INLINING?
Date: Thu, 24 May 2007 13:40:54 -0400 [thread overview]
Message-ID: <200705241340.54796.rob@landley.net> (raw)
In-Reply-To: <Pine.LNX.4.61.0705241829000.31549@yvahk01.tjqt.qr>
On Thursday 24 May 2007 12:29 pm, Jan Engelhardt wrote:
>
> On May 23 2007 23:22, Adrian Bunk wrote:
> >
> >And we need only two different inline levels (__always_inline and
> >"let the compiler decide"), not three (__always_inline, inline and
> >"let the compiler decide").
>
> "inline" is "let the compiler decide".
The compiler decides anyway. That's why we need a noinline to tell it _not_
to spontaneously inline things it shouldn't.
> If it is not, then it is "let the
> compiler decide, based on my bias that I think it should be inlined".
Things like unlikely() actually produce different code (and are, technically
speaking, workarounds for the high branch misprediction penalty in modern
processor designs).
Things like "register" are a hint to the compiler that it's free to ignore.
How often do we use the "register" keyword in Linux? Register allocation is
totally different on different processors, and deprived of context the hint
is almomst meaningless. If it doesn't guarantee anything and has far less of
a performance impact than the difference between -O2 and -Os (or between gcc
3.4 and 4.1), then it's probably an unnecessary complication.
Inlining is even worse because whether or not it's a performance win depends
on the L1 cache size, cache line size and alignment, L2 cache, DRAM fetch
latency, and so on. This varies all over the map within a given processor
line, let alone between processors.
If we actually need something inlined, we can tell it to do so reliably with
__always_inline (and change __always_inline to be MORE explicit each time gcc
breaks the previous way of saying "yes really inline it dammit"). If we can
live with it not being inlined, why not leave it to the compiler whether or
not to inline it?
Rob
prev parent reply other threads:[~2007-05-24 17:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-23 19:10 Status of CONFIG_FORCED_INLINING? Rob Landley
2007-05-23 19:42 ` Arjan van de Ven
2007-05-23 21:22 ` Adrian Bunk
2007-05-23 21:28 ` Roland Dreier
2007-05-24 12:38 ` Robert P. J. Day
2007-05-24 16:55 ` Rob Landley
2007-05-24 17:10 ` Adrian Bunk
2007-05-24 17:14 ` Roland Dreier
2007-05-24 17:47 ` Rob Landley
2007-05-24 17:47 ` Arjan van de Ven
2007-05-24 18:14 ` Rob Landley
2007-05-24 17:55 ` Roland Dreier
2007-05-24 18:07 ` Adrian Bunk
2007-05-24 18:32 ` Roland Dreier
2007-05-24 22:41 ` Adrian Bunk
2007-05-24 17:57 ` Adrian Bunk
2007-05-23 21:31 ` Arjan van de Ven
2007-05-24 17:12 ` Adrian Bunk
2007-05-24 16:29 ` Jan Engelhardt
2007-05-24 17:14 ` Adrian Bunk
2007-05-24 17:17 ` Arjan van de Ven
2007-05-24 17:40 ` Rob Landley [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=200705241340.54796.rob@landley.net \
--to=rob@landley.net \
--cc=arjan@linux.intel.com \
--cc=bunk@stusta.de \
--cc=jengelh@linux01.gwdg.de \
--cc=linux-kernel@vger.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