linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: Large stack usage in fs code (especially for PPC64)
Date: Mon, 17 Nov 2008 23:25:30 +0200	[thread overview]
Message-ID: <84144f020811171325m5eabca71ge525ea643dbe8209@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0811171309580.18283@nehalem.linux-foundation.org>

On Mon, Nov 17, 2008 at 11:18 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> I do wonder just _what_ it is that causes the stack frames to be so
> horrid. For example, you have
>
>         18)     8896     160   .kmem_cache_alloc+0xfc/0x140
>
> and I'm looking at my x86-64 compile, and it has a stack frame of just 8
> bytes (!) for local variables plus the save/restore area (which looks like
> three registers plus frame pointer plus return address). IOW, if I'm
> looking at the code right (so big caveat: I did _not_ do a real stack
> dump!) the x86-64 stack cost for that same function is on the order of 48
> bytes. Not 160.
>
> Where does that factor-of-three+ difference come from? From the numbers, I
> suspect ppc64 has a 32-byte stack alignment, which may be part of it, and
> I guess the compiler is more eager to use all those extra registers and
> will happily have many more callee-saved regs that are actually used.
>
> But that still a _lot_ of extra stack.
>
> Of course, you may have things like spinlock debugging etc enabled. Some
> of our debugging options do tend to blow things up.

Note that kmem_cache_alloc() is likely to contain lots of inlined
functions for both SLAB and SLUB. Perhaps that blows up stack usage on
ppc?

  reply	other threads:[~2008-11-17 21:25 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17 20:34 Large stack usage in fs code (especially for PPC64) Steven Rostedt
2008-11-17 20:59 ` Steven Rostedt
2008-11-17 21:18   ` Linus Torvalds
2008-11-17 21:25     ` Pekka Enberg [this message]
2008-11-18  0:54     ` Steven Rostedt
2008-11-18  1:05       ` Paul Mackerras
2008-11-18  1:41         ` Steven Rostedt
2008-11-18  2:01           ` Steven Rostedt
2008-11-17 22:16   ` Paul Mackerras
2008-11-17 23:30     ` Steven Rostedt
2008-11-17 23:04   ` Benjamin Herrenschmidt
2008-11-18  2:29   ` Steven Rostedt
2008-11-18  2:36     ` Paul Mackerras
2008-11-18  5:40       ` David Miller
2008-11-17 21:08 ` Andrew Morton
2008-11-17 21:23   ` Linus Torvalds
2008-11-17 21:31     ` Andrew Morton
2008-11-17 21:42       ` Linus Torvalds
2008-11-17 23:17       ` Benjamin Herrenschmidt
2008-11-17 21:09 ` Linus Torvalds
2008-11-17 22:53   ` Paul Mackerras
2008-11-18 10:07     ` Nick Piggin
2008-11-17 23:13   ` Benjamin Herrenschmidt
2008-11-17 23:22     ` Josh Boyer
2008-11-17 23:28     ` Linus Torvalds
2008-11-18  0:11       ` Paul Mackerras
2008-11-18  2:08         ` Linus Torvalds
2008-11-18 10:24           ` Nick Piggin
2008-11-18 11:44             ` Paul Mackerras
2008-11-18 16:02             ` Linus Torvalds
2008-11-18  7:25       ` Benjamin Herrenschmidt
2008-11-17 23:03 ` Benjamin Herrenschmidt
2008-11-18  9:53   ` Christoph Hellwig
2008-11-18 10:37     ` Ingo Molnar
2008-11-17 23:30 ` Benjamin Herrenschmidt

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=84144f020811171325m5eabca71ge525ea643dbe8209@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --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).