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


Groups > linux.kernel > #1614745

Re: [RFC] mm/crypto: add tunable compression algorithm for zswap

From Matthew Wilcox <willy@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFC] mm/crypto: add tunable compression algorithm for zswap
Date 2017-04-02 16:00 +0200
Message-ID <trOcW-1aa-13@gated-at.bofh.it> (permalink)
References <tryBc-83Z-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Apr 01, 2017 at 11:18:13PM +0200, Vlastimil Babka wrote:
> In this prototype patch, it offers three predefined ratios, but nothing
> prevents more fine-grained settings, except the current crypto API (or my
> limited knowledge of it, but I'm guessing nobody really expected the
> compression ratio to be tunable). So by doing
> 
> echo tco50 > /sys/module/zswap/parameters/compressor
> 
> you get 50% compression ratio, guaranteed! This setting and zbud are just the
> perfect buddies, if you prefer the nice and simple allocator. Zero internal
> fragmentation!

[...]

> +struct tco_ctx {
> +	char ratio;
> +};

You say this is a ratio, but it's a plain char.  Clearly it should be
a floating point number; what if I want to achieve 2/3 compression?
Or if I'm a disgruntled sysadmin wanting to show how much more Linux
suxks than BSD, I might want to expand memory when it goes to swap,
perhaps taking up an extra 25%.

Maybe we could get away with char numerator; char denominator to allow
for the most common rationals, but a floating point ratio would be easier
to program with and allow for maximum flexibility.  I don't think we
need to have as much precision as a double; a plain float should suffice.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC] mm/crypto: add tunable compression algorithm for zswap Vlastimil Babka <vbabka@suse.cz> - 2017-04-01 23:20 +0200
  Re: [RFC] mm/crypto: add tunable compression algorithm for zswap Matthew Wilcox <willy@infradead.org> - 2017-04-02 16:00 +0200
  Re: [RFC] mm/crypto: add tunable compression algorithm for zswap Minchan Kim <minchan@kernel.org> - 2017-04-03 07:40 +0200

csiph-web