Skip to content

Commit

Permalink
Merge tag 'lzo-update-signature-20130226' of git://github.com/markus-…
Browse files Browse the repository at this point in the history
…oberhumer/linux

Pull LZO compression update from Markus Oberhumer:
 "Summary:
  ========

  Update the Linux kernel LZO compression and decompression code to the
  current upstream version which features significant performance
  improvements on modern machines.

  Some *synthetic* benchmarks:
  ============================

    x86_64 (Sandy Bridge), gcc-4.6 -O3, Silesia test corpus, 256 kB block-size:

                     compression speed   decompression speed

    LZO-2005    :         150 MB/sec          468 MB/sec
    LZO-2012    :         434 MB/sec         1210 MB/sec

    i386 (Sandy Bridge), gcc-4.6 -O3, Silesia test corpus, 256 kB block-size:

                     compression speed   decompression speed

    LZO-2005    :         143 MB/sec          409 MB/sec
    LZO-2012    :         372 MB/sec         1121 MB/sec

    armv7 (Cortex-A9), Linaro gcc-4.6 -O3, Silesia test corpus, 256 kB block-size:

                     compression speed   decompression speed

    LZO-2005    :          27 MB/sec           84 MB/sec
    LZO-2012    :          44 MB/sec          117 MB/sec
  **LZO-2013-UA :          47 MB/sec          167 MB/sec

  Legend:

    LZO-2005    : LZO version in current 3.8 kernel (which is based on
                     the LZO 2.02 release from 2005)
    LZO-2012    : updated LZO version available in linux-next
  **LZO-2013-UA : updated LZO version available in linux-next plus experimental
                     ARM Unaligned Access patch. This needs approval
                     from some ARM maintainer ist NOT YET INCLUDED."

Andrew Morton <[email protected]> acks it and says:
 "There's a new LZ4 on the block which is even faster than the sped-up
  LZO, but various filesystems and things use LZO"

* tag 'lzo-update-signature-20130226' of git://github.com/markus-oberhumer/linux:
  crypto: testmgr - update LZO compression test vectors
  lib/lzo: Update LZO compression to current upstream version
  lib/lzo: Rename lzo1x_decompress.c to lzo1x_decompress_safe.c
  • Loading branch information
torvalds committed Mar 1, 2013
2 parents 1e50059 + 0ec7382 commit b0af9cd
Show file tree
Hide file tree
Showing 8 changed files with 488 additions and 434 deletions.
38 changes: 20 additions & 18 deletions crypto/testmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -25084,38 +25084,40 @@ static struct pcomp_testvec zlib_decomp_tv_template[] = {
static struct comp_testvec lzo_comp_tv_template[] = {
{
.inlen = 70,
.outlen = 46,
.outlen = 57,
.input = "Join us now and share the software "
"Join us now and share the software ",
.output = "\x00\x0d\x4a\x6f\x69\x6e\x20\x75"
"\x73\x20\x6e\x6f\x77\x20\x61\x6e"
"\x64\x20\x73\x68\x61\x72\x65\x20"
"\x74\x68\x65\x20\x73\x6f\x66\x74"
"\x77\x70\x01\x01\x4a\x6f\x69\x6e"
"\x3d\x88\x00\x11\x00\x00",
"\x73\x20\x6e\x6f\x77\x20\x61\x6e"
"\x64\x20\x73\x68\x61\x72\x65\x20"
"\x74\x68\x65\x20\x73\x6f\x66\x74"
"\x77\x70\x01\x32\x88\x00\x0c\x65"
"\x20\x74\x68\x65\x20\x73\x6f\x66"
"\x74\x77\x61\x72\x65\x20\x11\x00"
"\x00",
}, {
.inlen = 159,
.outlen = 133,
.outlen = 131,
.input = "This document describes a compression method based on the LZO "
"compression algorithm. This document defines the application of "
"the LZO algorithm used in UBIFS.",
.output = "\x00\x2b\x54\x68\x69\x73\x20\x64"
.output = "\x00\x2c\x54\x68\x69\x73\x20\x64"
"\x6f\x63\x75\x6d\x65\x6e\x74\x20"
"\x64\x65\x73\x63\x72\x69\x62\x65"
"\x73\x20\x61\x20\x63\x6f\x6d\x70"
"\x72\x65\x73\x73\x69\x6f\x6e\x20"
"\x6d\x65\x74\x68\x6f\x64\x20\x62"
"\x61\x73\x65\x64\x20\x6f\x6e\x20"
"\x74\x68\x65\x20\x4c\x5a\x4f\x2b"
"\x8c\x00\x0d\x61\x6c\x67\x6f\x72"
"\x69\x74\x68\x6d\x2e\x20\x20\x54"
"\x68\x69\x73\x2a\x54\x01\x02\x66"
"\x69\x6e\x65\x73\x94\x06\x05\x61"
"\x70\x70\x6c\x69\x63\x61\x74\x76"
"\x0a\x6f\x66\x88\x02\x60\x09\x27"
"\xf0\x00\x0c\x20\x75\x73\x65\x64"
"\x20\x69\x6e\x20\x55\x42\x49\x46"
"\x53\x2e\x11\x00\x00",
"\x74\x68\x65\x20\x4c\x5a\x4f\x20"
"\x2a\x8c\x00\x09\x61\x6c\x67\x6f"
"\x72\x69\x74\x68\x6d\x2e\x20\x20"
"\x2e\x54\x01\x03\x66\x69\x6e\x65"
"\x73\x20\x74\x06\x05\x61\x70\x70"
"\x6c\x69\x63\x61\x74\x76\x0a\x6f"
"\x66\x88\x02\x60\x09\x27\xf0\x00"
"\x0c\x20\x75\x73\x65\x64\x20\x69"
"\x6e\x20\x55\x42\x49\x46\x53\x2e"
"\x11\x00\x00",
},
};

Expand Down
15 changes: 8 additions & 7 deletions include/linux/lzo.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@
* LZO Public Kernel Interface
* A mini subset of the LZO real-time data compression library
*
* Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <[email protected]>
* Copyright (C) 1996-2012 Markus F.X.J. Oberhumer <[email protected]>
*
* The full LZO package can be found at:
* http://www.oberhumer.com/opensource/lzo/
*
* Changed for kernel use by:
* Changed for Linux kernel use by:
* Nitin Gupta <[email protected]>
* Richard Purdie <[email protected]>
*/

#define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *))
#define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS
#define LZO1X_1_MEM_COMPRESS (8192 * sizeof(unsigned short))
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS

#define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3)

/* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */
/* This requires 'wrkmem' of size LZO1X_1_MEM_COMPRESS */
int lzo1x_1_compress(const unsigned char *src, size_t src_len,
unsigned char *dst, size_t *dst_len, void *wrkmem);
unsigned char *dst, size_t *dst_len, void *wrkmem);

/* safe decompression with overrun testing */
int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
unsigned char *dst, size_t *dst_len);
unsigned char *dst, size_t *dst_len);

/*
* Return values (< 0 = Error)
Expand All @@ -40,5 +40,6 @@ int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
#define LZO_E_EOF_NOT_FOUND (-7)
#define LZO_E_INPUT_NOT_CONSUMED (-8)
#define LZO_E_NOT_YET_IMPLEMENTED (-9)
#define LZO_E_INVALID_ARGUMENT (-10)

#endif
2 changes: 1 addition & 1 deletion lib/decompress_unlzo.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/

#ifdef STATIC
#include "lzo/lzo1x_decompress.c"
#include "lzo/lzo1x_decompress_safe.c"
#else
#include <linux/decompress/unlzo.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion lib/lzo/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lzo_compress-objs := lzo1x_compress.o
lzo_decompress-objs := lzo1x_decompress.o
lzo_decompress-objs := lzo1x_decompress_safe.o

obj-$(CONFIG_LZO_COMPRESS) += lzo_compress.o
obj-$(CONFIG_LZO_DECOMPRESS) += lzo_decompress.o
Loading

0 comments on commit b0af9cd

Please sign in to comment.