summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-12-19 01:20:24 +0000
committeralc <alc@FreeBSD.org>2002-12-19 01:20:24 +0000
commit3f31cbe67cd067fcd32b9c61eeba4277c4dc7c92 (patch)
treea8892343387259028ae23ffc6e6c9632e007f4e4 /sys/vm
parent265543a63d9e97398e8c01fed016676a2cae0e97 (diff)
downloadFreeBSD-src-3f31cbe67cd067fcd32b9c61eeba4277c4dc7c92.zip
FreeBSD-src-3f31cbe67cd067fcd32b9c61eeba4277c4dc7c92.tar.gz
- Hold the page queues lock when performing vm_page_busy() or
vm_page_flag_set(). - Replace vm_page_sleep_busy() with proper page queues locking and vm_page_sleep_if_busy().
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_fault.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index fe5ad6a..564e5c6 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -349,7 +349,9 @@ RetryFault:;
if ((fs.m->flags & PG_BUSY) || fs.m->busy) {
vm_page_unlock_queues();
unlock_things(&fs);
- (void)vm_page_sleep_busy(fs.m, TRUE, "vmpfw");
+ vm_page_lock_queues();
+ if (!vm_page_sleep_if_busy(fs.m, TRUE, "vmpfw"))
+ vm_page_unlock_queues();
cnt.v_intrans++;
vm_object_deallocate(fs.first_object);
goto RetryFault;
@@ -712,7 +714,9 @@ readrest:
*/
vm_page_rename(fs.m, fs.first_object, fs.first_pindex);
fs.first_m = fs.m;
+ vm_page_lock_queues();
vm_page_busy(fs.first_m);
+ vm_page_unlock_queues();
fs.m = NULL;
cnt.v_cow_optim++;
} else {
@@ -829,6 +833,7 @@ readrest:
*/
if (prot & VM_PROT_WRITE) {
+ vm_page_lock_queues();
vm_page_flag_set(fs.m, PG_WRITEABLE);
vm_object_set_writeable_dirty(fs.m->object);
@@ -853,6 +858,7 @@ readrest:
} else {
vm_page_flag_clear(fs.m, PG_NOSYNC);
}
+ vm_page_unlock_queues();
if (fault_flags & VM_FAULT_DIRTY) {
int s;
vm_page_dirty(fs.m);
OpenPOWER on IntegriCloud