public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>, Adrian Bunk <bunk@kernel.org>,
	linux arch <linux-arch@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	David Miller <davem@davemloft.net>
Subject: Re: [PATCH] prepare kconfig inline optimization for all architectures
Date: Sun, 27 Apr 2008 11:24:28 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.1.10.0804271118500.2896@woody.linux-foundation.org> (raw)
In-Reply-To: <20080427181411.GA31667@infradead.org>



On Sun, 27 Apr 2008, Christoph Hellwig wrote:
> 
> As Linus mentioned the hint doesn't make any sense because gcc will
> get it wrong anyway.  In fact when you look at kernel code it tends
> to inline the everything and the kitchensink as long as there's just
> one caller and this bloat the stack but doesn't inline where it needs
> to.  Better don't try to mess with that and do it explicit.

The thing is, the "inline" vs "always_inline" thing _could_ make sense, 
but sadly doesn't much.

Part of it is that gcc imnsho inlines too aggressively anyway in the 
absense of "inline", so there's no way "inline" can mean "you might 
inline" this, because gcc will do that anyway even without it. As a 
result, in _practice_ "inline" and "always_inline" end up being very close 
to each other - perhaps more so than they should.

I do obviously think that we're right to move into the direction that 
"inline" should be a hint. In fact, the biggest issue I have with the new 
kconfig option is that I think it should probably be unconditional, but I 
suspect that compiler issues and architecture issues make that not be a 
good idea.

It will take time before we've sorted out all the fall-out, because I bet 
there is still code out there that _should_ use __always_inline, but 
doesn't.

			Linus

  reply	other threads:[~2008-04-27 18:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27 10:51 [PATCH] prepare kconfig inline optimization for all architectures Sam Ravnborg
2008-04-27 11:31 ` Adrian Bunk
2008-04-27 11:56   ` Sam Ravnborg
2008-04-27 12:36     ` Ingo Molnar
2008-04-27 12:49       ` Ingo Molnar
2008-04-27 17:06   ` Linus Torvalds
2008-04-27 17:22     ` Adrian Bunk
2008-04-27 17:32       ` Linus Torvalds
2008-04-27 17:47         ` Adrian Bunk
2008-04-27 18:00           ` Christoph Hellwig
2008-04-27 18:09             ` Sam Ravnborg
2008-04-27 18:14               ` Christoph Hellwig
2008-04-27 18:24                 ` Linus Torvalds [this message]
2008-04-27 18:32                   ` Christoph Hellwig
2008-04-27 19:36                   ` Ingo Molnar
2008-04-27 19:49                     ` Adrian Bunk
2008-04-27 23:26                   ` Arjan van de Ven
2008-04-27 23:36                     ` Linus Torvalds
2008-04-27 23:41                       ` Ingo Molnar
2008-04-27 18:31                 ` Sam Ravnborg
2008-04-27 18:36                   ` Christoph Hellwig
2008-04-27 18:11           ` Linus Torvalds
2008-04-27 18:25             ` Christoph Hellwig
2008-04-27 18:30               ` Linus Torvalds
2008-04-27 18:41             ` Adrian Bunk
2008-04-27 18:57               ` Linus Torvalds
2008-04-27 20:51           ` Mike Galbraith
2008-04-27 17:57         ` Christoph Hellwig
2008-04-27 17:40       ` Matthew Wilcox
2008-04-27 17:59         ` Adrian Bunk

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=alpine.LFD.1.10.0804271118500.2896@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=bunk@kernel.org \
    --cc=davem@davemloft.net \
    --cc=hch@infradead.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sam@ravnborg.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