From owner-freebsd-current@FreeBSD.ORG Sun Feb 24 11:11:05 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E44216A40A; Sun, 24 Feb 2008 11:11:05 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9F413C46E; Sun, 24 Feb 2008 11:11:05 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id CCE2746B3D; Sun, 24 Feb 2008 06:11:04 -0500 (EST) Date: Sun, 24 Feb 2008 11:11:04 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Kris Kennaway In-Reply-To: <47C14B0F.8050403@FreeBSD.org> Message-ID: <20080224110902.K25292@fledge.watson.org> References: <274346.34322.qm@web63914.mail.re1.yahoo.com> <47C14B0F.8050403@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Barney Cordoba , current@freebsd.org Subject: Re: splimp() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 24 Feb 2008 11:11:05 -0000 On Sun, 24 Feb 2008, Kris Kennaway wrote: > Barney Cordoba wrote: >> I'm porting some older software to 7.0 and I see that many of the 7.0 >> drivers use both locks and splimps() to protect code, particularly the >> firewire driver. What cases would an splimp() be required? > > spl*() are NOPs that are only left behind in some code as a reminder of what > mutual exclusion protections used to apply, mostly in cases where there has > not been fine-grained locking applied to the code in question. In some > (most?) cases they serve no useful annotation purpose and should just be > removed. For newly written code they should be added. I'm pretty sure you meant "should not be added" :-). There are places in the tree where spl*() references persist due to inadequate synchronization, in which case they should be left in order to continue to provide an annoying reminder of that requirement. Ideally, files that retrained spl's would increasingly be annotated with comments indicating why they remain. The other argument for retaining spl's was to make maintaining a single driver/whatever source across FreeBSD 4.x and forwards; this is presumably also decreasingly a requirement over time. Robert N M Watson Computer Laboratory University of Cambridge