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 | |
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')
-rw-r--r-- | sys/vm/vm_map.c | 5 | ||||
-rw-r--r-- | sys/vm/vm_object.c | 19 |
2 files changed, 15 insertions, 9 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 983b3b1..2da4baa 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2089,7 +2089,6 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end) offidxend = offidxstart + count; if ((object == kernel_object) || (object == kmem_object)) { - GIANT_REQUIRED; vm_object_page_remove(object, offidxstart, offidxend, FALSE); } else { mtx_lock(&Giant); @@ -2868,13 +2867,13 @@ RetryLookup:; */ if (vm_map_lock_upgrade(map)) goto RetryLookup; - mtx_lock(&Giant); + vm_object_shadow( &entry->object.vm_object, &entry->offset, atop(entry->end - entry->start)); - mtx_unlock(&Giant); entry->eflags &= ~MAP_ENTRY_NEEDS_COPY; + vm_map_lock_downgrade(map); } else { /* 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); } /* |