From owner-svn-src-all@FreeBSD.ORG Wed Jan 21 06:32:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ECDC1065695; Wed, 21 Jan 2009 06:32:33 +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 0B1B08FC22; Wed, 21 Jan 2009 06:32:32 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0L6WWPJ068906; Wed, 21 Jan 2009 06:32:32 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0L6WW4Y068905; Wed, 21 Jan 2009 06:32:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200901210632.n0L6WW4Y068905@svn.freebsd.org> From: Alan Cox Date: Wed, 21 Jan 2009 06:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187520 - in stable/7/sys: . amd64/amd64 contrib/pf dev/ath/ath_hal dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 06:32:34 -0000 Author: alc Date: Wed Jan 21 06:32:32 2009 New Revision: 187520 URL: http://svn.freebsd.org/changeset/base/187520 Log: MFC rev 177851 Optimize pmap_pml4e() and pmap_pdpe() based upon two observations: The given pmap is never NULL, and therefore pmap_pml4e() can never return NULL. The pervasive use of these inline functions throughout the pmap makes these simple changes worthwhile. Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/pmap.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Wed Jan 21 06:30:53 2009 (r187519) +++ stable/7/sys/amd64/amd64/pmap.c Wed Jan 21 06:32:32 2009 (r187520) @@ -290,8 +290,6 @@ static __inline pml4_entry_t * pmap_pml4e(pmap_t pmap, vm_offset_t va) { - if (!pmap) - return NULL; return (&pmap->pm_pml4[pmap_pml4e_index(va)]); } @@ -312,7 +310,7 @@ pmap_pdpe(pmap_t pmap, vm_offset_t va) pml4_entry_t *pml4e; pml4e = pmap_pml4e(pmap, va); - if (pml4e == NULL || (*pml4e & PG_V) == 0) + if ((*pml4e & PG_V) == 0) return NULL; return (pmap_pml4e_to_pdpe(pml4e, va)); }