svn commit: r303583 - head/sys/amd64/amd64

Mateusz Guzik mjg at FreeBSD.org
Sun Jul 31 11:34:09 UTC 2016


Author: mjg
Date: Sun Jul 31 11:34:08 2016
New Revision: 303583
URL: https://svnweb.freebsd.org/changeset/base/303583

Log:
  amd64: implement pagezero using rep stos
  
  The current implementation uses non-temporal writes. This turns out to
  be detrimental to performance if the page is used shortly after, which
  is the typical case with page faults.
  
  Switch to rep stos.
  
  Reviewed by:	kib
  MFC after:	1 week

Modified:
  head/sys/amd64/amd64/support.S

Modified: head/sys/amd64/amd64/support.S
==============================================================================
--- head/sys/amd64/amd64/support.S	Sun Jul 31 10:37:09 2016	(r303582)
+++ head/sys/amd64/amd64/support.S	Sun Jul 31 11:34:08 2016	(r303583)
@@ -64,17 +64,10 @@ END(bzero)
 /* Address: %rdi */
 ENTRY(pagezero)
 	PUSH_FRAME_POINTER
-	movq	$-PAGE_SIZE,%rdx
-	subq	%rdx,%rdi
+	movq	$PAGE_SIZE/8,%rcx
 	xorl	%eax,%eax
-1:
-	movnti	%rax,(%rdi,%rdx)
-	movnti	%rax,8(%rdi,%rdx)
-	movnti	%rax,16(%rdi,%rdx)
-	movnti	%rax,24(%rdi,%rdx)
-	addq	$32,%rdx
-	jne	1b
-	sfence
+	rep
+	stosq
 	POP_FRAME_POINTER
 	ret
 END(pagezero)


More information about the svn-src-head mailing list