Date: Sun, 26 Feb 2017 10:53:02 +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: r314296 - in stable/11/sys: amd64/amd64 arm/arm i386/i386 Message-ID: <201702261053.v1QAr2OH060474@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Feb 26 10:53:02 2017 New Revision: 314296 URL: https://svnweb.freebsd.org/changeset/base/314296 Log: MFC r313933, r313939, r313966: Microoptimize pmap_protect_pde() on amd64, i386 and pmap_protect_pte1() on armv6. Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/arm/arm/pmap-v6.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 Sun Feb 26 09:48:18 2017 (r314295) +++ stable/11/sys/amd64/amd64/pmap.c Sun Feb 26 10:53:02 2017 (r314296) @@ -4015,12 +4015,12 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t anychanged = FALSE; retry: oldpde = newpde = *pde; - if (oldpde & PG_MANAGED) { + if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { eva = sva + NBPDR; for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); va < eva; va += PAGE_SIZE, m++) - if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) - vm_page_dirty(m); + vm_page_dirty(m); } if ((prot & VM_PROT_WRITE) == 0) newpde &= ~(PG_RW | PG_M); Modified: stable/11/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/11/sys/arm/arm/pmap-v6.c Sun Feb 26 09:48:18 2017 (r314295) +++ stable/11/sys/arm/arm/pmap-v6.c Sun Feb 26 10:53:02 2017 (r314296) @@ -4806,12 +4806,11 @@ pmap_protect_pte1(pmap_t pmap, pt1_entry ("%s: sva is not 1mpage aligned", __func__)); opte1 = npte1 = pte1_load(pte1p); - if (pte1_is_managed(opte1)) { + if (pte1_is_managed(opte1) && pte1_is_dirty(opte1)) { eva = sva + PTE1_SIZE; for (va = sva, m = PHYS_TO_VM_PAGE(pte1_pa(opte1)); va < eva; va += PAGE_SIZE, m++) - if (pte1_is_dirty(opte1)) - vm_page_dirty(m); + vm_page_dirty(m); } if ((prot & VM_PROT_WRITE) == 0) npte1 |= PTE1_RO | PTE1_NM; Modified: stable/11/sys/i386/i386/pmap.c ============================================================================== --- stable/11/sys/i386/i386/pmap.c Sun Feb 26 09:48:18 2017 (r314295) +++ stable/11/sys/i386/i386/pmap.c Sun Feb 26 10:53:02 2017 (r314296) @@ -3146,12 +3146,12 @@ pmap_protect_pde(pmap_t pmap, pd_entry_t anychanged = FALSE; retry: oldpde = newpde = *pde; - if (oldpde & PG_MANAGED) { + if ((oldpde & (PG_MANAGED | PG_M | PG_RW)) == + (PG_MANAGED | PG_M | PG_RW)) { eva = sva + NBPDR; for (va = sva, m = PHYS_TO_VM_PAGE(oldpde & PG_PS_FRAME); va < eva; va += PAGE_SIZE, m++) - if ((oldpde & (PG_M | PG_RW)) == (PG_M | PG_RW)) - vm_page_dirty(m); + vm_page_dirty(m); } if ((prot & VM_PROT_WRITE) == 0) newpde &= ~(PG_RW | PG_M);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702261053.v1QAr2OH060474>