From owner-cvs-all@FreeBSD.ORG Thu Dec 29 21:00:16 2005 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C200A16A41F; Thu, 29 Dec 2005 21:00:16 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id B00C643D5D; Thu, 29 Dec 2005 21:00:15 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 4823843 for multiple; Thu, 29 Dec 2005 15:58:14 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id jBTL0C5S043274; Thu, 29 Dec 2005 16:00:12 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: src-committers@freebsd.org Date: Thu, 29 Dec 2005 16:00:41 -0500 User-Agent: KMail/1.8.2 References: <200512292057.jBTKvj7w082984@repoman.freebsd.org> In-Reply-To: <200512292057.jBTKvj7w082984@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512291600.42686.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1219/Wed Dec 28 17:57:59 2005 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: cvs-src@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_synch.c src/sys/sys systm.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2005 21:00:17 -0000 On Thursday 29 December 2005 03:57 pm, John Baldwin wrote: > jhb 2005-12-29 20:57:45 UTC > > FreeBSD src repository > > Modified files: > sys/kern kern_synch.c > sys/sys systm.h > Log: > Add a new function msleep_spin() which is a slightly stripped down > version of msleep(). msleep_spin() doesn't support changing the priority > of the thread while it is asleep nor does it support interruptible sleeps > (PCATCH) or the PDROP flag. It does support timeouts however. It differs > from msleep() in that the passed in mutex is a spin mutex. This means one > can use msleep_spin() and wakeup() with a spin mutex similar to msleep() > and wakeup() with a regular mutex. Note that the spin mutex in question > needs to come before sched_lock and the sleepq locks in lock order. This is mostly useful for interfacing with code that must work with primary interrupt context. For example, drivers that want to use an INTR_FAST handler that defers work to a taskqueue will need to use a taskqueue that uses spin locks and this is needed for taskqueue_drain() in that case. I will probably also make use of this to cleanup callout_drain() so that it only uses the one spin mutex and loses the extra sleep mutex and the other trickery associated with it. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org