From owner-freebsd-geom@FreeBSD.ORG Mon Jun 11 20:43:38 2012 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FE2C106564A for ; Mon, 11 Jun 2012 20:43:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id EF9EE8FC17 for ; Mon, 11 Jun 2012 20:43:37 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q5BKhYK1047538; Mon, 11 Jun 2012 23:43:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q5BKhYOJ050836; Mon, 11 Jun 2012 23:43:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q5BKhYEw050835; Mon, 11 Jun 2012 23:43:34 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 11 Jun 2012 23:43:34 +0300 From: Konstantin Belousov To: Steven Haber Message-ID: <20120611204334.GH2337@deviant.kiev.zoral.com.ua> References: <56CE86D6660FF84498426FA7A33170B4033672EF@seaxch01.desktop.isilon.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wj9ZLJVQDRFjGSdK" Content-Disposition: inline In-Reply-To: <56CE86D6660FF84498426FA7A33170B4033672EF@seaxch01.desktop.isilon.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-geom@freebsd.org Subject: Re: Geom / destroy_dev() deadlock X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2012 20:43:38 -0000 --wj9ZLJVQDRFjGSdK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 11, 2012 at 10:19:07AM -0700, Steven Haber wrote: > Hey FreeBSD devs, >=20 > I hope this is the right forum for this. I haven't used the FreeBSD > mailing lists before. I'm a relatively new hire at EMC Isilon. We are > using FreeBSD 7.0 as the basis for our scale-out NAS product line. We > are frequently hitting the deadlock described here: >=20 > http://lists.freebsd.org/pipermail/freebsd-geom/2010-February/003888.htm > l >=20 > The race is that destroy_dev() sleeps indefinitely waiting for thread > references to drop from a dev. In the case of geom, we hold the topology > lock the whole time we're in the dev layer. In devfs_open() and > devfs_close(), we take a ref on the dev before calling into to geom. >=20 > The proposed solution of destroy_dev_sched() makes sense to me. I am > trying to understand the necessity of Alexander Motin's additional > changes. destroy_dev_tq() holds the devmtx during the destroy and devfs > uses this lock to take refs before calling into geom. To me it seems we > should be able to protect the cdev with just the devmtx, provided > consumers of d_close(), d_open(), etc. ref and rel the dev > appropriately. devmtx is mutex. If taken, then cdevsw methods would be unable to sleep. --wj9ZLJVQDRFjGSdK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/WWHUACgkQC3+MBN1Mb4ip4QCgg1nSt1hXHR3ef0jlEtVv9iQa GgYAnj2nwSOtFkYgJogIG0ErN5gJfvBI =ikZO -----END PGP SIGNATURE----- --wj9ZLJVQDRFjGSdK--