From owner-freebsd-fs@FreeBSD.ORG Fri Apr 28 14:48:49 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C4CF16A403; Fri, 28 Apr 2006 14:48:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (ll-227.216.82.212.sovam.net.ua [212.82.216.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14F9543D46; Fri, 28 Apr 2006 14:48:47 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id k3SEmfRP027149 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Apr 2006 17:48:41 +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.13.6/8.13.6) with ESMTP id k3SEmfYM005021; Fri, 28 Apr 2006 17:48:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.6/8.13.6/Submit) id k3SEme4A005020; Fri, 28 Apr 2006 17:48:40 +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: Fri, 28 Apr 2006 17:48:40 +0300 From: Kostik Belousov To: Pawel Jakub Dawidek Message-ID: <20060428144840.GA4436@deviant.kiev.zoral.com.ua> References: <20060428120855.GB1270@deviant.kiev.zoral.com.ua> <20060428140205.GD864@garage.freebsd.pl> <20060428141617.GD1270@deviant.kiev.zoral.com.ua> <20060428142349.GE864@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: <20060428142349.GE864@garage.freebsd.pl> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV version 0.88.1, clamav-milter version 0.88.1 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on fw.zoral.com.ua Cc: freebsd-fs@freebsd.org Subject: Re: vn_start_write(9) recursion ? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Apr 2006 14:48:49 -0000 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 28, 2006 at 04:23:49PM +0200, Pawel Jakub Dawidek wrote: > On Fri, Apr 28, 2006 at 05:16:17PM +0300, Kostik Belousov wrote: > +> On Fri, Apr 28, 2006 at 04:02:05PM +0200, Pawel Jakub Dawidek wrote: > +> > On Fri, Apr 28, 2006 at 03:08:55PM +0300, Kostik Belousov wrote: > +> > +> vn_start_write(9) shall not be called recursively (at least, not = without > +> > +> V_NOWAIT flag). Otherwise, system may deadlock if vn_write_suspen= d(9) > +> > +> is called between. > +> >=20 > +> > Yes, you are right. Nice catch, actually. > +> >=20 > +> > I hacked this patch to detect it: > +> >=20 > +> > http://people.freebsd.org/~pjd/patches/vn_start_write_recursion.pat= ch > +> >=20 > +> > And it panics on boot. > +>=20 > +> Incredible ! Please, commit it ! >=20 > Not sure if this is good idea to abuse td_pflags for debugging > purpose... But we have plenty of room in there, so maybe its worth it. > I'll ask few other guys what they think about it. >=20 > +> This would save me at least a day starring at struct mount with > +> mnt_writeopcount and (still) no writers. > +>=20 > +> For instance, such situation occurs in quotactl/quotaoff case. >=20 > This could be the hang I'm chasing, btw:) This deadlock manifests itself as bunch of processes in "suspfs" state and (usually) mksnap_ffs in "suspwt" state, without any other blocks. One of the "suspfs"-blocked processes called vn_start_write recursively. It seems that for the main tree there is no other way to produce the deadlock situation except running mksnap. --azLHFNyN32YCQGCU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFEUitHC3+MBN1Mb4gRAq13AJ0fSvOCvucqemobYmyAsJNzKc2MPwCg2Ca5 UxBuqTSuOK0FF/GGk4WNqLs= =XkZF -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU--