> On Sat, 23 Oct 1999 17:36:12 +0200,
> Manfred Spraul <manfreds@colorfullife.com> wrote:
> >How much stack space can I use without causing a stack overflow? None of
> >these functions are recursive, and they don't call any subfunctions
> >which need more than a few bytes stack space.
>
> Anybody looking at stack usage might find this script useful, it can
> also be found in ftp://ftp.ocs.com.au/pub/kernel.stack.gz. It taks a
> while to run, mainly because objdump --disassemble of everything takes
> a while. Some interesting results from 2.2.23 :-
>
> 7c4 ncr53c8xx_detect
You should view any such numbers as approximations, since it only counts the
stack size as allocated in the function entry. On the x86, as functions are
called, arguments are pushed on the stack (and the return address) and then
popped off some time later, so that actual stack size varies by a few words
depending on where you are at any point in time.
Also note, real old compilers would sometimes delay popping off the stack, and
you could have a tight loop that does a call, and accumulates extra words on
the stack until the loop exists. I believe this was fixed some time ago, but I
haven't kept as much track of the x86 code generation these days.
-- Michael Meissner, Cygnus Solutions PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886 email: meissner@cygnus.com phone: 978-486-9304 fax: 978-692-4482- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/