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().
This commit is contained in:
parent
6f20d5e68f
commit
9917e01041
@ -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 {
|
||||
/*
|
||||
|
@ -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 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t start, vm_pindex_t end, bo
|
||||
}
|
||||
}
|
||||
vm_object_pip_wakeup(object);
|
||||
mtx_unlock(&Giant);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user