+ lz4-fix-wrong-compress-buffer-size-for-64-bits.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lz4: fix wrong compress buffer size for 64-bits
has been added to the -mm tree.  Its filename is
     lz4-fix-wrong-compress-buffer-size-for-64-bits.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lz4-fix-wrong-compress-buffer-size-for-64-bits.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lz4-fix-wrong-compress-buffer-size-for-64-bits.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Bongkyu Kim <bongkyu.kim@xxxxxxx>
Subject: 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@xxxxxxx>
Cc: Chanho Min <chanho.min@xxxxxxx>
Cc: Yann Collet <yann.collet.73@xxxxxxxxx>
Cc: Kyungsik Lee <kyungsik.lee@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/lz4.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN include/linux/lz4.h~lz4-fix-wrong-compress-buffer-size-for-64-bits include/linux/lz4.h
--- a/include/linux/lz4.h~lz4-fix-wrong-compress-buffer-size-for-64-bits
+++ a/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()
_

Patches currently in -mm which might be from bongkyu.kim@xxxxxxx are

lz4-fix-wrong-compress-buffer-size-for-64-bits.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux