Perform vm_object_lock() and vm_object_unlock() on kmem_object

around vm_page_lookup() and vm_page_free().
This commit is contained in:
Alan Cox 2002-12-15 21:09:09 +00:00
parent bffa911730
commit 4b36fe0cbd

View File

@ -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);