In x86 pmap_extract_and_hold(), there is no need to recalculate the

physical address, which is readily available after sucessfull
vm_page_pa_tryrelock().

Noted and reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D16085
This commit is contained in:
kib 2018-07-05 16:27:34 +00:00
parent 7852d84da8
commit a0b8819d1d
2 changed files with 4 additions and 6 deletions

View File

@ -2307,8 +2307,7 @@ retry:
if (vm_page_pa_tryrelock(pmap, (pde &
PG_PS_FRAME) | (va & PDRMASK), &pa))
goto retry;
m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) |
(va & PDRMASK));
m = PHYS_TO_VM_PAGE(pa);
vm_page_hold(m);
}
} else {
@ -2318,7 +2317,7 @@ retry:
if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME,
&pa))
goto retry;
m = PHYS_TO_VM_PAGE(pte & PG_FRAME);
m = PHYS_TO_VM_PAGE(pa);
if (m != NULL)
vm_page_hold(m);
}

View File

@ -1672,8 +1672,7 @@ retry:
if (vm_page_pa_tryrelock(pmap, (pde &
PG_PS_FRAME) | (va & PDRMASK), &pa))
goto retry;
m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) |
(va & PDRMASK));
m = PHYS_TO_VM_PAGE(pa);
vm_page_hold(m);
}
} else {
@ -1683,7 +1682,7 @@ retry:
if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME,
&pa))
goto retry;
m = PHYS_TO_VM_PAGE(pte & PG_FRAME);
m = PHYS_TO_VM_PAGE(pa);
if (m != NULL)
vm_page_hold(m);
}