1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-12 14:29:28 +00:00

Lock the kernel object in kmem_alloc().

This commit is contained in:
Alan Cox 2003-06-07 23:24:10 +00:00
parent 36d1fdf5a2
commit 984a95d563
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115997

View File

@ -196,8 +196,10 @@ kmem_alloc(map, size)
for (i = 0; i < size; i += PAGE_SIZE) {
vm_page_t mem;
VM_OBJECT_LOCK(kernel_object);
mem = vm_page_grab(kernel_object, OFF_TO_IDX(offset + i),
VM_ALLOC_ZERO | VM_ALLOC_RETRY);
VM_OBJECT_UNLOCK(kernel_object);
if ((mem->flags & PG_ZERO) == 0)
pmap_zero_page(mem);
vm_page_lock_queues();