android_kernel_xiaomi_sm8350/arch/i386
Jeremy Fitzhardinge 35c7422649 [PATCH] x86: 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.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Tim Yamin <plasmaroo@gentoo.org>
Cc: Andi Kleen <ak@suse.de>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Ian Molton <spyro@f2s.com>
2007-05-02 19:27:15 +02:00
..
boot [PATCH] x86: deflate stack usage in lib/inflate.c 2007-05-02 19:27:15 +02:00
crypto
kernel [PATCH] i386: PARAVIRT: drop unused ptep_get_and_clear 2007-05-02 19:27:15 +02:00
lib [PATCH] i386: type cast clean up for find_next_zero_bit 2007-05-02 19:27:08 +02:00
mach-default [PATCH] clockevents: i386 drivers 2007-02-16 08:13:59 -08:00
mach-es7000
mach-generic [PATCH] i386: modpost apic related warning fixes 2007-05-02 19:27:08 +02:00
mach-visws
mach-voyager [PATCH] i386: Use per-cpu GDT immediately upon boot 2007-05-02 19:27:10 +02:00
math-emu [PATCH] i386: avoid gcc extension 2007-02-13 13:26:24 +01:00
mm [PATCH] i386: PARAVIRT: flush lazy mmu updates on kunmap_atomic 2007-05-02 19:27:15 +02:00
oprofile [PATCH] i386: Support Oprofile for AMD Family 10 CPUs 2007-05-02 19:27:06 +02:00
pci [PATCH] MSI-X: fix resume crash 2007-03-28 13:59:37 -07:00
power [PATCH] x86: Move swsusp __pa() dependent code to arch portion 2007-05-02 19:27:07 +02:00
defconfig [PATCH] i386: Update defconfig 2007-05-02 19:27:04 +02:00
Kconfig [PATCH] i386: Use menuconfig objects - APM 2007-05-02 19:27:12 +02:00
Kconfig.cpu [PATCH] i386: Add an option for the VIA C7 which sets appropriate L1 cache 2007-05-02 19:27:05 +02:00
Kconfig.debug [PATCH] i386: PARAVIRT: Remove CONFIG_DEBUG_PARAVIRT 2007-05-02 19:27:13 +02:00
Makefile [PATCH] x86: Drop cc-options call for all options supported in gcc 3.2+ 2007-05-02 19:27:06 +02:00
Makefile.cpu [PATCH] i386: Fix usage of -mtune when X86_GENERIC=y or CONFIG_MCORE2=y 2007-05-02 19:27:06 +02:00