From owner-freebsd-current@FreeBSD.ORG Wed Oct 20 05:36:10 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3C84816A4CE; Wed, 20 Oct 2004 05:36:10 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.13.1/8.13.1) with ESMTP id i9K5a9cn020292; Wed, 20 Oct 2004 01:36:09 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id i9K5a6xH020291; Wed, 20 Oct 2004 01:36:06 -0400 (EDT) (envelope-from green) Date: Wed, 20 Oct 2004 01:36:06 -0400 From: Brian Fundakowski Feldman To: Julian Elischer Message-ID: <20041020053606.GG1072@green.homeunix.org> References: <41759681.1060700@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41759681.1060700@elischer.org> User-Agent: Mutt/1.5.6i cc: FreeBSD Current Subject: Re: wakeup/sleep handoff. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2004 05:36:10 -0000 On Tue, Oct 19, 2004 at 03:34:41PM -0700, Julian Elischer wrote: > Is there a need to be able to somehow implement a 'wakeup_one()' that > as part of its semantic is that the woken thread will run immediatly, > (as in preemprion), > and the old thread will sleep? With preemption, the old thread is left > in the run queue, > and after the other thread has completed, it will > run again and probably go away and sleep for some reason.. (or at least > go do some work that isn't > necessarily required..) > > Something like handover(wakeupchan, sleepchan, msleep_args...). > sort of an atomic wakeup/msleep. > > This would be used in places where work used to be done by the same > thread, but is now done > by a server thread.. > > An example would be kicking off a geom thread, when in the past we would > have gone all > the way down to the hardware ourself. we want to get as close to acting > like we are still > going all the way done as we can (performance wise). We may get some > efficiency by > letting the sleep system, and scheduler know what we are trying to do. > Possibly with some > priority inherritance implications.. (if we have a high priority, we > probably want to ensure that the > worker thread is run with at least that priority.) This is essentially what Dillon's been espousing other than the possibility of running the operation in-line when feasible. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\