diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 21103b39db4b..9bc15feabb4b 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1292,7 +1292,7 @@ vm_page_try_to_cache(vm_page_t m) (m->flags & (PG_BUSY|PG_UNMANAGED))) { return (0); } - vm_page_test_dirty(m); + pmap_remove_all(m); if (m->dirty) return (0); vm_page_cache(m); diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index f807b772121b..05f1d5f62ec6 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -801,8 +801,7 @@ vm_pageout_scan(int pass) * far as the VM code knows, any partially dirty pages are * fully dirty. */ - if (m->dirty == 0) { - vm_page_test_dirty(m); + if (m->dirty == 0 && !pmap_is_modified(m)) { /* * Avoid a race condition: Unless write access is * removed from the page, another processor could @@ -816,7 +815,7 @@ vm_pageout_scan(int pass) * to the page, removing all access will be cheaper * overall. */ - if (m->dirty == 0 && (m->flags & PG_WRITEABLE) != 0) + if ((m->flags & PG_WRITEABLE) != 0) pmap_remove_all(m); } else { vm_page_dirty(m);