Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jan 2020 01:34:05 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356745 - head/sys/kern
Message-ID:  <202001150134.00F1Y5t5049380@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Wed Jan 15 01:34:05 2020
New Revision: 356745
URL: https://svnweb.freebsd.org/changeset/base/356745

Log:
  vfs: in vop_stdadd_writecount only vlazy vnodes on mounts using msync
  
  The only reason to vlazy there is to (overzealously) ensure all vnodes
  which need to be visited by msync scan can be found there.
  
  In particluar this is of no use zfs and tmpfs.
  
  While here depessimize the check.

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Wed Jan 15 01:32:11 2020	(r356744)
+++ head/sys/kern/vfs_default.c	Wed Jan 15 01:34:05 2020	(r356745)
@@ -1220,6 +1220,7 @@ static int
 vop_stdadd_writecount(struct vop_add_writecount_args *ap)
 {
 	struct vnode *vp;
+	struct mount *mp;
 	int error;
 
 	vp = ap->a_vp;
@@ -1229,9 +1230,12 @@ vop_stdadd_writecount(struct vop_add_writecount_args *
 	} else {
 		VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp,
 		    ("neg writecount increment %d", ap->a_inc));
+		if (vp->v_writecount == 0) {
+			mp = vp->v_mount;
+			if (mp != NULL && (mp->mnt_kern_flag & MNTK_NOMSYNC) == 0)
+				vlazy(vp);
+		}
 		vp->v_writecount += ap->a_inc;
-		if (vp->v_writecount > 0 && vp->v_mount != NULL)
-			vlazy(vp);
 		error = 0;
 	}
 	VI_UNLOCK(vp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001150134.00F1Y5t5049380>