public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: Andi Kleen <ak@suse.de>
Cc: Sam Ravnborg <sam@ravnborg.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: unify x86 Makefile(s)
Date: Sun, 30 Dec 2007 13:01:11 +0200	[thread overview]
Message-ID: <20071230110111.GB31605@does.not.exist> (raw)
In-Reply-To: <200712300300.51427.ak@suse.de>

On Sun, Dec 30, 2007 at 03:00:51AM +0100, Andi Kleen wrote:
> 
> > Without inlining the maxmimum stack usage inside foobar() is
> > max(stack usage foo(), stack usage bar()). [1]
> 
> It's a little more complicated. gcc 4.x (not sure which x, might 0) 
> is clever enough to not use max() stack, but only use the stack for the 
> different scopes as needed similar as when the calls weren't inlined. 
> But gcc 3 didn't do that.

That's roughly what I wanted to say.

> > With foo() and bar() inlined (-funit-at-a-time also enables 
> > -finline-functions-called-once), the maxmimum stack usage inside 
> > foobar() is sum(stack usage foo(), stack usage bar()). And this
> > worst case is the area where gcc 4 is much better than gcc 3.4.
> 
> Yes exactly.  If the functions weren't inlined the problem wouldn't
> occur because the stack sizes do not add up in the same dynamic call chain. 
> Thus a few statetic noinlines will fix it.

And we are back at my main point that risking regressions for getting 
better code with some ancient compiler isn't worth it.

Plus the fact that noinline's might result in slightly worse code with 
current compilers.

> -Andi

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  reply	other threads:[~2007-12-30 11:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-28 21:23 [PATCH] x86: unify x86 Makefile(s) Sam Ravnborg
2007-12-28 22:13 ` Adrian Bunk
2007-12-29  2:14   ` Andi Kleen
2007-12-29  8:07     ` Adrian Bunk
2007-12-29  9:39   ` Sam Ravnborg
2007-12-29  9:52     ` Adrian Bunk
2007-12-29 12:16       ` Andi Kleen
2007-12-29 12:54         ` Adrian Bunk
2007-12-29 18:22           ` Sam Ravnborg
2007-12-29 18:24             ` Andi Kleen
2007-12-29 18:58               ` Sam Ravnborg
2007-12-29 21:17                 ` Andi Kleen
2007-12-29 21:45                   ` Adrian Bunk
2007-12-30  2:00                     ` Andi Kleen
2007-12-30 11:01                       ` Adrian Bunk [this message]
2007-12-29  2:22 ` Andi Kleen
2007-12-29  8:07   ` Sam Ravnborg

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=20071230110111.GB31605@does.not.exist \
    --to=bunk@kernel.org \
    --cc=ak@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    /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