From owner-freebsd-current@FreeBSD.ORG Sat Jan 10 01:23:06 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EE441065672 for ; Sat, 10 Jan 2009 01:23:06 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id 10D6B8FC12 for ; Sat, 10 Jan 2009 01:23:05 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id n0A1Nks8046803; Fri, 9 Jan 2009 20:23:46 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Garrett Cooper In-Reply-To: <7d6fde3d0901091707u7e2ee080l75d8567a4093144d@mail.gmail.com> References: <20090109004853.GA34384@ichotolot.servalan.com> <1231541342.56664.19.camel@shumai.marcuscom.com> <7d6fde3d0901091707u7e2ee080l75d8567a4093144d@mail.gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-gzd4EhIH96+Zfc6NzyEY" Organization: FreeBSD, Inc. Date: Fri, 09 Jan 2009 20:23:10 -0500 Message-Id: <1231550590.56664.21.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: freebsd-current@FreeBSD.org, Richard Todd Subject: Re: Recent changes to pseudofs causing panics -- leaking a vnode lock? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 10 Jan 2009 01:23:06 -0000 --=-gzd4EhIH96+Zfc6NzyEY Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2009-01-09 at 17:07 -0800, Garrett Cooper wrote: > On Fri, Jan 9, 2009 at 2:49 PM, Joe Marcus Clarke wr= ote: > > On Thu, 2009-01-08 at 18:48 -0600, Richard Todd wrote: > >> I've noticed that ever since updating to a kernel after the recent cha= nges > >> to the pseudofs code late last month, that I've occasionally gotten th= e > >> following sort of panic: > >> > >> System call readlink returning with the following locks held: > >> exclusive lockmgr pseudofs (pseudofs) r =3D 0 (0xffffff00ba581cc8) loc= ked @ /usr/src/sys/fs/pseudofs/pseudofs_vncache.c:193 > >> panic: witness_warn > >> > >> The line in question is the one I marked by an arrow in this chunk of = the > >> pfs_vncache_alloc code: > >> if ((pn->pn_flags & PFS_PROCDEP) !=3D 0) > >> (*vpp)->v_vflag |=3D VV_PROCDEP; > >> pvd->pvd_vnode =3D *vpp; > >> VN_LOCK_AREC(*vpp); > >> vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); <=3D=3D=3D=3D this loc= k here > >> error =3D insmntque(*vpp, mp); > >> > >> So somehow, a vnode is getting locked here and not getting unlocked. > >> I suspect the code in the retry2: loop later, simply because that's > >> the code that got added in the late December commits, but I'm not > >> clear on how exactly. I've tried littering the code with extra > >> printfs to try to clarify what's going on, but alas, I'm still not > >> really sure what's going on. I do have a good coredump that I can get > >> info out of, if someone can suggest to me what would be useful things > >> to dump. Anyway, here's the patch for the debugging printfs I added, > >> and the console messages produced by those printfs from the most > >> recent coredump/panic. The console msgs do seem to indicate some sort > >> of race condition going on, though, as they seem to show two or more p= rocesses > >> simultaneously hitting the pseudofs code and hitting my debugging prin= t > >> statements (alas, making the console log rather a confused mess.) > > > > I believe I have fixed this in HEAD. Kib gave his review and approval, > > and the fix really should prevent this hang. Please report back if you > > still see the problem. > > > > Joe >=20 > Joe, > When did you do this commit / what's the SVN revision #? $FreeBSD: head/sys/fs/pseudofs/pseudofs_vncache.c 186981 2009-01-09 22:06:48Z marcus $ Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-gzd4EhIH96+Zfc6NzyEY Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkln+H0ACgkQb2iPiv4Uz4c3WgCgjKUq+jrxwm2JwAJLyRKqft02 K4wAoJh0N3Z4GFSYzTP0hQ8VpMyADYvy =S1zJ -----END PGP SIGNATURE----- --=-gzd4EhIH96+Zfc6NzyEY--