From owner-freebsd-hackers Wed Aug 15 0:32:38 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id 34C6A37B407 for ; Wed, 15 Aug 2001 00:32:33 -0700 (PDT) (envelope-from julian@elischer.org) Received: from elischer.org (InterJet.elischer.org [192.168.1.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id AAA10792; Wed, 15 Aug 2001 00:31:59 -0700 (PDT) Message-ID: <3B7A229C.ABD8870A@elischer.org> Date: Wed, 15 Aug 2001 00:19:56 -0700 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: Weiguang SHI Cc: freebsd-hackers@freebsd.org Subject: Re: kernel stack size References: Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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