From: Linus Torvalds <torvalds@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Paul Mackerras <paulus@samba.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linuxppc-dev@ozlabs.org,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: Large stack usage in fs code (especially for PPC64)
Date: Mon, 17 Nov 2008 13:09:29 -0800 (PST) [thread overview]
Message-ID: <alpine.LFD.2.00.0811171300410.18283@nehalem.linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.1.10.0811171508300.8722@gandalf.stny.rr.com>
On Mon, 17 Nov 2008, Steven Rostedt wrote:
>
> 45) 4992 1280 .block_read_full_page+0x23c/0x430
> 46) 3712 1280 .do_mpage_readpage+0x43c/0x740
Ouch.
> Notice at line 45 and 46 the stack usage of block_read_full_page and
> do_mpage_readpage. They each use 1280 bytes of stack! Looking at the start
> of these two:
>
> int block_read_full_page(struct page *page, get_block_t *get_block)
> {
> struct inode *inode = page->mapping->host;
> sector_t iblock, lblock;
> struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE];
Yeah, that's unacceptable.
Well, it's not unacceptable on good CPU's with 4kB blocks (just an 8-entry
array), but as you say:
> On PPC64 I'm told that the page size is 64K, which makes the above equal
> to: 64K / 512 = 128 multiply that by 8 byte words, we have 1024 bytes.
Yeah. Not good. I think 64kB pages are insane. In fact, I think 32kB
pages are insane, and 16kB pages are borderline. I've told people so.
The ppc people run databases, and they don't care about sane people
telling them the big pages suck. It's made worse by the fact that they
also have horribly bad TLB fills on their broken CPU's, and years and
years of telling people that the MMU on ppc's are sh*t has only been
reacted to with "talk to the hand, we know better".
Quite frankly, 64kB pages are INSANE. But yes, in this case they actually
cause bugs. With a sane page-size, that *arr[MAX_BUF_PER_PAGE] thing uses
64 bytes, not 1kB.
I suspect the PPC people need to figure out some way to handle this in
their broken setups (since I don't really expect them to finally admit
that they were full of sh*t with their big pages), but since I think it's
a ppc bug, I'm not at all interested in a fix that penalizes the _good_
case.
So either make it some kind of (clean) conditional dynamic non-stack
allocation, or make it do some outer loop over the whole page that turns
into a compile-time no-op when the page is sufficiently small to be done
in one go.
Or perhaps say "if you have 64kB pages, you're a moron, and to counteract
that moronic page size, you cannot do 512-byte granularity IO any more".
Of course, that would likely mean that FAT etc wouldn't work on ppc64, so
I don't think that's a valid model either. But if the 64kB page size is
just a "database server crazy-people config option", then maybe it's
acceptable.
Database people usually don't want to connect their cameras or mp3-players
with their FAT12 filesystems.
Linus
next prev parent reply other threads:[~2008-11-17 21:11 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-17 20:34 Steven Rostedt
2008-11-17 20:59 ` Steven Rostedt
2008-11-17 21:18 ` Linus Torvalds
2008-11-17 21:25 ` Pekka Enberg
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 [this message]
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=alpine.LFD.2.00.0811171300410.18283@nehalem.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.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 \
/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
all inboxes | Powered by JetHome®