Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730658 > unrolled thread

[PATCH 2/2] zram: remove zlib from the list of recommended algorithms

Started bySergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
First post2017-09-12 07:10 +0200
Last post2017-09-14 10:10 +0200
Articles 7 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] zram: remove zlib from the list of recommended algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-12 07:10 +0200
    Re: [PATCH 2/2] zram: remove zlib from the list of recommended  algorithms Minchan Kim <minchan@kernel.org> - 2017-09-12 08:50 +0200
      Re: [PATCH 2/2] zram: remove zlib from the list of recommended  algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-12 09:10 +0200
    Re: [PATCH 2/2] zram: remove zlib from the list of recommended  algorithms Minchan Kim <minchan@kernel.org> - 2017-09-13 09:20 +0200
      Re: [PATCH 2/2] zram: remove zlib from the list of recommended  algorithms Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-09-13 09:20 +0200
      Re: [PATCH 2/2] zram: remove zlib from the list of recommended  algorithms Adam Borowski <kilobyte@angband.pl> - 2017-09-13 12:40 +0200
        Re: [PATCH 2/2] zram: remove zlib from the list of recommended  algorithms Minchan Kim <minchan@kernel.org> - 2017-09-14 10:10 +0200

#1730658 — [PATCH 2/2] zram: remove zlib from the list of recommended algorithms

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2017-09-12 07:10 +0200
Subject[PATCH 2/2] zram: remove zlib from the list of recommended algorithms
Message-ID<uoLCp-5lx-5@gated-at.bofh.it>
ZSTD tends to outperform deflate/inflate, thus we remove
zlib from the list of recommended algorithms and recommend
zstd instead.

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Suggested-by: Minchan Kim <minchan@kernel.org>
---
 drivers/block/zram/zcomp.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index cc66daec7bbc..4ed0a78fdc09 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -23,9 +23,6 @@ static const char * const backends[] = {
 #if IS_ENABLED(CONFIG_CRYPTO_LZ4)
 	"lz4",
 #endif
-#if IS_ENABLED(CONFIG_CRYPTO_DEFLATE)
-	"deflate",
-#endif
 #if IS_ENABLED(CONFIG_CRYPTO_LZ4HC)
 	"lz4hc",
 #endif
-- 
2.14.1

[toc] | [next] | [standalone]


#1730686 — Re: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms

FromMinchan Kim <minchan@kernel.org>
Date2017-09-12 08:50 +0200
SubjectRe: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms
Message-ID<uoNbc-6fX-17@gated-at.bofh.it>
In reply to#1730658
Hi Sergey,

On Tue, Sep 12, 2017 at 02:00:05PM +0900, Sergey Senozhatsky wrote:
> ZSTD tends to outperform deflate/inflate, thus we remove
> zlib from the list of recommended algorithms and recommend
> zstd instead.
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Suggested-by: Minchan Kim <minchan@kernel.org>
 

One of my colleague have tested zstd compared zlib with a some
workload 4K data and he said it was not much better compared to
zlib so please give me a time to test it by myself.
I will test it with my sample data which dumped from my desktop.

Thanks.

[toc] | [prev] | [next] | [standalone]


#1730691 — Re: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2017-09-12 09:10 +0200
SubjectRe: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms
Message-ID<uoNuy-6Cp-5@gated-at.bofh.it>
In reply to#1730686
On (09/12/17 15:49), Minchan Kim wrote:
> On Tue, Sep 12, 2017 at 02:00:05PM +0900, Sergey Senozhatsky wrote:
> > ZSTD tends to outperform deflate/inflate, thus we remove
> > zlib from the list of recommended algorithms and recommend
> > zstd instead.
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > Suggested-by: Minchan Kim <minchan@kernel.org>
>  
> 
> One of my colleague have tested zstd compared zlib with a some
> workload 4K data and he said it was not much better compared to
> zlib so please give me a time to test it by myself.
> I will test it with my sample data which dumped from my desktop.

ok, no prob.

this patch is not mandatory, and I don't see any problems if we
will keep zlib in the list.

	-ss

[toc] | [prev] | [next] | [standalone]


#1731401 — Re: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms

FromMinchan Kim <minchan@kernel.org>
Date2017-09-13 09:20 +0200
SubjectRe: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms
Message-ID<upa7L-4ev-11@gated-at.bofh.it>
In reply to#1730658
On Tue, Sep 12, 2017 at 02:00:05PM +0900, Sergey Senozhatsky wrote:
> ZSTD tends to outperform deflate/inflate, thus we remove
> zlib from the list of recommended algorithms and recommend
> zstd instead.
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Suggested-by: Minchan Kim <minchan@kernel.org>
 
I did test with my sample data and compared zstd with deflate.
zstd's compress ratio is lower a little bit but compression
speed is much faster 3 times more and decompress speed is too
2 times more. With different data, it is different but overall,
zstd would be better for speed at the cost of a little lower compress
ratio(about 5%) so I believe it's worth to replace deflate.

Thanks for the patch, Sergey.

Acked-by: Minchan Kim <minchan@kernel.org>

[toc] | [prev] | [next] | [standalone]


#1731402 — Re: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms

FromSergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Date2017-09-13 09:20 +0200
SubjectRe: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms
Message-ID<upa7M-4ev-15@gated-at.bofh.it>
In reply to#1731401
On (09/13/17 16:12), Minchan Kim wrote:
> On Tue, Sep 12, 2017 at 02:00:05PM +0900, Sergey Senozhatsky wrote:
> > ZSTD tends to outperform deflate/inflate, thus we remove
> > zlib from the list of recommended algorithms and recommend
> > zstd instead.
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > Suggested-by: Minchan Kim <minchan@kernel.org>
>  
> I did test with my sample data and compared zstd with deflate.
> zstd's compress ratio is lower a little bit but compression
> speed is much faster 3 times more and decompress speed is too
> 2 times more. With different data, it is different but overall,
> zstd would be better for speed at the cost of a little lower compress
> ratio(about 5%) so I believe it's worth to replace deflate.

hm, interesting. on my "real world" use-cases zstd has better
compression ratio.

> Thanks for the patch, Sergey.
> 
> Acked-by: Minchan Kim <minchan@kernel.org>

thanks.

	-ss

[toc] | [prev] | [next] | [standalone]


#1731527 — Re: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms

FromAdam Borowski <kilobyte@angband.pl>
Date2017-09-13 12:40 +0200
SubjectRe: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms
Message-ID<updfj-6ad-1@gated-at.bofh.it>
In reply to#1731401
On Wed, Sep 13, 2017 at 04:12:46PM +0900, Minchan Kim wrote:
> On Tue, Sep 12, 2017 at 02:00:05PM +0900, Sergey Senozhatsky wrote:
> > ZSTD tends to outperform deflate/inflate, thus we remove
> > zlib from the list of recommended algorithms and recommend
> > zstd instead.
>  
> I did test with my sample data and compared zstd with deflate.
> zstd's compress ratio is lower a little bit but compression
> speed is much faster 3 times more and decompress speed is too
> 2 times more. With different data, it is different but overall,
> zstd would be better for speed at the cost of a little lower compress
> ratio(about 5%) so I believe it's worth to replace deflate.

Both zlib and zstd have the compression level adjustable, zstd in a far
greater range (from lzo-like at lowest levels to mid-range lzma at the
highest).  Thus, any such comparison needs to mention the used level.
Ie, if you selected a setting where speed is same, compression ratio
will be a lot better.

For compressing RAM it's reasonable to keep to fastest levels, and a
non-adjustable level reduces complexity, but if your use case wants high but
slow compression, now is a good time to mention this.


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀ I've read an article about how lively happy music boosts
⣾⠁⢰⠒⠀⣿⡁ productivity.  You can read it, too, you just need the
⢿⡄⠘⠷⠚⠋⠀ right music while doing so.  I recommend Skepticism
⠈⠳⣄⠀⠀⠀⠀ (funeral doom metal).

[toc] | [prev] | [next] | [standalone]


#1732100 — Re: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms

FromMinchan Kim <minchan@kernel.org>
Date2017-09-14 10:10 +0200
SubjectRe: [PATCH 2/2] zram: remove zlib from the list of recommended algorithms
Message-ID<upxnI-2uK-15@gated-at.bofh.it>
In reply to#1731527
On Wed, Sep 13, 2017 at 12:38:56PM +0200, Adam Borowski wrote:
> On Wed, Sep 13, 2017 at 04:12:46PM +0900, Minchan Kim wrote:
> > On Tue, Sep 12, 2017 at 02:00:05PM +0900, Sergey Senozhatsky wrote:
> > > ZSTD tends to outperform deflate/inflate, thus we remove
> > > zlib from the list of recommended algorithms and recommend
> > > zstd instead.
> >  
> > I did test with my sample data and compared zstd with deflate.
> > zstd's compress ratio is lower a little bit but compression
> > speed is much faster 3 times more and decompress speed is too
> > 2 times more. With different data, it is different but overall,
> > zstd would be better for speed at the cost of a little lower compress
> > ratio(about 5%) so I believe it's worth to replace deflate.
> 
> Both zlib and zstd have the compression level adjustable, zstd in a far
> greater range (from lzo-like at lowest levels to mid-range lzma at the
> highest).  Thus, any such comparison needs to mention the used level.
> Ie, if you selected a setting where speed is same, compression ratio
> will be a lot better.

Unfortunately, it seems crypto doesn't support configurable level yet
so when I read the source properly, zstd default level is 3 while
deflate is 6.

> 
> For compressing RAM it's reasonable to keep to fastest levels, and a
> non-adjustable level reduces complexity, but if your use case wants high but
> slow compression, now is a good time to mention this.

What I expect zstd is same comp ratio with zlib but much faster speed.
And lastly, predefined dictionary for 4K comp/decomp. :)

Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web