diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 276304264bbd..38e8e62bfa97 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1741,6 +1741,13 @@ vm_page_dontneed(vm_page_t m) return; } + /* + * Clear any references to the page. Otherwise, the page daemon will + * immediately reactivate the page. + */ + vm_page_flag_clear(m, PG_REFERENCED); + pmap_clear_reference(m); + if (m->dirty == 0 && pmap_is_modified(m)) vm_page_dirty(m);