summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-12-23 20:10:47 +0000
committeralc <alc@FreeBSD.org>2002-12-23 20:10:47 +0000
commitf786588f12c011579b6f263dfeb9cb3fee910e7f (patch)
tree76372f1c55f2088de80af65f5a40611342328816 /sys
parent9ac9c4ac0c352bd7527c4e2d11ce5b069ea22436 (diff)
downloadFreeBSD-src-f786588f12c011579b6f263dfeb9cb3fee910e7f.zip
FreeBSD-src-f786588f12c011579b6f263dfeb9cb3fee910e7f.tar.gz
- Hold the kernel_object's lock around vm_page_alloc(kernel_object,...).
- Hold the page queues lock around vm_page_wakeup().
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_bio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index d0d3cfe..6890642 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -584,9 +584,11 @@ bufinit(void)
*/
bogus_offset = kmem_alloc_pageable(kernel_map, PAGE_SIZE);
+ vm_object_lock(kernel_object);
bogus_page = vm_page_alloc(kernel_object,
((bogus_offset - VM_MIN_KERNEL_ADDRESS) >> PAGE_SHIFT),
VM_ALLOC_NORMAL);
+ vm_object_unlock(kernel_object);
cnt.v_wire_count++;
}
@@ -3471,9 +3473,11 @@ tryagain:
* could intefere with paging I/O, no matter which
* process we are.
*/
+ vm_object_lock(kernel_object);
p = vm_page_alloc(kernel_object,
((pg - VM_MIN_KERNEL_ADDRESS) >> PAGE_SHIFT),
VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
+ vm_object_unlock(kernel_object);
if (!p) {
vm_pageout_deficit += (to - from) >> PAGE_SHIFT;
VM_WAIT;
@@ -3485,7 +3489,9 @@ tryagain:
vm_page_unlock_queues();
pmap_qenter(pg, &p, 1);
bp->b_pages[index] = p;
+ vm_page_lock_queues();
vm_page_wakeup(p);
+ vm_page_unlock_queues();
}
bp->b_npages = index;
}
OpenPOWER on IntegriCloud