From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 09:37:26 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EF67106568B; Mon, 1 Feb 2010 09:37:26 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.swipnet.se [212.247.155.193]) by mx1.freebsd.org (Postfix) with ESMTP id 3E0CA8FC14; Mon, 1 Feb 2010 09:37:24 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=997wlf2A6M0A:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=u5rT9GMeTmaUgEkNOPQA:9 a=24a_TDEfwaxw72SPfbkA:7 a=f3IbZGw5FHbRJNiLlJho4bEFI7kA:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe15.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 628255019; Mon, 01 Feb 2010 10:37:23 +0100 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Mon, 1 Feb 2010 10:35:57 +0100 User-Agent: KMail/1.12.4 (FreeBSD/8.0-STABLE; KDE/4.3.4; amd64; ; ) References: <4B636812.8060403@FreeBSD.org> <20100130114451.GB1660@garage.freebsd.pl> <20100201092334.GB1743@garage.freebsd.pl> In-Reply-To: <20100201092334.GB1743@garage.freebsd.pl> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201002011035.57862.hselasky@c2i.net> Cc: kib@freebsd.org, Alexander Motin , FreeBSD-Current , Pawel Jakub Dawidek , freebsd-geom@freebsd.org Subject: Re: Deadlock between GEOM and devfs device destroy and process exit. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 09:37:26 -0000 On Monday 01 February 2010 10:23:34 Pawel Jakub Dawidek wrote: > On Sat, Jan 30, 2010 at 12:44:51PM +0100, Pawel Jakub Dawidek wrote: > > Maybe I'll add how I understand what's going on: > > > > GEOM calls destroy_dev() while holding the topology lock. > > > > Destroy_dev() wants to destroy device, but can't because there are > > threads that still have it open. > > > > The threads can't close it, because to close it they need the topology > > lock. > > > > The deadlock is quite obvious, IMHO. > > Guys, changing destroy_dev() to destroy_dev_sched() in geom_dev.c fixes > the problem for me (at least it makes race window so small that I can't > reproduce it). Is there anyone who isn't happy with such a change? > Are you sure there are no races or leftover resources that can be accessed by the callbacks of the device being destroyed? --HPS