summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-07-20 20:58:46 +0000
committeralc <alc@FreeBSD.org>2002-07-20 20:58:46 +0000
commitd9f77c5b739a154c9ca07cbdf0e2679cd57449d5 (patch)
treece71e86d9ac1e61bb0d0ba9c5b2c057a640f59b4 /sys/vm
parent4de6bb3a4daba912d5ac55ac077dfd83183ec6b3 (diff)
downloadFreeBSD-src-d9f77c5b739a154c9ca07cbdf0e2679cd57449d5.zip
FreeBSD-src-d9f77c5b739a154c9ca07cbdf0e2679cd57449d5.tar.gz
o Lock page queue accesses by vm_page_try_to_cache(). (The accesses
in kern/vfs_bio.c are already locked.) o Assert that the page queues lock is held in vm_page_try_to_cache().
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/swap_pager.c2
-rw-r--r--sys/vm/vm_page.c2
-rw-r--r--sys/vm/vm_pageout.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index dfe34da..614fd48 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1478,6 +1478,7 @@ swp_pager_async_iodone(bp)
*/
pmap_qremove((vm_offset_t)bp->b_data, bp->b_npages);
+ vm_page_lock_queues();
/*
* cleanup pages. If an error occurs writing to swap, we are in
* very serious trouble. If it happens to be a disk error, though,
@@ -1596,6 +1597,7 @@ swp_pager_async_iodone(bp)
vm_page_protect(m, VM_PROT_READ);
}
}
+ vm_page_unlock_queues();
/*
* adjust pip. NOTE: the original parent may still have its own
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 3a80951..cb613be 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1365,8 +1365,8 @@ vm_page_deactivate(vm_page_t m)
int
vm_page_try_to_cache(vm_page_t m)
{
- GIANT_REQUIRED;
+ mtx_assert(&vm_page_queue_mtx, MA_OWNED);
if (m->dirty || m->hold_count || m->busy || m->wire_count ||
(m->flags & (PG_BUSY|PG_UNMANAGED))) {
return (0);
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 047fac1..fe2ee34 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -392,6 +392,7 @@ vm_pageout_flush(mc, count, flags)
(flags | ((object == kernel_object) ? OBJPC_SYNC : 0)),
pageout_status);
+ vm_page_lock_queues();
for (i = 0; i < count; i++) {
vm_page_t mt = mc[i];
@@ -437,6 +438,7 @@ vm_pageout_flush(mc, count, flags)
vm_page_protect(mt, VM_PROT_READ);
}
}
+ vm_page_unlock_queues();
return numpagedout;
}
OpenPOWER on IntegriCloud