From owner-cvs-src@FreeBSD.ORG Mon Feb 7 03:19:06 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C10C16A4CE; Mon, 7 Feb 2005 03:19:06 +0000 (GMT) Received: from ylpvm01.prodigy.net (ylpvm01-ext.prodigy.net [207.115.57.32]) by mx1.FreeBSD.org (Postfix) with ESMTP id E128943D54; Mon, 7 Feb 2005 03:19:05 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.5.51] (adsl-64-171-186-189.dsl.snfc21.pacbell.net [64.171.186.189])j173J3vE027211; Sun, 6 Feb 2005 22:19:04 -0500 Message-ID: <4206DE26.5000104@root.org> Date: Sun, 06 Feb 2005 19:19:02 -0800 From: Nate Lawson User-Agent: Mozilla Thunderbird 1.0RC1 (X11/20041205) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ian Dowse References: <20050207024741.786A016A570@hub.freebsd.org> In-Reply-To: <20050207024741.786A016A570@hub.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/man/man9 Makefile timeout.9 src/sys/sys callout.h src/sys/kern kern_timeout.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Feb 2005 03:19:06 -0000 This is wonderful, thank you! Ian Dowse wrote: > iedowse 2005-02-07 02:47:33 UTC > > FreeBSD src repository > > Modified files: > share/man/man9 Makefile timeout.9 > sys/sys callout.h > sys/kern kern_timeout.c > Log: > Add a mechanism for associating a mutex with a callout when the > callout is first initialised, using a new function callout_init_mtx(). > The callout system will acquire this mutex before calling the callout > function and release it on return. > > In addition, the callout system uses the mutex to avoid most of the > complications and race conditions inherent in asynchronous timer > facilities, so mutex-protected callouts have much simpler semantics. > As long as the mutex is held when invoking callout_stop() or > callout_reset(), then these functions will guarantee that the callout > will be stopped, even if softclock() had already begun to process > the callout. > > Existing Giant-locked callouts will automatically pick up the new > race-free semantics. This should close a number of race conditions > in the USB code and probably other areas of the kernel too. > > There should be no change in behaviour for "MP-safe" callouts; these > still need to use the techniques mentioned in timeout(9) to avoid > race conditions. > > Revision Changes Path > 1.253 +6 -1 src/share/man/man9/Makefile > 1.27 +50 -1 src/share/man/man9/timeout.9 > 1.96 +106 -15 src/sys/kern/kern_timeout.c > 1.28 +5 -0 src/sys/sys/callout.h -- Nate