diff options
author | alc <alc@FreeBSD.org> | 2002-05-31 03:48:55 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-05-31 03:48:55 +0000 |
commit | 0b8e31ba859b8aa3aec339fcf67bd05866096ac2 (patch) | |
tree | aa180bd378cb5373e44a712b0fdbf6416abcf3f2 /sys/vm/vm_object.c | |
parent | cf0d37c01ce3cca726bdc3c525f3a38918b47b33 (diff) | |
download | FreeBSD-src-0b8e31ba859b8aa3aec339fcf67bd05866096ac2.zip FreeBSD-src-0b8e31ba859b8aa3aec339fcf67bd05866096ac2.tar.gz |
Further work on pushing Giant out of the vm_map layer and down
into the vm_object layer:
o Acquire and release Giant in vm_object_shadow() and
vm_object_page_remove().
o Remove the GIANT_REQUIRED assertion preceding vm_map_delete()'s call
to vm_object_page_remove().
o Remove the acquisition and release of Giant around vm_map_lookup()'s
call to vm_object_shadow().
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r-- | sys/vm/vm_object.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 373b16b..d4fe3f3 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1116,9 +1116,9 @@ vm_object_shadow( vm_object_t source; vm_object_t result; - GIANT_REQUIRED; source = *object; + mtx_lock(&Giant); /* * Don't create the new object if the old object isn't shared. */ @@ -1126,8 +1126,10 @@ vm_object_shadow( source->ref_count == 1 && source->handle == NULL && (source->type == OBJT_DEFAULT || - source->type == OBJT_SWAP)) + source->type == OBJT_SWAP)) { + mtx_unlock(&Giant); return; + } /* * Allocate a new object with the given length @@ -1172,6 +1174,8 @@ vm_object_shadow( */ *offset = 0; *object = result; + + mtx_unlock(&Giant); } #define OBSC_TEST_ALL_SHADOWED 0x0001 @@ -1603,12 +1607,14 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, bo unsigned int size; int all; - GIANT_REQUIRED; - - if (object == NULL || - object->resident_page_count == 0) + if (object == NULL) return; + mtx_lock(&Giant); + if (object->resident_page_count == 0) { + mtx_unlock(&Giant); + return; + } all = ((end == 0) && (start == 0)); /* @@ -1688,6 +1694,7 @@ again: } } vm_object_pip_wakeup(object); + mtx_unlock(&Giant); } /* |