linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Daniel Santos <daniel.santos@pobox.com>
Cc: Daniel Santos <danielfsantos@att.net>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org, torvalds@linux-foundation.org
Subject: Re: Please be aware that __always_inline doesn't mean "always inline"!
Date: Wed, 26 Sep 2012 16:50:44 -0700	[thread overview]
Message-ID: <20120926165044.46b8f7d6.akpm@linux-foundation.org> (raw)
In-Reply-To: <50638DCC.5040506@att.net>

On Wed, 26 Sep 2012 18:20:44 -0500
Daniel Santos <danielfsantos@att.net> wrote:

> I've noticed that there's a lot of misperception about the meaning of
> the __always_inline, or more specifically,
> __attribute__((always_inline)), which does not actually cause the
> function to always be inlined.  Rather, it *allows* gcc to inline the
> function, even when compiling without optimizations.  Here is the
> description of the attribute from gcc's docs
> (http://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html)
> 
> always_inline
> Generally, functions are not inlined unless optimization is specified.
> For functions declared inline, this attribute inlines the function even
> if no optimization level was specified.
> 
> This would even appear to imply that such functions aren't even marked
> as "inline" (something I wasn't aware of until today).  The only
> mechanism I'm currently aware of to force gcc to inline a function is
> the flatten attribute (see https://lkml.org/lkml/2012/9/25/643) which
> works backwards, you declare it on the calling function, and it forces
> gcc to inline all functions (marked as inline) that it calls.

As I mentioned in the other thread, the __always_inline's in fs/namei.c
(at least) are doing exactly what we want them to do, so some more
investigation is needed here?


  reply	other threads:[~2012-09-26 23:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26 23:20 Please be aware that __always_inline doesn't mean "always inline"! Daniel Santos
2012-09-26 23:50 ` Andrew Morton [this message]
2012-09-27  0:03   ` Daniel Santos

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=20120926165044.46b8f7d6.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=daniel.santos@pobox.com \
    --cc=danielfsantos@att.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).