diff options
author | alc <alc@FreeBSD.org> | 2010-12-29 20:35:36 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2010-12-29 20:35:36 +0000 |
commit | cc9b2308bc4a85b076312580e276d17723fb67ea (patch) | |
tree | 2068dd985689b454fbc17aa7a2130caff1c35ffa /sys/vm/vm_contig.c | |
parent | 584bccb74d788b3fd416e36c489ca3f6499a17b1 (diff) | |
download | FreeBSD-src-cc9b2308bc4a85b076312580e276d17723fb67ea.zip FreeBSD-src-cc9b2308bc4a85b076312580e276d17723fb67ea.tar.gz |
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
Diffstat (limited to 'sys/vm/vm_contig.c')
-rw-r--r-- | sys/vm/vm_contig.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/vm/vm_contig.c b/sys/vm/vm_contig.c index 3341634..0a2edf5 100644 --- a/sys/vm/vm_contig.c +++ b/sys/vm/vm_contig.c @@ -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; } |