From owner-svn-src-head@FreeBSD.ORG Wed Feb 24 00:55:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3DD51065670; Wed, 24 Feb 2010 00:55:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A33318FC1E; Wed, 24 Feb 2010 00:55:55 +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 o1O0ttJD030770; Wed, 24 Feb 2010 00:55:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1O0ttmZ030768; Wed, 24 Feb 2010 00:55:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002240055.o1O0ttmZ030768@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 24 Feb 2010 00:55:55 +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: r204269 - head/sys/powerpc/aim 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: Wed, 24 Feb 2010 00:55:55 -0000 Author: nwhitehorn Date: Wed Feb 24 00:55:55 2010 New Revision: 204269 URL: http://svn.freebsd.org/changeset/base/204269 Log: Use dcbz instead of word stores for page zeroing, providing a factor of 3-4 speedup. Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Feb 24 00:54:37 2010 (r204268) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Feb 24 00:55:55 2010 (r204269) @@ -1075,15 +1075,6 @@ moea64_change_wiring(mmu_t mmu, pmap_t p } /* - * Zero a page of physical memory by temporarily mapping it into the tlb. - */ -void -moea64_zero_page(mmu_t mmu, vm_page_t m) -{ - moea64_zero_page_area(mmu,m,0,PAGE_SIZE); -} - -/* * This goes through and sets the physical address of our * special scratch PTE to the PA we want to zero or copy. Because * of locking issues (this can get called in pvo_enter() by @@ -1147,6 +1138,27 @@ moea64_zero_page_area(mmu_t mmu, vm_page mtx_unlock(&moea64_scratchpage_mtx); } +/* + * Zero a page of physical memory by temporarily mapping it + */ +void +moea64_zero_page(mmu_t mmu, vm_page_t m) +{ + vm_offset_t pa = VM_PAGE_TO_PHYS(m); + vm_offset_t off; + + if (!moea64_initialized) + panic("moea64_zero_page: can't zero pa %#x", pa); + + mtx_lock(&moea64_scratchpage_mtx); + + moea64_set_scratchpage_pa(0,pa); + for (off = 0; off < PAGE_SIZE; off += cacheline_size) + __asm __volatile("dcbz 0,%0" :: + "r"(moea64_scratchpage_va[0] + off)); + mtx_unlock(&moea64_scratchpage_mtx); +} + void moea64_zero_page_idle(mmu_t mmu, vm_page_t m) {