linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] x86: Optimize memchr() for x86-64
@ 2022-05-28  8:12 Yu-Jen Chang
  2022-05-28  8:12 ` [PATCH 1/2] x86/lib: Optimize memchr() Yu-Jen Chang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Yu-Jen Chang @ 2022-05-28  8:12 UTC (permalink / raw)
  To: ak, jdike
  Cc: tglx, mingo, bp, dave.hansen, x86, hpa, keescook, linux-kernel,
	linux-hardening, richard, anton.ivanov, johannes, linux-um,
	jserv, Yu-Jen Chang

*** BLURB HERE ***
These patch series add an optimized "memchr()" for x86-64 and 
USER-MODE LINUX (UML).
 
There exists an assemebly implementation for x86-32. However, 
for x86-64, there isn't any optimized version. We implement word-wise 
comparison so that 8 characters can be compared at the same time on 
x86-64 CPU. The optimized “memchr()” is nearly 4x faster than the 
orginal implementation for long strings.

We test the optimized “memchr()” in UML and also recompile the 5.18 
Kernel with the optimized “memchr()”. They run correctly.

In this patch we add a new file "string_64.c", which only contains 
"memchr()". We can add more optimized string functions in it in the 
future.

Yu-Jen Chang (2):
  x86/lib: Optimize memchr()
  x86/um: Use x86_64-optimized memchr

 arch/x86/include/asm/string_64.h |  3 ++
 arch/x86/lib/Makefile            |  1 +
 arch/x86/lib/string_64.c         | 78 ++++++++++++++++++++++++++++++++
 arch/x86/um/Makefile             |  2 +-
 4 files changed, 83 insertions(+), 1 deletion(-)
 create mode 100644 arch/x86/lib/string_64.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-06-06  3:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-28  8:12 [PATCH 0/2] x86: Optimize memchr() for x86-64 Yu-Jen Chang
2022-05-28  8:12 ` [PATCH 1/2] x86/lib: Optimize memchr() Yu-Jen Chang
2022-05-28 16:41   ` Tao Zhou
2022-05-29 12:05     ` arthur chang arthur
2022-05-30  8:09   ` David Laight
2022-06-01  5:58     ` Yu-Jen Chang
2022-06-01  8:25       ` David Laight
2022-06-06  3:25         ` Yu-Jen Chang
2022-05-28  8:12 ` [PATCH 2/2] x86/um: Use x86_64-optimized memchr Yu-Jen Chang
2022-05-29  1:10 ` [PATCH 0/2] x86: Optimize memchr() for x86-64 Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).