Date: Mon, 21 Sep 2020 15:53:42 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365951 - head/sys/amd64/amd64 Message-ID: <202009211553.08LFrgwL010545@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Sep 21 15:53:41 2020 New Revision: 365951 URL: https://svnweb.freebsd.org/changeset/base/365951 Log: 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 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Sep 21 15:49:02 2020 (r365950) +++ head/sys/amd64/amd64/pmap.c Mon Sep 21 15:53:41 2020 (r365951) @@ -6525,12 +6525,13 @@ restart: 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 @@ restart: } 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)),
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009211553.08LFrgwL010545>