From: Matt Mackall <mpm@selenic.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Tim Yamin <plasmaroo@gentoo.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@suse.de>
Subject: Re: [PATCH UPDATE] deflate stack usage in lib/inflate.c
Date: Fri, 13 Apr 2007 13:42:34 -0500 [thread overview]
Message-ID: <20070413184234.GB11166@waste.org> (raw)
In-Reply-To: <461E9BAD.8050202@goop.org>
On Thu, Apr 12, 2007 at 01:50:54PM -0700, Jeremy Fitzhardinge wrote:
> Subject: deflate stack usage in lib/inflate.c
>
> inflate_fixed and huft_build together use around 2.7k of stack. When
> using 4k stacks, I saw stack overflows from interrupts arriving while
> unpacking the root initrd:
>
> do_IRQ: stack overflow: 384
> [<c0106b64>] show_trace_log_lvl+0x1a/0x30
> [<c01075e6>] show_trace+0x12/0x14
> [<c010763f>] dump_stack+0x16/0x18
> [<c0107ca4>] do_IRQ+0x6d/0xd9
> [<c010202b>] xen_evtchn_do_upcall+0x6e/0xa2
> [<c0106781>] xen_hypervisor_callback+0x25/0x2c
> [<c010116c>] xen_restore_fl+0x27/0x29
> [<c0330f63>] _spin_unlock_irqrestore+0x4a/0x50
> [<c0117aab>] change_page_attr+0x577/0x584
> [<c0117b45>] kernel_map_pages+0x8d/0xb4
> [<c016a314>] cache_alloc_refill+0x53f/0x632
> [<c016a6c2>] __kmalloc+0xc1/0x10d
> [<c0463d34>] malloc+0x10/0x12
> [<c04641c1>] huft_build+0x2a7/0x5fa
> [<c04645a5>] inflate_fixed+0x91/0x136
> [<c04657e2>] unpack_to_rootfs+0x5f2/0x8c1
> [<c0465acf>] populate_rootfs+0x1e/0xe4
>
> (This was under Xen, but there's no reason it couldn't happen on bare
> hardware.)
>
> This patch mallocs the local variables, thereby reducing the stack
> usage to sane levels.
>
> Also, up the heap size for the kernel decompressor to deal with the
> extra allocation.
Lost the non-x86 bits again.
--
Mathematics is the supreme nostalgia of our time.
prev parent reply other threads:[~2007-04-13 18:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-12 8:25 [PATCH] " Jeremy Fitzhardinge
2007-04-12 20:50 ` [PATCH UPDATE] " Jeremy Fitzhardinge
2007-04-12 21:21 ` Andi Kleen
2007-04-12 22:39 ` Jeremy Fitzhardinge
2007-04-12 23:20 ` Jan Engelhardt
2007-04-12 23:31 ` Jeremy Fitzhardinge
2007-04-12 23:37 ` Andi Kleen
2007-04-12 22:56 ` Jeremy Fitzhardinge
2007-04-12 23:02 ` Andi Kleen
2007-04-13 0:00 ` Jeremy Fitzhardinge
2007-04-12 23:06 ` Chuck Ebbert
2007-04-12 22:25 ` Matt Mackall
2007-04-12 22:57 ` Jeremy Fitzhardinge
2007-04-12 22:53 ` Matt Mackall
2007-04-16 21:04 ` Russell King
2007-04-13 18:42 ` Matt Mackall [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=20070413184234.GB11166@waste.org \
--to=mpm@selenic.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=plasmaroo@gentoo.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
all inboxes | Powered by JetHome®