Date: Fri, 13 Jul 2018 21:30:19 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r336266 - in stable/11/sys: amd64/amd64 i386/i386 Message-ID: <201807132130.w6DLUJU9037451@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Jul 13 21:30:18 2018 New Revision: 336266 URL: https://svnweb.freebsd.org/changeset/base/336266 Log: MFC r335969,r335996,r335999,r336008,r336010: Improvements to x86 pmap_extract_and_hold(). Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/i386/i386/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Fri Jul 13 21:23:03 2018 (r336265) +++ stable/11/sys/amd64/amd64/pmap.c Fri Jul 13 21:30:18 2018 (r336266) @@ -2231,9 +2231,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)); - vm_page_hold(m); + m = PHYS_TO_VM_PAGE(pa); } } else { pte = *pmap_pde_to_pte(pdep, va); @@ -2242,10 +2240,11 @@ retry: if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, &pa)) goto retry; - m = PHYS_TO_VM_PAGE(pte & PG_FRAME); - vm_page_hold(m); + m = PHYS_TO_VM_PAGE(pa); } } + if (m != NULL) + vm_page_hold(m); } PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap); Modified: stable/11/sys/i386/i386/pmap.c ============================================================================== --- stable/11/sys/i386/i386/pmap.c Fri Jul 13 21:23:03 2018 (r336265) +++ stable/11/sys/i386/i386/pmap.c Fri Jul 13 21:30:18 2018 (r336266) @@ -1536,9 +1536,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)); - vm_page_hold(m); + m = PHYS_TO_VM_PAGE(pa); } } else { ptep = pmap_pte(pmap, va); @@ -1549,10 +1547,11 @@ retry: if (vm_page_pa_tryrelock(pmap, pte & PG_FRAME, &pa)) goto retry; - m = PHYS_TO_VM_PAGE(pte & PG_FRAME); - vm_page_hold(m); + m = PHYS_TO_VM_PAGE(pa); } } + if (m != NULL) + vm_page_hold(m); } PA_UNLOCK_COND(pa); PMAP_UNLOCK(pmap);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807132130.w6DLUJU9037451>