Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Dec 2001 11:46:27 -0800
From:      David Greenman <dg@root.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        Poul-Henning Kamp <phk@freebsd.org>, arch@freebsd.org
Subject:   Re: Kernel stack size and stacking: do we have a problem ?
Message-ID:  <20011220114627.C15588@nexus.root.com>
In-Reply-To: <Pine.BSF.4.21.0112201053020.46573-100000@InterJet.elischer.org>; from julian@elischer.org on Thu, Dec 20, 2001 at 11:04:59AM -0800
References:  <600.1008837822@critter.freebsd.dk> <Pine.BSF.4.21.0112201053020.46573-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>> 3. Would it be possible to make kernel stack size a sysctl ?
>
>hmmm, it might but it would be tricky because the constant KSTACK_PAGES
>is used for both allocation and deallocation so if you just changed it to
>be a variable, and changed it in between......
>This is about to change BTW in KSE as there is a kstack per thread
>and the allocation routines will be different.
>The problem is that I'm caching threads and their stacks for quick
>reallocation so I'd have to check each stack as I pass it out and check
>whether I need to resize it to match the new size..

   I'd like to point out that having stacks of different sizes is going
to cause VM fragmentation problems if VM space for the system maximum size
isn't preallocated for everything, and "growing" a stack could be very
difficult or impossible if VM space hasn't already been preallocated (since
it would have to be copied and fixed up).

-DG

David Greenman
Co-founder, The FreeBSD Project - http://www.freebsd.org
President, TeraSolutions, Inc. - http://www.terasolutions.com
Pave the road of life with opportunities.

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




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