Perform vm_object_lock() and vm_object_unlock() on kmem_object
around vm_page_lookup() and vm_page_free().
This commit is contained in:
parent
bffa911730
commit
4b36fe0cbd
@ -384,11 +384,13 @@ kmem_malloc(map, size, flags)
|
||||
*/
|
||||
while (i != 0) {
|
||||
i -= PAGE_SIZE;
|
||||
vm_object_lock(kmem_object);
|
||||
m = vm_page_lookup(kmem_object,
|
||||
OFF_TO_IDX(offset + i));
|
||||
vm_page_lock_queues();
|
||||
vm_page_free(m);
|
||||
vm_page_unlock_queues();
|
||||
vm_object_unlock(kmem_object);
|
||||
}
|
||||
vm_map_delete(map, addr, addr + size);
|
||||
vm_map_unlock(map);
|
||||
@ -420,7 +422,9 @@ kmem_malloc(map, size, flags)
|
||||
* splimp...)
|
||||
*/
|
||||
for (i = 0; i < size; i += PAGE_SIZE) {
|
||||
vm_object_lock(kmem_object);
|
||||
m = vm_page_lookup(kmem_object, OFF_TO_IDX(offset + i));
|
||||
vm_object_unlock(kmem_object);
|
||||
vm_page_lock_queues();
|
||||
vm_page_wire(m);
|
||||
vm_page_wakeup(m);
|
||||
|
Loading…
Reference in New Issue
Block a user