From owner-freebsd-hackers Fri Aug 17 9:10:17 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 A4ABF37B40A for ; Fri, 17 Aug 2001 09:10:14 -0700 (PDT) (envelope-from julian@elischer.org) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id JAA23014; Fri, 17 Aug 2001 09:12:17 -0700 (PDT) Date: Fri, 17 Aug 2001 09:12:16 -0700 (PDT) From: Julian Elischer To: "Eugene L. Vorokov" Cc: freebsd-hackers@freebsd.org Subject: Re: kernel stack size In-Reply-To: <200108171344.f7HDife37351@bugz.infotecs.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 We may go to 2 pages but really 1 page is enough as long as people don't store structures on the stack. It's been kept small to keep the overhead of processes and threads down. When we get threads (KSE) we may have theoretically thousands more of these, on potentially smaller boxes.. The main poitn is that it's FIXED and that you can have recursion and interrupts so kernel programmers should know that a stack is a minimal resource. To some extent keeping it VERY small helps force this disciplin on people. As I said before there is a possibility we may go to 2 pages but that's not at all certain. On Fri, 17 Aug 2001, Eugene L. Vorokov wrote: > > 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. > > Maybe I'm just dumb, but I still don't understand, what is the reason of > keeping kernel stack size so small ? I understand there should be no > need in huge stack, but why so damn small ? Would someone explain please ? > > Regards, > Eugene > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message