Module Name:    src
Committed By:   christos
Date:           Thu Aug  9 08:43:56 UTC 2018

Modified Files:
        src/sys/fs/tmpfs: tmpfs_vfsops.c

Log Message:
FIx performance regression from rmind@:

Just from a very quick look, it seems like a regression introduced with
the vcache changes: the MP-safe flag is set too late and not inherited
by the root vnode.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/fs/tmpfs/tmpfs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_vfsops.c
diff -u src/sys/fs/tmpfs/tmpfs_vfsops.c:1.72 src/sys/fs/tmpfs/tmpfs_vfsops.c:1.73
--- src/sys/fs/tmpfs/tmpfs_vfsops.c:1.72	Wed May 31 22:45:13 2017
+++ src/sys/fs/tmpfs/tmpfs_vfsops.c	Thu Aug  9 04:43:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vfsops.c,v 1.72 2017/06/01 02:45:13 chs Exp $	*/
+/*	$NetBSD: tmpfs_vfsops.c,v 1.73 2018/08/09 08:43:56 christos Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.72 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.73 2018/08/09 08:43:56 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -182,6 +182,13 @@ tmpfs_mount(struct mount *mp, const char
 		return 0;
 	}
 
+	mp->mnt_flag |= MNT_LOCAL;
+	mp->mnt_stat.f_namemax = TMPFS_MAXNAMLEN;
+	mp->mnt_fs_bshift = PAGE_SHIFT;
+	mp->mnt_dev_bshift = DEV_BSHIFT;
+	mp->mnt_iflag |= IMNT_MPSAFE | IMNT_CAN_RWTORO;
+	vfs_getnewfsid(mp);
+
 	/* Allocate the tmpfs mount structure and fill it. */
 	tmp = kmem_zalloc(sizeof(tmpfs_mount_t), KM_SLEEP);
 	tmp->tm_nodes_max = nodes;
@@ -220,13 +227,6 @@ tmpfs_mount(struct mount *mp, const char
 	tmp->tm_root = root;
 	vrele(vp);
 
-	mp->mnt_flag |= MNT_LOCAL;
-	mp->mnt_stat.f_namemax = TMPFS_MAXNAMLEN;
-	mp->mnt_fs_bshift = PAGE_SHIFT;
-	mp->mnt_dev_bshift = DEV_BSHIFT;
-	mp->mnt_iflag |= IMNT_MPSAFE | IMNT_CAN_RWTORO;
-	vfs_getnewfsid(mp);
-
 	error = set_statvfs_info(path, UIO_USERSPACE, "tmpfs", UIO_SYSSPACE,
 	    mp->mnt_op->vfs_name, mp, curlwp);
 	if (error) {

Reply via email to