Date: Fri, 03 May 2002 12:54:05 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: Julian Elischer <julian@elischer.org> Cc: Jonathan Mini <mini@FreeBSD.org>, Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 10740 for review Message-ID: <XFMail.20020503125405.jhb@FreeBSD.org> In-Reply-To: <Pine.BSF.4.21.0205030926550.82741-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 03-May-2002 Julian Elischer wrote: > > > On Fri, 3 May 2002, John Baldwin wrote: > >> >> We already have a slab allocator for that, no need to reinvent it. > > You do NOT have a slab allocator that allocates fulli linked up thread > structures with preallocated vm ojects for the stack etc. Uh, only cause you haven't bothered to write proper constructor's destructor's for the uma zone then. We _do_ have a proper slab allocator and by trying to manage it yourself you are simply preventing uma from being fully able to manage the memory in the system. > getting a thread structure, adding the stack and then ripping it off again > when deallocatingnit is too heavy weight for what I want. You COULD > just leave teh stack attached, and trust the slab allocator (as we do to > not try free it back to the system, taking its stack with it, but i'd > rather spend the extra 100 bytes making sure that I KNOW what I have on > hand.. what we do now is (to quote peter) a "HACK". You don't need to deallocate the stack unless you are doing an actual destruct of the thread. This isn't hard. >> This in fork1(). I think a better way of avoiding this is to have each >> KSE have a spare thread it can use when a thread blocks. The first >> action a spare thread when it starts up is to allocate a new spare thread >> if needed. However, I think you should only have one spare thread per-KSE >> and not a list. > > I have a list of them but it can be small. Your list needs to make sure it always has one so that we don't have to do malloc's during msleep, etc. Also, I think holding more than one per KSE prevents uma from managing system memory as fully as it can. We have subsystems, please use them instead of trying to home-roll your own. -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020503125405.jhb>