Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2017 06:14:34 +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: r313939 - head/sys/i386/i386
Message-ID:  <201702190614.v1J6EYnD031985@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Feb 19 06:14:33 2017
New Revision: 313939
URL: https://svnweb.freebsd.org/changeset/base/313939

Log:
  MFamd64 r313933: microoptimize pmap_protect_pde().
  
  Noted by:	alc
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Sun Feb 19 06:02:41 2017	(r313938)
+++ head/sys/i386/i386/pmap.c	Sun Feb 19 06:14:33 2017	(r313939)
@@ -3129,12 +3129,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?201702190614.v1J6EYnD031985>