From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
LKML <linux-kernel@vger.kernel.org>,
linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: Large stack usage in fs code (especially for PPC64)
Date: Tue, 18 Nov 2008 10:30:27 +1100 [thread overview]
Message-ID: <1226964627.7178.261.camel@pasglop> (raw)
In-Reply-To: <alpine.DEB.1.10.0811171508300.8722@gandalf.stny.rr.com>
On Mon, 2008-11-17 at 15:34 -0500, Steven Rostedt wrote:
>
> I've been hitting stack overflows on a PPC64 box, so I ran the ftrace
> stack_tracer and part of the problem with that box is that it can nest
> interrupts too deep. But what also worries me is that there's some heavy
> hitters of stacks in generic code. Namely the fs directory has some.
Note that we shouldn't stack interrupts much in practice. The PIC will
not let same or lower prio interrupts in until we have completed one.
However timer/decrementer is not going through the PIC, so I think what
happens is we get a hw IRQ, on the way back, just before returning from
do_IRQ (so we have completed the IRQ from the PIC standpoint), we go
into soft-irq's, at which point deep inside SCSI we get another HW IRQ
and we stack a decrementer interrupt on top of it.
Now, we should do stack switching for both HW IRQs and softirqs with
CONFIG_IRQSTACKS, which should significantly alleviate the problem.
Your second trace also shows how horrible the stack traces can be when
the device-model kicks in, ie, register->probe->register sub device ->
etc... that isnt going to be nice on x86 with 4k stacks neither.
I wonder if we should generally recommend for drivers of "bus" devices
not to register sub devices from their own probe() routine, but defer
that to a kernel thread... Because the stacking can be pretty bad, I
mean, nobody's done SATA over USB yet but heh :-)
Cheers,
Ben.
prev parent reply other threads:[~2008-11-17 23:31 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
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 [this message]
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=1226964627.7178.261.camel@pasglop \
--to=benh@kernel.crashing.org \
--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).