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

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

 



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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux