diff options
| author | Bongkyu Kim <bongkyu.kim@lge.com> | 2016-01-20 15:01:08 -0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-11 10:56:58 +0200 |
| commit | d24c88af10583aef3ffd7368b7e95101dc8a6a0e (patch) | |
| tree | d9657e5bf9f2b47d914ff94230d6de9c3a46a986 /include | |
| parent | 79d232d6916ba8625e5eacf3b067ea23efc3143b (diff) | |
UPSTREAM: lz4: fix wrong compress buffer size for 64-bits
(cherry picked from commit 06af1c52c9ea234e0b1266cc0b52c3e0c6c8fe9f)
The current lz4 compress buffer is 16kb on 32-bits, 32kb on 64-bits
system. But, lz4 needs only 16kb on both. On 64-bits, this causes
wasted cpu cycles for additional memset during every compression.
In case of lz4hc, the current buffer size is (256kb + 8) on 32-bits,
(512kb + 16) on 64-bits. But, lz4hc needs only (256kb + 2 * pointer) on
both.
This patch fixes these wrong compress buffer sizes for 64-bits.
Signed-off-by: Bongkyu Kim <bongkyu.kim@lge.com>
Cc: Chanho Min <chanho.min@lge.com>
Cc: Yann Collet <yann.collet.73@gmail.com>
Cc: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/lz4.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/lz4.h b/include/linux/lz4.h index 4356686b0..6b784c59f 100644 --- a/include/linux/lz4.h +++ b/include/linux/lz4.h @@ -9,8 +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 *)) +#define LZ4_MEM_COMPRESS (16384) +#define LZ4HC_MEM_COMPRESS (262144 + (2 * sizeof(unsigned char *))) /* * lz4_compressbound() |
