From owner-svn-src-all@FreeBSD.ORG Fri Jan 22 20:30:54 2010 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 6C6AC1065679; Fri, 22 Jan 2010 20:30:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A5568FC18; Fri, 22 Jan 2010 20:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MKUsH9077429; Fri, 22 Jan 2010 20:30:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0MKUsDw077427; Fri, 22 Jan 2010 20:30:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001222030.o0MKUsDw077427@svn.freebsd.org> From: John Baldwin Date: Fri, 22 Jan 2010 20:30:54 +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: r202829 - stable/7/sys/amd64/amd64 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: Fri, 22 Jan 2010 20:30:54 -0000 Author: jhb Date: Fri Jan 22 20:30:54 2010 New Revision: 202829 URL: http://svn.freebsd.org/changeset/base/202829 Log: MFC 189415: Make pmap_copy() more TLB friendly. Specifically, make it use the kernel's direct map instead of the pmap's recursive mapping to access the lowest level in the page table. Modified: stable/7/sys/amd64/amd64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/pmap.c ============================================================================== --- stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:24:55 2010 (r202828) +++ stable/7/sys/amd64/amd64/pmap.c Fri Jan 22 20:30:54 2010 (r202829) @@ -3498,9 +3498,6 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm if (dst_addr != src_addr) return; - if (!pmap_is_current(src_pmap)) - return; - vm_page_lock_queues(); if (dst_pmap < src_pmap) { PMAP_LOCK(dst_pmap); @@ -3562,14 +3559,16 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm continue; } - srcmpte = PHYS_TO_VM_PAGE(srcptepaddr & PG_FRAME); + srcptepaddr &= PG_FRAME; + srcmpte = PHYS_TO_VM_PAGE(srcptepaddr); KASSERT(srcmpte->wire_count > 0, ("pmap_copy: source page table page is unused")); if (va_next > end_addr) va_next = end_addr; - src_pte = vtopte(addr); + src_pte = (pt_entry_t *)PHYS_TO_DMAP(srcptepaddr); + src_pte = &src_pte[pmap_pte_index(addr)]; while (addr < va_next) { pt_entry_t ptetemp; ptetemp = *src_pte;