Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1631647

[PATCH 1/5] x86_64: use REP MOVSB in copy_page()

From Alexey Dobriyan <adobriyan@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/5] x86_64: use REP MOVSB in copy_page()
Date 2017-04-26 20:30 +0200
Message-ID <tAzRo-5Yn-17@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


On my Broadwell-era Xeon copying page with REP MOVSB is ~7.8% faster
than with REP MOVSQ. Choose REP MOVSB copy_page() at runtime
with alternatives.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/lib/copy_page_64.S |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/arch/x86/lib/copy_page_64.S
+++ b/arch/x86/lib/copy_page_64.S
@@ -13,13 +13,21 @@
  */
 	ALIGN
 ENTRY(copy_page)
-	ALTERNATIVE "jmp copy_page_regs", "", X86_FEATURE_REP_GOOD
+	ALTERNATIVE_2 "jmp copy_page_regs",	\
+		"", X86_FEATURE_REP_GOOD,	\
+		"jmp copy_page_rep_movsb", X86_FEATURE_ERMS
 	movl	$4096/8, %ecx
 	rep	movsq
 	ret
 ENDPROC(copy_page)
 EXPORT_SYMBOL(copy_page)
 
+ENTRY(copy_page_rep_movsb)
+	mov	$4096, %ecx
+	rep movsb
+	ret
+ENDPROC(copy_page_rep_movsb)
+
 ENTRY(copy_page_regs)
 	subq	$2*8,	%rsp
 	movq	%rbx,	(%rsp)

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/5] x86_64: use REP MOVSB in copy_page() Alexey Dobriyan <adobriyan@gmail.com> - 2017-04-26 20:30 +0200
  [PATCH 2/5] x86_64: inline copy_page() at call site Alexey Dobriyan <adobriyan@gmail.com> - 2017-04-26 20:30 +0200
    [PATCH 3/5] x86_64: rename clear_page() and copy_user() variants Alexey Dobriyan <adobriyan@gmail.com> - 2017-04-26 20:40 +0200
      [PATCH 5/5] x86_64: garbage collect headers in clear_page.S Alexey Dobriyan <adobriyan@gmail.com> - 2017-04-26 20:40 +0200
      [PATCH 4/5] x86_64: clobber "cc" in inlined clear_page() Alexey Dobriyan <adobriyan@gmail.com> - 2017-04-26 20:40 +0200
      Re: [PATCH 3/5] x86_64: rename clear_page() and copy_user() variants Borislav Petkov <bp@alien8.de> - 2017-05-05 19:00 +0200
    Re: [PATCH 2/5] x86_64: inline copy_page() at call site Borislav Petkov <bp@alien8.de> - 2017-04-28 23:10 +0200
      Re: [PATCH 2/5] x86_64: inline copy_page() at call site Alexey Dobriyan <adobriyan@gmail.com> - 2017-05-02 13:50 +0200
        Re: [PATCH 2/5] x86_64: inline copy_page() at call site Borislav Petkov <bp@alien8.de> - 2017-05-02 14:10 +0200

csiph-web