diff options
author | alc <alc@FreeBSD.org> | 2003-11-01 23:06:41 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-11-01 23:06:41 +0000 |
commit | 75da97558ffa5f34d3e2940a0e4df5d095a1faf7 (patch) | |
tree | ad3d6ca1cc8a9cd1b26625aae49c835282d5eec5 /sys/vm/vm_object.c | |
parent | b2312aeebb31a8c9c5b0c0169748d0f32aabb9d6 (diff) | |
download | FreeBSD-src-75da97558ffa5f34d3e2940a0e4df5d095a1faf7.zip FreeBSD-src-75da97558ffa5f34d3e2940a0e4df5d095a1faf7.tar.gz |
- Increase the scope of two vm object locks in vm_object_collapse().
- Remove the acquisition and release of Giant from vm_object_coalesce().
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 3ce3819..2a03568 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1596,6 +1596,7 @@ vm_object_collapse(vm_object_t object) ); mtx_unlock(&vm_object_list_mtx); +/* XXX */ VM_OBJECT_LOCK(object); uma_zfree(obj_zone, backing_object); object_collapses++; @@ -1619,8 +1620,6 @@ vm_object_collapse(vm_object_t object) LIST_REMOVE(object, shadow_list); backing_object->shadow_count--; backing_object->generation++; - VM_OBJECT_UNLOCK(backing_object); -/* XXX */ VM_OBJECT_UNLOCK(object); new_backing_object = backing_object->backing_object; if ((object->backing_object = new_backing_object) != NULL) { @@ -1640,18 +1639,16 @@ vm_object_collapse(vm_object_t object) /* * Drop the reference count on backing_object. Since - * its ref_count was at least 2, it will not vanish; - * so we don't need to call vm_object_deallocate, but - * we do anyway. + * its ref_count was at least 2, it will not vanish. */ - vm_object_deallocate(backing_object); + backing_object->ref_count--; + VM_OBJECT_UNLOCK(backing_object); object_bypasses++; } /* * Try again with this object's new backing object. */ -/* XXX */ VM_OBJECT_LOCK(object); } } @@ -1754,12 +1751,10 @@ vm_object_coalesce(vm_object_t prev_object, vm_pindex_t prev_pindex, if (prev_object == NULL) return (TRUE); - mtx_lock(&Giant); VM_OBJECT_LOCK(prev_object); if (prev_object->type != OBJT_DEFAULT && prev_object->type != OBJT_SWAP) { VM_OBJECT_UNLOCK(prev_object); - mtx_unlock(&Giant); return (FALSE); } @@ -1775,7 +1770,6 @@ vm_object_coalesce(vm_object_t prev_object, vm_pindex_t prev_pindex, */ if (prev_object->backing_object != NULL) { VM_OBJECT_UNLOCK(prev_object); - mtx_unlock(&Giant); return (FALSE); } @@ -1786,7 +1780,6 @@ vm_object_coalesce(vm_object_t prev_object, vm_pindex_t prev_pindex, if ((prev_object->ref_count > 1) && (prev_object->size != next_pindex)) { VM_OBJECT_UNLOCK(prev_object); - mtx_unlock(&Giant); return (FALSE); } @@ -1810,7 +1803,6 @@ vm_object_coalesce(vm_object_t prev_object, vm_pindex_t prev_pindex, prev_object->size = next_pindex + next_size; VM_OBJECT_UNLOCK(prev_object); - mtx_unlock(&Giant); return (TRUE); } |