From 69680f169ccd4273c491e709b2406f6aec2ad77e Mon Sep 17 00:00:00 2001 From: alc Date: Sat, 14 Mar 2009 08:28:02 +0000 Subject: [PATCH] Update the pmap's resident page count when a page table page is freed in pmap_remove_pde() and pmap_remove_pages(). MFC after: 6 weeks --- sys/amd64/amd64/pmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index e367944a04c3..7760ab03019c 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2342,6 +2342,7 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offset_t sva, mpte = pmap_lookup_pt_page(pmap, sva); if (mpte != NULL) { pmap_remove_pt_page(pmap, mpte); + pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pde: pte page wire count error")); mpte->wire_count = 0; @@ -3851,6 +3852,7 @@ pmap_remove_pages(pmap_t pmap) mpte = pmap_lookup_pt_page(pmap, pv->pv_va); if (mpte != NULL) { pmap_remove_pt_page(pmap, mpte); + pmap->pm_stats.resident_count--; KASSERT(mpte->wire_count == NPTEPG, ("pmap_remove_pages: pte page wire count error")); mpte->wire_count = 0;