Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/tmpfs FIx performance regression from rmind@:



details:   https://anonhg.NetBSD.org/src/rev/5d16f4b64aec
branches:  trunk
changeset: 991950:5d16f4b64aec
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 09 08:43:56 2018 +0000

description:
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.

diffstat:

 sys/fs/tmpfs/tmpfs_vfsops.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (46 lines):

diff -r 734f34acf20b -r 5d16f4b64aec sys/fs/tmpfs/tmpfs_vfsops.c
--- a/sys/fs/tmpfs/tmpfs_vfsops.c       Thu Aug 09 08:32:41 2018 +0000
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c       Thu Aug 09 08:43:56 2018 +0000
@@ -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 @@
                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 @@
        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) {



Home | Main Index | Thread Index | Old Index