1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

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().
This commit is contained in:
Alan Cox 2002-07-20 20:58:46 +00:00
parent d82efd2956
commit 40eab1e944
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100415
3 changed files with 5 additions and 1 deletions

View File

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

View File

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

View File

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