summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_fault.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2004-08-21 19:20:21 +0000
committeralc <alc@FreeBSD.org>2004-08-21 19:20:21 +0000
commitbdaf27d7e6b238b81fb5ccdbfd6632eac40c4750 (patch)
tree3457a956972395da03a7a13951b167b89ec640af /sys/vm/vm_fault.c
parentd421a19d6e45fca61d9d2eb22b91ad19b52e2d39 (diff)
downloadFreeBSD-src-bdaf27d7e6b238b81fb5ccdbfd6632eac40c4750.zip
FreeBSD-src-bdaf27d7e6b238b81fb5ccdbfd6632eac40c4750.tar.gz
Further reduce the use of Giant by vm_fault(): Giant is held only when
manipulating a vnode, e.g., calling vput(). This reduces contention for Giant during many copy-on-write faults, resulting in some additional speedup on SMPs. Note: debug_mpsafevm must be enabled for this optimization to take effect.
Diffstat (limited to 'sys/vm/vm_fault.c')
-rw-r--r--sys/vm/vm_fault.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 1fa921d..1f6fd0b 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -167,9 +167,9 @@ _unlock_things(struct faultstate *fs, int dealloc)
}
unlock_map(fs);
if (fs->vp != NULL) {
+ mtx_lock(&Giant);
vput(fs->vp);
- if (debug_mpsafevm)
- mtx_unlock(&Giant);
+ mtx_unlock(&Giant);
fs->vp = NULL;
}
if (dealloc)
@@ -295,8 +295,7 @@ RetryFault:;
VM_OBJECT_LOCK(fs.first_object);
vm_object_reference_locked(fs.first_object);
fs.vp = vnode_pager_lock(fs.first_object);
- if (fs.vp == NULL && debug_mpsafevm)
- mtx_unlock(&Giant);
+ mtx_unlock(&Giant);
vm_object_pip_add(fs.first_object, 1);
fs.lookup_still_valid = TRUE;
OpenPOWER on IntegriCloud