svn commit: r292901 - head/sys/powerpc/booke

Justin Hibbits jhibbits at FreeBSD.org
Wed Dec 30 02:26:05 UTC 2015


Author: jhibbits
Date: Wed Dec 30 02:26:04 2015
New Revision: 292901
URL: https://svnweb.freebsd.org/changeset/base/292901

Log:
  Optimize zero_page for book-e mmu.
  
  Instead of indirectly calling bzero() through mmu_booke_zero_page_area, zero the
  full page the same way as the AIM pmap logic does: using dcbz.

Modified:
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/pmap.c
==============================================================================
--- head/sys/powerpc/booke/pmap.c	Wed Dec 30 02:23:14 2015	(r292900)
+++ head/sys/powerpc/booke/pmap.c	Wed Dec 30 02:26:04 2015	(r292901)
@@ -2235,8 +2235,17 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_p
 static void
 mmu_booke_zero_page(mmu_t mmu, vm_page_t m)
 {
+	vm_offset_t off, va;
 
-	mmu_booke_zero_page_area(mmu, m, 0, PAGE_SIZE);
+	mtx_lock(&zero_page_mutex);
+	va = zero_page_va;
+
+	mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m));
+	for (off = 0; off < PAGE_SIZE; off += cacheline_size)
+		__asm __volatile("dcbzl 0,%0" :: "r"(va + off));
+	mmu_booke_kremove(mmu, va);
+
+	mtx_unlock(&zero_page_mutex);
 }
 
 /*


More information about the svn-src-head mailing list