lkml.org 
[lkml]   [2002]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] reduce stack usage of sanitize_e820_map

On Fri, 16 Aug 2002, Denis Vlasenko wrote:
> >
> > Currently, sanitize_e820_map uses 0x738 bytes of stack. The patch below
> > moves the arrays into __initdata, reducing stack usage to 0x34 bytes.
>
> Is that a real problem? sanitize_e820_map will be called just once at init
> time...

Well, I would actually want us to have some tools that just say "you can't
do that". A flag to gcc that says "-Wstack-depth=200" that just makes gcc
refuse to compile functions that have too big of a stack requirement, so
that we'd see some of these things immediately.

Somebody had a script that greps the kernel disassembly for big stack
changes, I suspect Ben used something like that. That's obviously
equivalent, but doesn't force developers to be careful.

Of course, the ultimate thing checks what the dynamic depths are by
looking at the call graph, but since you can avoid the worst stuff by just
checking for static issues I htink that's worth it.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.065 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site