diff options
author | alc <alc@FreeBSD.org> | 2008-06-13 19:33:56 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2008-06-13 19:33:56 +0000 |
commit | 25d85147e9c41d73a46d9e0ea7e24f281f3ff43c (patch) | |
tree | a0da85ab67d90c3a142a6f0eacd9b7a902c57074 /sys | |
parent | b3ec9d20e2e35d17969bd802375c6c5816f967f5 (diff) | |
download | FreeBSD-src-25d85147e9c41d73a46d9e0ea7e24f281f3ff43c.zip FreeBSD-src-25d85147e9c41d73a46d9e0ea7e24f281f3ff43c.tar.gz |
Tweak the promotion test in pmap_promote_pde(). Specifically, test PG_A
before PG_M. This sometimes prevents unnecessary removal of write access
from a PTE. Overall, the net result is fewer demotions and promotion
failures.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8114bb8..be003ec 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2768,9 +2768,8 @@ static void pmap_promote_pde(pmap_t pmap, pd_entry_t *pde, vm_offset_t va) { pd_entry_t newpde; - pt_entry_t *firstpte, oldpte, *pte; + pt_entry_t *firstpte, oldpte, pa, *pte; vm_offset_t oldpteva; - vm_paddr_t pa; vm_page_t mpte; PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -2801,14 +2800,14 @@ setpde: /* * Examine each of the other PTEs in the specified PTP. Abort if this - * PTE maps an unexpected physical page or does not have identical + * PTE maps an unexpected 4KB physical page or does not have identical * characteristics to the first PTE. */ - pa = (newpde & PG_PS_FRAME) + NBPDR - PAGE_SIZE; + pa = (newpde & (PG_PS_FRAME | PG_A | PG_V)) + NBPDR - PAGE_SIZE; for (pte = firstpte + NPTEPG - 1; pte > firstpte; pte--) { setpte: oldpte = *pte; - if ((oldpte & PG_FRAME) != pa) { + if ((oldpte & (PG_FRAME | PG_A | PG_V)) != pa) { pmap_pde_p_failures++; CTR2(KTR_PMAP, "pmap_promote_pde: failure for va %#lx" " in pmap %p", va, pmap); |