Date: Sat, 20 Mar 2010 15:21:14 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r205380 - stable/8/sys/powerpc/aim Message-ID: <201003201521.o2KFLE6o010594@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Sat Mar 20 15:21:13 2010 New Revision: 205380 URL: http://svn.freebsd.org/changeset/base/205380 Log: MFC r204269: Use dcbz instead of word stores for page zeroing, providing a factor of 3-4 speedup. Modified: stable/8/sys/powerpc/aim/mmu_oea64.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea64.c Sat Mar 20 15:19:57 2010 (r205379) +++ stable/8/sys/powerpc/aim/mmu_oea64.c Sat Mar 20 15:21:13 2010 (r205380) @@ -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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003201521.o2KFLE6o010594>