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.
This commit is contained in:
parent
0b6a0b955a
commit
b99e61353f
@ -167,8 +167,8 @@ _unlock_things(struct faultstate *fs, int dealloc)
|
|||||||
}
|
}
|
||||||
unlock_map(fs);
|
unlock_map(fs);
|
||||||
if (fs->vp != NULL) {
|
if (fs->vp != NULL) {
|
||||||
|
mtx_lock(&Giant);
|
||||||
vput(fs->vp);
|
vput(fs->vp);
|
||||||
if (debug_mpsafevm)
|
|
||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
fs->vp = NULL;
|
fs->vp = NULL;
|
||||||
}
|
}
|
||||||
@ -295,7 +295,6 @@ RetryFault:;
|
|||||||
VM_OBJECT_LOCK(fs.first_object);
|
VM_OBJECT_LOCK(fs.first_object);
|
||||||
vm_object_reference_locked(fs.first_object);
|
vm_object_reference_locked(fs.first_object);
|
||||||
fs.vp = vnode_pager_lock(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);
|
vm_object_pip_add(fs.first_object, 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user