Skip to contentSkip to conversation

lib/lzo: performance improvements

PATCH New Dave Rodgman 1 participant 4 messages Feb 5, 2019

lore
Share & tools
lore
#0 lore raw

v5 cover lib/lzo: performance improvements

Hi,

Following on from the previous lzo-rle patchset:

https://lkml.org/lkml/2018/11/30/972

This patchset contains only the patches which were ack'd by Markus (i.e., not the RLE patches). I believe Markus was happy to land these (please shout if that's not the case).

Regarding the RLE patches, I've done some additional benchmarking and will follow up with these as a separate patchset.

Dave

#1 lore raw

PATCH v5 1/3 lib/lzo: tidy-up ifdefs

Modify the ifdefs in lzodefs.h to be more consistent with normal kernel macros (e.g., change __aarch64__ to CONFIG_ARM64).

Cc Herbert Xu <[email protected]>
Cc David S. Miller <[email protected]>
Cc Nitin Gupta <[email protected]>
Cc Richard Purdie <[email protected]>
Cc Markus F.X.J. Oberhumer <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Sonny Rao <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Matt Sealey <[email protected]>
---
 lib/lzo/lzodefs.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
lib/lzo/lzodefs.h +4 -4
index 4edefd2f540c..497f9c9f03a8 100644
@@ -15,7 +15,7 @@
 
 #define COPY4(dst, src)	\
 		put_unaligned(get_unaligned((const u32 *)(src)), (u32 *)(dst))
-#if defined(__x86_64__)
+#if defined(CONFIG_X86_64)
 #define COPY8(dst, src)	\
 		put_unaligned(get_unaligned((const u64 *)(src)), (u64 *)(dst))
 #else
@@ -25,12 +25,12 @@
 
 #if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
 #error "conflicting endian definitions"
-#elif defined(__x86_64__)
+#elif defined(CONFIG_X86_64)
 #define LZO_USE_CTZ64	1
 #define LZO_USE_CTZ32	1
-#elif defined(__i386__) || defined(__powerpc__)
+#elif defined(CONFIG_X86) || defined(CONFIG_PPC)
 #define LZO_USE_CTZ32	1
-#elif defined(__arm__) && (__LINUX_ARM_ARCH__ >= 5)
+#elif defined(CONFIG_ARM) && (__LINUX_ARM_ARCH__ >= 5)
 #define LZO_USE_CTZ32	1
 #endif
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH v5 2/3 lib/lzo: 64-bit CTZ on arm64

In reply to Dave Rodgman

From: Matt Sealey <[email protected]>

LZO leaves some performance on the table by not realising that arm64 can optimize count-trailing-zeros bit operations.

Add CONFIG_ARM64 to the checked definitions alongside CONFIG_X86_64 to enable the use of rbit/clz instructions on full 64-bit quantities.

Cc David S. Miller <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Markus F.X.J. Oberhumer <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Nitin Gupta <[email protected]>
Cc Richard Purdie <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Sonny Rao <[email protected]>
---
 lib/lzo/lzodefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/lzo/lzodefs.h +1 -1
index 497f9c9f03a8..00d1080155e4 100644
@@ -25,7 +25,7 @@
 
 #if defined(__BIG_ENDIAN) && defined(__LITTLE_ENDIAN)
 #error "conflicting endian definitions"
-#elif defined(CONFIG_X86_64)
+#elif defined(CONFIG_X86_64) || defined(CONFIG_ARM64)
 #define LZO_USE_CTZ64	1
 #define LZO_USE_CTZ32	1
 #elif defined(CONFIG_X86) || defined(CONFIG_PPC)
Signature · 1 line
2.17.1
#3 lore raw

PATCH v5 3/3 lib/lzo: fast 8-byte copy on arm64

In reply to Dave Rodgman

From: Matt Sealey <[email protected]>

Enable faster 8-byte copies on arm64.

Cc David S. Miller <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Markus F.X.J. Oberhumer <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Nitin Gupta <[email protected]>
Cc Richard Purdie <[email protected]>
Cc Sergey Senozhatsky <[email protected]>
Cc Sonny Rao <[email protected]>
---
 lib/lzo/lzodefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/lzo/lzodefs.h +1 -1
index 00d1080155e4..fa0a45fed8c4 100644
@@ -15,7 +15,7 @@
 
 #define COPY4(dst, src)	\
 		put_unaligned(get_unaligned((const u32 *)(src)), (u32 *)(dst))
-#if defined(CONFIG_X86_64)
+#if defined(CONFIG_X86_64) || defined(CONFIG_ARM64)
 #define COPY8(dst, src)	\
 		put_unaligned(get_unaligned((const u64 *)(src)), (u64 *)(dst))
 #else
Signature · 1 line
2.17.1