Date: Sun, 13 Oct 2019 15:39:11 +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: r353468 - head/sys/kern Message-ID: <201910131539.x9DFdBKD052830@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sun Oct 13 15:39:11 2019 New Revision: 353468 URL: https://svnweb.freebsd.org/changeset/base/353468 Log: vfs: return free vnode batches in sync instead of vfs_msync It is a more natural fit. vfs_msync only deals with active vnodes. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22008 Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Oct 13 15:15:09 2019 (r353467) +++ head/sys/kern/vfs_subr.c Sun Oct 13 15:39:11 2019 (r353468) @@ -4395,8 +4395,6 @@ vfs_msync(struct mount *mp, int flags) CTR2(KTR_VFS, "%s: mp %p", __func__, mp); - vnlru_return_batch(mp); - MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { obj = vp->v_object; if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0 && @@ -4628,6 +4626,11 @@ sync_fsync(struct vop_fsync_args *ap) return (0); } save = curthread_pflags_set(TDP_SYNCIO); + /* + * The filesystem at hand may be idle with free vnodes stored in the + * batch. Return them instead of letting them stay there indefinitely. + */ + vnlru_return_batch(mp); vfs_msync(mp, MNT_NOWAIT); error = VFS_SYNC(mp, MNT_LAZY); curthread_pflags_restore(save);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910131539.x9DFdBKD052830>