Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Aug 2012 16:59:02 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239072 - head/sys/amd64/amd64
Message-ID:  <201208051659.q75Gx26M004986@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Aug  5 16:59:02 2012
New Revision: 239072
URL: http://svn.freebsd.org/changeset/base/239072

Log:
  Shave off a few more cycles from the average execution time of pmap_enter()
  by simplifying the control flow and reducing the live range of "om".

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

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Sun Aug  5 15:55:36 2012	(r239071)
+++ head/sys/amd64/amd64/pmap.c	Sun Aug  5 16:59:02 2012	(r239072)
@@ -3468,7 +3468,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
 		newpte |= PG_G;
 	newpte |= pmap_cache_bits(m->md.pat_mode, 0);
 
-	mpte = om = NULL;
+	mpte = NULL;
 
 	lock = NULL;
 	rw_rlock(&pvh_global_lock);
@@ -3540,12 +3540,6 @@ retry:
 			if (((origpte ^ newpte) & ~(PG_M | PG_A)) == 0)
 				goto unchanged;
 			goto validate;
-		} else {
-			/*
-			 * Yes, fall through to validate the new mapping.
-			 */
-			if ((origpte & PG_MANAGED) != 0)
-				om = PHYS_TO_VM_PAGE(opa);
 		}
 	} else {
 		/*
@@ -3578,6 +3572,7 @@ validate:
 		opa = origpte & PG_FRAME;
 		if (opa != pa) {
 			if ((origpte & PG_MANAGED) != 0) {
+				om = PHYS_TO_VM_PAGE(opa);
 				if ((origpte & (PG_M | PG_RW)) == (PG_M |
 				    PG_RW))
 					vm_page_dirty(om);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208051659.q75Gx26M004986>