From: Benjamin LaHaise <bcrl@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [patch] reduce stack usage of sanitize_e820_map
Date: Thu, 15 Aug 2002 17:48:25 -0400 [thread overview]
Message-ID: <20020815174825.F29874@redhat.com> (raw)
Hello,
Currently, sanitize_e820_map uses 0x738 bytes of stack. The patch below
moves the arrays into __initdata, reducing stack usage to 0x34 bytes.
-ben
:r ~/patches/v2.5/v2.5.31-stack-e820.diff
diff -urN foo-v2.5.31/arch/i386/kernel/setup.c bar-v2.5.31/arch/i386/kernel/setup.c
--- foo-v2.5.31/arch/i386/kernel/setup.c Mon Jun 17 15:41:13 2002
+++ bar-v2.5.31/arch/i386/kernel/setup.c Thu Aug 15 17:47:41 2002
@@ -275,16 +275,17 @@
* replaces the original e820 map with a new one, removing overlaps.
*
*/
+struct change_member {
+ struct e820entry *pbios; /* pointer to original bios entry */
+ unsigned long long addr; /* address for this change point */
+};
+struct change_member change_point_list[2*E820MAX] __initdata;
+struct change_member *change_point[2*E820MAX] __initdata;
+struct e820entry *overlap_list[E820MAX] __initdata;
+struct e820entry new_bios[E820MAX] __initdata;
+
static int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
{
- struct change_member {
- struct e820entry *pbios; /* pointer to original bios entry */
- unsigned long long addr; /* address for this change point */
- };
- struct change_member change_point_list[2*E820MAX];
- struct change_member *change_point[2*E820MAX];
- struct e820entry *overlap_list[E820MAX];
- struct e820entry new_bios[E820MAX];
struct change_member *change_tmp;
unsigned long current_type, last_type;
unsigned long long last_addr;
next reply other threads:[~2002-08-15 21:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-15 21:48 Benjamin LaHaise [this message]
2002-08-16 14:58 ` [patch] reduce stack usage of sanitize_e820_map Denis Vlasenko
2002-08-16 15:27 ` Linus Torvalds
2002-08-17 17:18 ` Eric W. Biederman
2002-08-17 19:17 ` Benjamin LaHaise
2002-08-17 19:35 ` Benjamin LaHaise
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=20020815174825.F29874@redhat.com \
--to=bcrl@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.