amd64 pmap: only calculate page table page when needed.
Noted by: alc Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26499
This commit is contained in:
parent
b1365a26e9
commit
6d4b6bd3ce
@ -6525,12 +6525,13 @@ pmap_enter_largepage(pmap_t pmap, vm_offset_t va, pt_entry_t newpte, int flags,
|
||||
origpte = *pdpe;
|
||||
MPASS(origpte == 0);
|
||||
} else {
|
||||
mp = PHYS_TO_VM_PAGE(*pml4e & PG_FRAME);
|
||||
pdpe = pmap_pdpe(pmap, va);
|
||||
KASSERT(pdpe != NULL, ("va %#lx lost pdpe", va));
|
||||
origpte = *pdpe;
|
||||
if ((origpte & PG_V) == 0)
|
||||
if ((origpte & PG_V) == 0) {
|
||||
mp = PHYS_TO_VM_PAGE(*pml4e & PG_FRAME);
|
||||
mp->ref_count++;
|
||||
}
|
||||
}
|
||||
KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 &&
|
||||
(origpte & PG_FRAME) == (pten & PG_FRAME)),
|
||||
@ -6563,10 +6564,11 @@ pmap_enter_largepage(pmap_t pmap, vm_offset_t va, pt_entry_t newpte, int flags,
|
||||
} else {
|
||||
pdpe = pmap_pdpe(pmap, va);
|
||||
MPASS(pdpe != NULL && (*pdpe & PG_V) != 0);
|
||||
mp = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME);
|
||||
origpte = *pde;
|
||||
if ((origpte & PG_V) == 0)
|
||||
if ((origpte & PG_V) == 0) {
|
||||
mp = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME);
|
||||
mp->ref_count++;
|
||||
}
|
||||
}
|
||||
KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 &&
|
||||
(origpte & PG_FRAME) == (pten & PG_FRAME)),
|
||||
|
Loading…
Reference in New Issue
Block a user