From owner-freebsd-threads@FreeBSD.ORG Tue Apr 27 10:37:15 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC99A16A4CF for ; Tue, 27 Apr 2004 10:37:15 -0700 (PDT) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id A8CAE43D77 for ; Tue, 27 Apr 2004 10:37:15 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 18492 invoked from network); 27 Apr 2004 17:37:14 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 27 Apr 2004 17:37:14 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i3RHb8R3008406; Tue, 27 Apr 2004 13:37:11 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Daniel Eischen Date: Tue, 27 Apr 2004 13:34:39 -0400 User-Agent: KMail/1.6 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404271334.39709.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: threads@FreeBSD.org cc: David Xu Subject: Re: kse_release and kse_wakeup problem (fwd) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2004 17:37:16 -0000 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 <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org