diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 2e3211fce69e..43e8865308bf 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1646,6 +1646,7 @@ vm_page_cowfault(vm_page_t m) pindex = m->pindex; retry_alloc: + pmap_remove_all(m); vm_page_remove(m); mnew = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL); if (mnew == NULL) { @@ -1672,6 +1673,8 @@ vm_page_cowfault(vm_page_t m) mnew->valid = VM_PAGE_BITS_ALL; vm_page_dirty(mnew); vm_page_flag_clear(mnew, PG_BUSY); + mnew->wire_count = m->wire_count - m->cow; + m->wire_count = m->cow; } }