Never sleep on busy pages in vm_pageout_launder(), always skip them. Long

ago, sleeping on busy pages in vm_pageout_launder() made sense.  The call
to vm_pageout_flush() specified asynchronous I/O and sleeping on busy pages
blocked vm_pageout_launder() until the flush had completed.  However, in
CVS revision 1.35 of vm/vm_contig.c, the call to vm_pageout_flush() was
changed to request synchronous I/O, but the sleep on busy pages was not
removed.
This commit is contained in:
Alan Cox 2012-08-07 04:48:14 +00:00
parent d2da554492
commit 18f55b0171

View File

@ -586,23 +586,14 @@ vm_pageout_launder(int queue, int tries, vm_paddr_t low, vm_paddr_t high)
continue;
}
object = m->object;
if (!VM_OBJECT_TRYLOCK(object) &&
if ((!VM_OBJECT_TRYLOCK(object) &&
(!vm_pageout_fallback_object_lock(m, &next) ||
m->hold_count != 0)) {
m->hold_count != 0)) || (m->oflags & VPO_BUSY) != 0 ||
m->busy != 0) {
vm_page_unlock(m);
VM_OBJECT_UNLOCK(object);
continue;
}
if ((m->oflags & VPO_BUSY) != 0 || m->busy != 0) {
if (tries == 0) {
vm_page_unlock(m);
VM_OBJECT_UNLOCK(object);
continue;
}
vm_page_sleep(m, "vpctw0");
VM_OBJECT_UNLOCK(object);
return (FALSE);
}
vm_page_test_dirty(m);
if (m->dirty == 0)
pmap_remove_all(m);