svn commit: r303954 - stable/11/sys/amd64/amd64

Mateusz Guzik mjg at FreeBSD.org
Thu Aug 11 09:30:27 UTC 2016


Author: mjg
Date: Thu Aug 11 09:30:25 2016
New Revision: 303954
URL: https://svnweb.freebsd.org/changeset/base/303954

Log:
  MFC r303583:
  
  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.
  
  Approved by:	re (gjb)

Modified:
  stable/11/sys/amd64/amd64/support.S
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/support.S
==============================================================================
--- stable/11/sys/amd64/amd64/support.S	Thu Aug 11 09:28:49 2016	(r303953)
+++ stable/11/sys/amd64/amd64/support.S	Thu Aug 11 09:30:25 2016	(r303954)
@@ -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-all mailing list