Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 May 2002 11:35:27 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>, Jonathan Mini <mini@FreeBSD.org>
Subject:   Re: PERFORCE change 10740 for review
Message-ID:  <XFMail.20020503113527.jhb@FreeBSD.org>
In-Reply-To: <Pine.BSF.4.21.0205030807030.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, Jonathan Mini wrote:
> 
>> http://people.freebsd.org/~peter/p4db/chv.cgi?CH=10740
>> 
>> Change 10740 by mini@mini_stylus on 2002/05/03 07:51:09
>> 
>>      - Change thread_get(void) -> thread_alloc(void) to keep from
>>        conflicting with thread_get(struct proc *) in sys/kerne/kern_proc.c.
> 
> but, but but... the thread_get() in kern_proc.c is a standin for the 
> one in kern_thread.c whe there is no kern_thread.c
> 
> they are supposed to be the same function.. teh one in kern_proc.c
> is removed when kse is added.....
> 
> I called it thread_get rather than thread_alloc because
> it caches them and doesn always need to allocate a new one....

We already have a slab allocator for that, no need to reinvent it.

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

-- 

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.20020503113527.jhb>