lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1447906787-27226-1-git-send-email-bongkyu.kim@lge.com>
Date:	Thu, 19 Nov 2015 13:19:47 +0900
From:	Bongkyu Kim <bongkyu.kim@....com>
To:	<akpm@...ux-foundation.org>
CC:	linux-kernel@...r.kernel.org, chanho.min@....com,
	yann.collet.73@...il.com, kyungsik.lee@....com,
	Bongkyu Kim <bongkyu.kim@....com>
Subject: [PATCH] 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.

Cc: Chanho Min <chanho.min@....com>
Cc: Yann Collet <yann.collet.73@...il.com>
Cc: Kyungsik Lee <kyungsik.lee@....com>
Signed-off-by: Bongkyu Kim <bongkyu.kim@....com>
---
 include/linux/lz4.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/lz4.h b/include/linux/lz4.h
index 4356686..6b784c5 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()
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ