Date: Mon, 21 Jun 2021 22:27:09 GMT From: Alan Cox <alc@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 6f6a166eaf5e - main - arm64: Use page_to_pvh() when the vm_page_t is known Message-ID: <202106212227.15LMR9Bf000388@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=6f6a166eaf5e59dedb761ea6152417433a841e3b commit 6f6a166eaf5e59dedb761ea6152417433a841e3b Author: Alan Cox <alc@FreeBSD.org> AuthorDate: 2021-06-21 07:45:21 +0000 Commit: Alan Cox <alc@FreeBSD.org> CommitDate: 2021-06-21 22:25:06 +0000 arm64: Use page_to_pvh() when the vm_page_t is known When support for a sparse pv_table was added, the implementation of pa_to_pvh() changed from a simple constant-time calculation to iterating over the array vm_phys_segs[]. To mitigate this issue, an alternative function, page_to_pvh(), was introduced that still runs in constant time but requires the vm_page_t to be known. However, three cases where the vm_page_t is known were not converted to page_to_pvh(). This change converts those three cases. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30832 --- sys/arm64/arm64/pmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index ffc83be852bd..5f321be98528 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -3474,7 +3474,7 @@ pmap_pv_promote_l2(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, va = va & ~L2_OFFSET; pv = pmap_pvh_remove(&m->md, pmap, va); KASSERT(pv != NULL, ("pmap_pv_promote_l2: pv not found")); - pvh = pa_to_pvh(pa); + pvh = page_to_pvh(m); TAILQ_INSERT_TAIL(&pvh->pv_list, pv, pv_next); pvh->pv_gen++; /* Free the remaining NPTEPG - 1 pv entries. */ @@ -3896,7 +3896,7 @@ havel3: if ((om->a.flags & PGA_WRITEABLE) != 0 && TAILQ_EMPTY(&om->md.pv_list) && ((om->flags & PG_FICTITIOUS) != 0 || - TAILQ_EMPTY(&pa_to_pvh(opa)->pv_list))) + TAILQ_EMPTY(&page_to_pvh(om)->pv_list))) vm_page_aflag_clear(om, PGA_WRITEABLE); } else { KASSERT((orig_l3 & ATTR_AF) != 0, @@ -5000,7 +5000,7 @@ pmap_remove_pages(pmap_t pmap) case 1: pmap_resident_count_dec(pmap, L2_SIZE / PAGE_SIZE); - pvh = pa_to_pvh(tpte & ~ATTR_MASK); + pvh = page_to_pvh(m); TAILQ_REMOVE(&pvh->pv_list, pv,pv_next); pvh->pv_gen++; if (TAILQ_EMPTY(&pvh->pv_list)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106212227.15LMR9Bf000388>