Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/kern Pull up revision 1.162 (requested by fvdl):



details:   https://anonhg.NetBSD.org/src/rev/bb80bbc4f344
branches:  netbsd-1-5
changeset: 490319:bb80bbc4f344
user:      he <he%NetBSD.org@localhost>
date:      Thu Dec 14 23:36:05 2000 +0000

description:
Pull up revision 1.162 (requested by fvdl):
  Improve NFS performance, possibly with as much as 100% in
  throughput.  Please note: this implies a kernel interface change,
  VOP_FSYNC gains two arguments.

diffstat:

 sys/kern/vfs_syscalls.c |  18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diffs (69 lines):

diff -r 7852591974e1 -r bb80bbc4f344 sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Thu Dec 14 23:36:02 2000 +0000
+++ b/sys/kern/vfs_syscalls.c   Thu Dec 14 23:36:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.158.2.1 2000/07/27 02:46:49 mycroft Exp $   */
+/*     $NetBSD: vfs_syscalls.c,v 1.158.2.2 2000/12/14 23:36:05 he Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -479,16 +479,20 @@
        struct vnode *coveredvp;
        int error;
        int async;
+       int used_syncer;
 
        simple_lock(&mountlist_slock);
        vfs_unbusy(mp);
+       used_syncer = (mp->mnt_syncer != NULL);
+
        /*
         * XXX Freeze syncer. This should really be done on a mountpoint
         * basis, but especially the softdep code possibly called from
         * the syncer doesn't exactly work on a per-mountpoint basis,
         * so the softdep code would become a maze of vfs_busy calls.
         */
-       lockmgr(&syncer_lock, LK_EXCLUSIVE, NULL);
+       if (used_syncer)
+               lockmgr(&syncer_lock, LK_EXCLUSIVE, NULL);
 
        mp->mnt_flag |= MNT_UNMOUNT;
        mp->mnt_unmounter = p;
@@ -513,7 +517,8 @@
                mp->mnt_flag |= async;
                lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK | LK_REENABLE,
                    &mountlist_slock);
-               lockmgr(&syncer_lock, LK_RELEASE, NULL);
+               if (used_syncer)
+                       lockmgr(&syncer_lock, LK_RELEASE, NULL);
                while (mp->mnt_wcnt > 0) {
                        wakeup((caddr_t)mp);
                        tsleep(&mp->mnt_wcnt, PVFS, "mntwcnt1", 0);
@@ -530,7 +535,8 @@
                panic("unmount: dangling vnode");
        mp->mnt_flag |= MNT_GONE;
        lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK, &mountlist_slock);
-       lockmgr(&syncer_lock, LK_RELEASE, NULL);
+       if (used_syncer)
+               lockmgr(&syncer_lock, LK_RELEASE, NULL);
        while(mp->mnt_wcnt > 0) {
                wakeup((caddr_t)mp);
                tsleep(&mp->mnt_wcnt, PVFS, "mntwcnt2", 0);
@@ -2721,7 +2727,7 @@
                return (error);
        vp = (struct vnode *)fp->f_data;
        vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-       error = VOP_FSYNC(vp, fp->f_cred, FSYNC_WAIT, p);
+       error = VOP_FSYNC(vp, fp->f_cred, FSYNC_WAIT, 0, 0, p);
        if (error == 0 && bioops.io_fsync != NULL &&
            vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP))
                (*bioops.io_fsync)(vp);
@@ -2752,7 +2758,7 @@
                return (error);
        vp = (struct vnode *)fp->f_data;
        vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
-       error = VOP_FSYNC(vp, fp->f_cred, FSYNC_WAIT|FSYNC_DATAONLY, p);
+       error = VOP_FSYNC(vp, fp->f_cred, FSYNC_WAIT|FSYNC_DATAONLY, 0, 0, p);
        VOP_UNLOCK(vp, 0);
        FILE_UNUSE(fp, p);
        return (error);



Home | Main Index | Thread Index | Old Index