Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Apr 2004 13:34:39 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        David Xu <davidxu@FreeBSD.org>
Subject:   Re: kse_release and kse_wakeup problem (fwd)
Message-ID:  <200404271334.39709.jhb@FreeBSD.org>
In-Reply-To: <Pine.GSO.4.10.10404271041260.22187-100000@pcnet5.pcnet.com>
References:  <Pine.GSO.4.10.10404271041260.22187-100000@pcnet5.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 27 April 2004 10:47 am, Daniel Eischen wrote:
> On Tue, 27 Apr 2004, John Baldwin wrote:
> > On Monday 26 April 2004 01:38 pm, Daniel Eischen wrote:
> > > On Mon, 26 Apr 2004, Daniel Eischen wrote:
> > > > I'm experimenting with adding an wakeup_thread() to kern_thread.c
> > > > (to complement wakeup() and wakeup_one()).  If we shouldn't be
> > > > using sleepq's directly, the thread code either needs to
> > > >
> > > >   a) queue msleep()'ing upcalls/threads itself having them
> > > >      all block on on their own unique wchan's; or
> > > >
> > > >   b) use a wakeup_thread() that wakes up a specific thread.
> > >
> > > Sorry, patch for b) is at:
> > >
> > > 	http://people.freebsd.org/~deischen/sys.diffs
> >
> > Erm, does sleepq_signal_thread() do anything different than
> > sleepq_remove() (removes a thread from a specified wait channel if and
> > only if the thread is sleeping on that wait channel)?
>
> I guess not.  I thought we would have to search the list of threads
> to ensure it was queued.  I've updated the patch slightly -- added
> thread_upcall_check() and changed where the new thread flags are
> stored:
>
> 	http://people.freebsd.org/~deischen/sys.diffs
>
> If I remove sleepq_signal_thread() and use sleepq_remove() instead,
> does the patch look OK to you?

Sure (looks like you already did).  FWIW, I would just call sleepq_remove() 
directly rather than adding a wakeup_thread() function.  sleepq_remove() is 
already used for a similar purpose in at least one other place (where we 
speed up the syncer).  Thanks for working on this.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



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