From owner-svn-src-head@FreeBSD.ORG Sun Aug 5 16:59:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E4501065676; Sun, 5 Aug 2012 16:59:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A0C88FC17; Sun, 5 Aug 2012 16:59:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q75Gx3IG004988; Sun, 5 Aug 2012 16:59:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q75Gx26M004986; Sun, 5 Aug 2012 16:59:02 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201208051659.q75Gx26M004986@svn.freebsd.org> From: Alan Cox Date: Sun, 5 Aug 2012 16:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239072 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Aug 2012 16:59:03 -0000 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);