From owner-freebsd-current@FreeBSD.ORG Sat Apr 12 20:09:33 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77A3237B401; Sat, 12 Apr 2003 20:09:33 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0ED543F3F; Sat, 12 Apr 2003 20:09:31 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h3D39UA7042188; Sat, 12 Apr 2003 21:09:31 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 12 Apr 2003 21:08:53 -0600 (MDT) Message-Id: <20030412.210853.23179827.imp@bsdimp.com> To: hsu@freebsd.org From: "M. Warner Losh" In-Reply-To: <0HD7006Z9O9T0N@mta5.snfc21.pbi.net> References: <20030411175926.U1137@beagle.fokus.fraunhofer.de> <0HD7006Z9O9T0N@mta5.snfc21.pbi.net> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-current@freebsd.org cc: harti@freebsd.org Subject: Re: LOR in if_detach 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: Sun, 13 Apr 2003 03:09:33 -0000 In message: <0HD7006Z9O9T0N@mta5.snfc21.pbi.net> Jeffrey Hsu writes: : > Do you think of something like the following? : : > static int : > foo_detach(device_t dev) : > { : > ... : > : > LOCK(softc); : : The other big race here is between detach and the next attach. : This is better solved with a lock at the interface layer rather : than on the softc. I'm working on locking at the newbus level, which should solve that problem. Since all changes to the dev tree are going to be under a global lock, this race is eliminated. My big problem is LOR when I enable this code in my tree :-( Warner