Prevent zram LRU inversion with zswap and max_pool_percent = 100
9
votes
1
answer
5293
views
The major disadvantage of using zram is [LRU inversion](https://together.jolla.com/question/75162/replacing-zram-with-zswap/) :
> older pages get into the higher-priority zram and quickly fill it, while newer pages are swapped in and out of the slower [...] swap
The [zswap documentation](https://www.kernel.org/doc/Documentation/vm/zswap.txt) says that zswap does not suffer from this:
> Zswap receives pages for compression through the Frontswap API and is able to
evict pages from its own compressed pool on an LRU basis and write them back to
the backing swap device in the case that the compressed pool is full.
Could I have all the benefits of zram and a completely compressed RAM by setting
max_pool_percent
to 100
?
> Zswap seeks to be simple in its policies. Sysfs attributes allow for one user
controlled policy:
* max_pool_percent - The maximum percentage of memory that the compressed
pool can occupy.
No default max_pool_percent
is specified here, but the [Arch Wiki page](https://wiki.archlinux.org/index.php/Zswap#Customize_the_maximum_allowed_size) says that it is 20
.
Apart from the performance implications of decompressing, is there any danger / downside in setting max_pool_percent
to 100
?
Would it operate like using an improved swap-backed zram?
Asked by Tom Hale
(32922 rep)
Nov 25, 2017, 06:37 AM
Last activity: Feb 19, 2019, 05:48 PM
Last activity: Feb 19, 2019, 05:48 PM