Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2001 00:19:56 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Weiguang SHI <weiguang_shi@hotmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kernel stack size
Message-ID:  <3B7A229C.ABD8870A@elischer.org>
References:  <F61OJXsNQptgFrYILoy00006cc0@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Weiguang SHI wrote:
> 
> A closer look at the code /usr/src/sys/i386/i386/locore.s astonished
> me with the fact that the kernel stack size for a process, at least
> for process 0, is 2*4096-sizeof(struct user) = 3988 bytes, less than
> even one page.
> 
> Anyone to verify this, please?
> BTW, I am looking at the 4.3-stable code.

this is true, huge isn;t it?.
 of course it will be smaller in 5.0-KSE.
This is he reason that we will be adding (right david?) the gcc options to 
allow the compiler to complain if a frame is bigger than some size..

In 4.x you have to have enough room to handle all the nested interrupts
that might occur, but in 5.0 each interrupt has it's own stack so 
you do not have this requirement. 
I recently however found that teh USB code and the ISA probe code were both 
making Multi-KB allocations on the stack. I have fixed those that I saw
but there are possibly more.
If we can get the option in Gcc, then we will try set the number to 
100 Bytes per frame or something...

In 5-0-KSE there is a single page that contains the stack and 
the PCB (which is about 660 bytes). We are also looking at adding
code to set a hardware watchpoint between the stack and the PCB
to catch overruns.

> 
> Thanks
> Weiguang
> 
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message

-- 
+------------------------------------+       ______ _  __
|   __--_|\  Julian Elischer         |       \     U \/ / hard at work in 
|  /       \ julian@elischer.org     +------>x   USA    \ a very strange
| (   OZ    )                                \___   ___ | country !
+- X_.---._/    presently in San Francisco       \_/   \\
          v

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B7A229C.ABD8870A>