Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 2019 06:17:57 -0700
From:      Cy Schubert <Cy.Schubert@cschubert.com>
To:        Mateusz Guzik <mjg@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r351472 - head/sys/fs/nullfs
Message-ID:  <6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8@cschubert.com>
In-Reply-To: <201908250513.x7P5DFFx017824@repo.freebsd.org>
References:  <201908250513.x7P5DFFx017824@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On August 24, 2019 10:13:15 PM PDT, Mateusz Guzik <mjg@FreeBSD=2Eorg> wrote=
:
>Author: mjg
>Date: Sun Aug 25 05:13:15 2019
>New Revision: 351472
>URL: https://svnweb=2Efreebsd=2Eorg/changeset/base/351472
>
>Log:
>  nullfs: reduce areas protected by vnode interlock
> =20
>Some places only take the interlock to hold the vnode, which was a
>requiremnt
>before they started being manipulated with atomics=2E Use the newly
>introduced
>  vholdnz to bump the count=2E
> =20
>  Reviewed by:	kib
>  Tested by:	pho
>  Sponsored by:	The FreeBSD Foundation
>  Differential Revision:	https://reviews=2Efreebsd=2Eorg/D21358
>
>Modified:
>  head/sys/fs/nullfs/null_vnops=2Ec
>
>Modified: head/sys/fs/nullfs/null_vnops=2Ec
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>--- head/sys/fs/nullfs/null_vnops=2Ec	Sun Aug 25 05:11:43 2019	(r351471)
>+++ head/sys/fs/nullfs/null_vnops=2Ec	Sun Aug 25 05:13:15 2019	(r351472)
>@@ -668,7 +668,7 @@ null_lock(struct vop_lock1_args *ap)
> 		 * We prevent it from being recycled by holding the vnode
> 		 * here=2E
> 		 */
>-		vholdl(lvp);
>+		vholdnz(lvp);
> 		error =3D VOP_LOCK(lvp, flags);
>=20
> 		/*
>@@ -710,31 +710,16 @@ static int
> null_unlock(struct vop_unlock_args *ap)
> {
> 	struct vnode *vp =3D ap->a_vp;
>-	int flags =3D ap->a_flags;
>-	int mtxlkflag =3D 0;
> 	struct null_node *nn;
> 	struct vnode *lvp;
> 	int error;
>=20
>-	if ((flags & LK_INTERLOCK) !=3D 0)
>-		mtxlkflag =3D 1;
>-	else if (mtx_owned(VI_MTX(vp)) =3D=3D 0) {
>-		VI_LOCK(vp);
>-		mtxlkflag =3D 2;
>-	}
> 	nn =3D VTONULL(vp);
> 	if (nn !=3D NULL && (lvp =3D NULLVPTOLOWERVP(vp)) !=3D NULL) {
>-		VI_LOCK_FLAGS(lvp, MTX_DUPOK);
>-		flags |=3D LK_INTERLOCK;
>-		vholdl(lvp);
>-		VI_UNLOCK(vp);
>-		error =3D VOP_UNLOCK(lvp, flags);
>+		vholdnz(lvp);
>+		error =3D VOP_UNLOCK(lvp, 0);
> 		vdrop(lvp);
>-		if (mtxlkflag =3D=3D 0)
>-			VI_LOCK(vp);
> 	} else {
>-		if (mtxlkflag =3D=3D 2)
>-			VI_UNLOCK(vp);
> 		error =3D vop_stdunlock(ap);
> 	}
>=20
>@@ -845,10 +830,8 @@ null_getwritemount(struct vop_getwritemount_args
>*ap)
> 	VI_LOCK(vp);
> 	xp =3D VTONULL(vp);
> 	if (xp && (lowervp =3D xp->null_lowervp)) {
>-		VI_LOCK_FLAGS(lowervp, MTX_DUPOK);
>+		vholdnz(lowervp);
> 		VI_UNLOCK(vp);
>-		vholdl(lowervp);
>-		VI_UNLOCK(lowervp);
> 		VOP_GETWRITEMOUNT(lowervp, ap->a_mpp);
> 		vdrop(lowervp);
> 	} else {

Hi mjg@,

This causes trap 12 a few seconds after mountlate during boot=2E Reverting=
 this commit allowed it to boot=2E

Sorry for no backtrace=2E I managed to=20
 revert and test just prior to rushing out to catch the bus, with no time =
to craft a proper email=2E I'll post the backtrace when I arrive at work=2E


--=20
Pardon the typos and autocorrect, small keyboard in use=2E
Cheers,
Cy Schubert <Cy=2ESchubert@cschubert=2Ecom>
FreeBSD UNIX: <cy@FreeBSD=2Eorg> Web: http://www=2EFreeBSD=2Eorg

	The need of the many outweighs the greed of the few=2E



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6C6BF3A4-DC07-4D9A-9A5F-FA075BF535A8>