Skip to contentSkip to conversation

lib-add-lz4-compressor-module.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jul 9, 2013 Library code

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

Subject: [merged] lib-add-lz4-compressor-module.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 09 Jul 2013 16:22:27 -0700

The patch titled
Subject: lib: add lz4 compressor module
has been removed from the -mm tree. Its filename was
lib-add-lz4-compressor-module.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Chanho Min <[email protected]>
Subject: lib: add lz4 compressor module

This patchset is for supporting LZ4 compression and the crypto API using it.

As shown below, the size of data is a little bit bigger but compressing speed is faster under the enabled unaligned memory access. We can use lz4 de/compression through crypto API as well. Also, It will be useful for another potential user of lz4 compression.

lz4 Compression Benchmark:
Compiler: ARM gcc 4.6.4
ARMv7, 1 GHz based board
Kernel: linux 3.4
Uncompressed data Size: 101 MB
Compressed Size compression Speed

   LZO   72.1MB		  32.1MB/s, 33.0MB/s(UA)
   LZ4   75.1MB		  30.4MB/s, 35.9MB/s(UA)

LZ4HC 59.8MB 2.4MB/s, 2.5MB/s(UA)
- UA: Unaligned memory Access support
- Latest patch set for LZO applied

This patch:

Add support for LZ4 compression in the Linux Kernel. LZ4 Compression APIs for kernel are based on LZ4 implementation by Yann Collet and were changed for kernel coding style.

LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
LZ4 source repository : http://code.google.com/p/lz4/
svn revision : r90

Two APIs are added:

lz4_compress() support basic lz4 compression whereas lz4hc_compress() support high compression or CPU performance get lower but compression ratio get higher. Also, we require the pre-allocated working memory with the defined size and destination buffer must be allocated with the size of lz4_compressbound.

[[email protected]: make lz4_compresshcctx() static]
Cc "Darrick J. Wong" <[email protected]>
Cc Bob Pearson <[email protected]>
Cc Richard Weinberger <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Yann Collet <[email protected]>
Cc Kyungsik Lee <[email protected]>

---

 include/linux/lz4.h      |   36 ++
 lib/Kconfig              |    6 
 lib/Makefile             |    2 
 lib/lz4/Makefile         |    2 
 lib/lz4/lz4_compress.c   |  443 ++++++++++++++++++++++++++++++
 lib/lz4/lz4defs.h        |   66 ++++
 lib/lz4/lz4hc_compress.c |  539 +++++++++++++++++++++++++++++++++++++
 7 files changed, 1092 insertions(+), 2 deletions(-)
include/linux/lz4.h renamed from include/linux/lz4.h~lib-add-lz4-compressor-module +36 -0
diff -puN include/linux/lz4.h~lib-add-lz4-compressor-module include/linux/lz4.h
@@ -9,6 +9,8 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#define LZ4_MEM_COMPRESS	(4096 * sizeof(unsigned char *))
+#define LZ4HC_MEM_COMPRESS	(65538 * sizeof(unsigned char *))
 
 /*
  * lz4_compressbound()
@@ -21,6 +23,40 @@ static inline size_t lz4_compressbound(s
 }
 
 /*
+ * lz4_compress()
+ *	src     : source address of the original data
+ *	src_len : size of the original data
+ *	dst	: output buffer address of the compressed data
+ *		This requires 'dst' of size LZ4_COMPRESSBOUND.
+ *	dst_len : is the output size, which is returned after compress done
+ *	workmem : address of the working memory.
+ *		This requires 'workmem' of size LZ4_MEM_COMPRESS.
+ *	return  : Success if return 0
+ *		  Error if return (< 0)
+ *	note :  Destination buffer and workmem must be already allocated with
+ *		the defined size.
+ */
+int lz4_compress(const unsigned char *src, size_t src_len,
+		unsigned char *dst, size_t *dst_len, void *wrkmem);
+
+ /*
+  * lz4hc_compress()
+  *	 src	 : source address of the original data
+  *	 src_len : size of the original data
+  *	 dst	 : output buffer address of the compressed data
+  *		This requires 'dst' of size LZ4_COMPRESSBOUND.
+  *	 dst_len : is the output size, which is returned after compress done
+  *	 workmem : address of the working memory.
+  *		This requires 'workmem' of size LZ4HC_MEM_COMPRESS.
+  *	 return  : Success if return 0
+  *		   Error if return (< 0)
+  *	 note :  Destination buffer and workmem must be already allocated with
+  *		 the defined size.
+  */
+int lz4hc_compress(const unsigned char *src, size_t src_len,
+		unsigned char *dst, size_t *dst_len, void *wrkmem);
+
+/*
  * lz4_decompress()
  *	src     : source address of the compressed data
  *	src_len : is the input size, whcih is returned after decompress done
lib/Kconfig renamed from lib/Kconfig~lib-add-lz4-compressor-module +6 -0
diff -puN lib/Kconfig~lib-add-lz4-compressor-module lib/Kconfig
@@ -194,6 +194,12 @@ config LZO_COMPRESS
 config LZO_DECOMPRESS
 	tristate
 
+config LZ4_COMPRESS
+	tristate
+
+config LZ4HC_COMPRESS
+	tristate
+
 config LZ4_DECOMPRESS
 	tristate
 
lib/Makefile renamed from lib/Makefile~lib-add-lz4-compressor-module +2 -0
diff -puN lib/Makefile~lib-add-lz4-compressor-module lib/Makefile
@@ -75,6 +75,8 @@ obj-$(CONFIG_REED_SOLOMON) += reed_solom
 obj-$(CONFIG_BCH) += bch.o
 obj-$(CONFIG_LZO_COMPRESS) += lzo/
 obj-$(CONFIG_LZO_DECOMPRESS) += lzo/
+obj-$(CONFIG_LZ4_COMPRESS) += lz4/
+obj-$(CONFIG_LZ4HC_COMPRESS) += lz4/
 obj-$(CONFIG_LZ4_DECOMPRESS) += lz4/
 obj-$(CONFIG_XZ_DEC) += xz/
 obj-$(CONFIG_RAID6_PQ) += raid6/
lib/lz4/Makefile renamed from lib/lz4/Makefile~lib-add-lz4-compressor-module +2 -0
diff -puN lib/lz4/Makefile~lib-add-lz4-compressor-module lib/lz4/Makefile
@@ -1 +1,3 @@
+obj-$(CONFIG_LZ4_COMPRESS) += lz4_compress.o
+obj-$(CONFIG_LZ4HC_COMPRESS) += lz4hc_compress.o
 obj-$(CONFIG_LZ4_DECOMPRESS) += lz4_decompress.o
lib/lz4/lz4_compress.c new file +443 -0

443 lines not on this page · raw message

lib/lz4/lz4defs.h renamed from lib/lz4/lz4defs.h~lib-add-lz4-compressor-module +64 -2

108 lines not on this page · raw message

lib/lz4/lz4hc_compress.c new file +539 -0

539 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

origin.patch