diff options
author | alc <alc@FreeBSD.org> | 2002-05-12 05:22:56 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-05-12 05:22:56 +0000 |
commit | e7bbea38d981582adb68f002d1abf784b0ea7047 (patch) | |
tree | b9a492a1fc3377262b2f1fa1e9406faa0940c5b8 /sys/vm/vm_object.c | |
parent | 34259ca95142f09cfa9e46200da392f409f7f039 (diff) | |
download | FreeBSD-src-e7bbea38d981582adb68f002d1abf784b0ea7047.zip FreeBSD-src-e7bbea38d981582adb68f002d1abf784b0ea7047.tar.gz |
o Acquire and release Giant in vm_object_reference() and
vm_object_deallocate(), replacing the assertion GIANT_REQUIRED.
o Remove GIANT_REQUIRED from vm_map_protect() and vm_map_simplify_entry().
o Acquire and release Giant around vm_map_protect()'s call to pmap_protect().
Altogether, these changes eliminate the need for mprotect() to acquire
and release Giant.
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 352ad2f..0db982e 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -360,11 +360,10 @@ vm_object_allocate(objtype_t type, vm_size_t size) void vm_object_reference(vm_object_t object) { - GIANT_REQUIRED; - if (object == NULL) return; + mtx_lock(&Giant); #if 0 /* object can be re-referenced during final cleaning */ KASSERT(!(object->flags & OBJ_DEAD), @@ -377,6 +376,7 @@ vm_object_reference(vm_object_t object) printf("vm_object_reference: delay in getting object\n"); } } + mtx_unlock(&Giant); } /* @@ -427,12 +427,12 @@ vm_object_deallocate(vm_object_t object) { vm_object_t temp; - GIANT_REQUIRED; - + mtx_lock(&Giant); while (object != NULL) { if (object->type == OBJT_VNODE) { vm_object_vndeallocate(object); + mtx_unlock(&Giant); return; } @@ -447,6 +447,7 @@ vm_object_deallocate(vm_object_t object) */ object->ref_count--; if (object->ref_count > 1) { + mtx_unlock(&Giant); return; } else if (object->ref_count == 1) { if (object->shadow_count == 0) { @@ -487,13 +488,10 @@ vm_object_deallocate(vm_object_t object) continue; } } - + mtx_unlock(&Giant); return; - } - doterm: - temp = object->backing_object; if (temp) { TAILQ_REMOVE(&temp->shadow_head, object, shadow_list); @@ -514,6 +512,7 @@ doterm: vm_object_terminate(object); object = temp; } + mtx_unlock(&Giant); } /* |