Date: Sun, 13 Oct 2019 15:40:34 +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: r353469 - in head/sys: kern sys Message-ID: <201910131540.x9DFeYmf052968@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sun Oct 13 15:40:34 2019 New Revision: 353469 URL: https://svnweb.freebsd.org/changeset/base/353469 Log: vfs: add MNTK_NOMSYNC On many filesystems the traversal is effectively a no-op. Add a way to avoid the overhead. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22009 Modified: head/sys/kern/vfs_subr.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Oct 13 15:39:11 2019 (r353468) +++ head/sys/kern/vfs_subr.c Sun Oct 13 15:40:34 2019 (r353469) @@ -4395,6 +4395,9 @@ vfs_msync(struct mount *mp, int flags) CTR2(KTR_VFS, "%s: mp %p", __func__, mp); + if ((mp->mnt_kern_flag & MNTK_NOMSYNC) != 0) + return; + MNT_VNODE_FOREACH_ACTIVE(vp, mp, mvp) { obj = vp->v_object; if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0 && Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Oct 13 15:39:11 2019 (r353468) +++ head/sys/sys/mount.h Sun Oct 13 15:40:34 2019 (r353469) @@ -396,6 +396,7 @@ void __mnt_vnode_markerfree_active(struct vno #define MNTK_UNMOUNTF 0x00000001 /* forced unmount in progress */ #define MNTK_ASYNC 0x00000002 /* filtered async flag */ #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ +#define MNTK_NOMSYNC 0x00000008 /* don't do vfs_msync */ #define MNTK_DRAINING 0x00000010 /* lock draining is happening */ #define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_EXTENDED_SHARED 0x00000040 /* Allow shared locking for more ops */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910131540.x9DFeYmf052968>