From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 1 09:23:58 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 DBD04106566B; Mon, 1 Feb 2010 09:23:58 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8D08FC1A; Mon, 1 Feb 2010 09:23:56 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 4DF5C45E97; Mon, 1 Feb 2010 10:23:51 +0100 (CET) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 3A69B45CD9; Mon, 1 Feb 2010 10:23:37 +0100 (CET) Date: Mon, 1 Feb 2010 10:23:34 +0100 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20100201092334.GB1743@garage.freebsd.pl> References: <4B636812.8060403@FreeBSD.org> <20100130112749.GA1660@garage.freebsd.pl> <20100130114451.GB1660@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1UWUbFP1cBYEclgG" Content-Disposition: inline In-Reply-To: <20100130114451.GB1660@garage.freebsd.pl> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-hackers@freebsd.org, FreeBSD-Current , kib@FreeBSD.org, 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:23:59 -0000 --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: >=20 > GEOM calls destroy_dev() while holding the topology lock. >=20 > Destroy_dev() wants to destroy device, but can't because there are > threads that still have it open. >=20 > The threads can't close it, because to close it they need the topology > lock. >=20 > 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? --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --1UWUbFP1cBYEclgG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFLZp2WForvXbEpPzQRAn35AJ90hK1k5qJWXM68Y6u2ZFu7WP3E+gCgmqPv 6sEImmRWQ3kLgUElGxoKA04= =o3JH -----END PGP SIGNATURE----- --1UWUbFP1cBYEclgG--