OSDN Git Service

lz4: fix wrong compress buffer size for 64-bits
authorBongkyu Kim <bongkyu.kim@lge.com>
Wed, 20 Jan 2016 23:01:08 +0000 (15:01 -0800)
committer0ranko0P <ranko0p@outlook.com>
Wed, 4 Dec 2019 13:39:55 +0000 (21:39 +0800)
commit74b5b2feabf94800e486347067218bd575ac59b2
treeee22b546da52a7373a47184fe242879cf037ddc4
parent846a7dc7741a7cc1b338320f067f6482425b63ed
lz4: fix wrong compress buffer size for 64-bits

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>
include/linux/lz4.h