There is no point in vm_contig_launder{,_page}() flushing held pages,
instead skip over them. As long as a page is held, it can't be reclaimed by contigmalloc(M_WAITOK). Moreover, a held page may be undergoing modification, e.g., vmapbuf(), so even if the hold were released before the completion of contigmalloc(), the page might have to be flushed again. MFC after: 3 weeks
This commit is contained in:
parent
685a270543
commit
fef87167c9
@ -100,7 +100,7 @@ vm_contig_launder_page(vm_page_t m, vm_page_t *next)
|
||||
vm_page_lock_assert(m, MA_OWNED);
|
||||
object = m->object;
|
||||
if (!VM_OBJECT_TRYLOCK(object) &&
|
||||
!vm_pageout_fallback_object_lock(m, next)) {
|
||||
(!vm_pageout_fallback_object_lock(m, next) || m->hold_count != 0)) {
|
||||
vm_page_unlock(m);
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
return (EAGAIN);
|
||||
@ -111,7 +111,7 @@ vm_contig_launder_page(vm_page_t m, vm_page_t *next)
|
||||
return (EBUSY);
|
||||
}
|
||||
vm_page_test_dirty(m);
|
||||
if (m->dirty == 0 && m->hold_count == 0)
|
||||
if (m->dirty == 0)
|
||||
pmap_remove_all(m);
|
||||
if (m->dirty != 0) {
|
||||
vm_page_unlock(m);
|
||||
@ -146,8 +146,7 @@ vm_contig_launder_page(vm_page_t m, vm_page_t *next)
|
||||
return (0);
|
||||
}
|
||||
} else {
|
||||
if (m->hold_count == 0)
|
||||
vm_page_cache(m);
|
||||
vm_page_cache(m);
|
||||
vm_page_unlock(m);
|
||||
}
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
@ -171,7 +170,7 @@ vm_contig_launder(int queue, vm_paddr_t low, vm_paddr_t high)
|
||||
if (pa < low || pa + PAGE_SIZE > high)
|
||||
continue;
|
||||
|
||||
if (!vm_pageout_page_lock(m, &next)) {
|
||||
if (!vm_pageout_page_lock(m, &next) || m->hold_count != 0) {
|
||||
vm_page_unlock(m);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user