Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 2002 09:32:09 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>, Perforce Change Reviews <perforce@freebsd.org>, Jonathan Mini <mini@FreeBSD.org>
Subject:   Re: PERFORCE change 10740 for review
Message-ID:  <Pine.BSF.4.21.0205030926550.82741-100000@InterJet.elischer.org>
In-Reply-To: <XFMail.20020503113527.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help


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.

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".


> 
> >>      - uma_zalloc(,M_WAITOK) will never return NULL, so don't bother
> >>        testing for it.
> > 
> > You may be right, but I wasn't convinced that M_WAITOK was always
> > correct. I was trying to concieve af a case where you may not ba able to
> > wait when trying ot allocate a new thread..
> > for example if you are trying to allocate it when you are already in
> >  msleep().. it may be bad to sleep when in msleep already...
> > I think I may have other ways to stop this but think about it and
> > check the anti-recursion code in msleep(). 
> > It may be that M_NOWAIT is the right answer..
> 
> 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. 


> 
> -- 
> 
> 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?Pine.BSF.4.21.0205030926550.82741-100000>