Questions tagged [zswap]

8 questions
27
votes
2 answers

Get current zswap memory usage and statistics

The zswap documentation says: 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. This specifies the…
Tom Hale
  • 28,728
  • 32
  • 139
  • 229
8
votes
1 answer

Prevent zram LRU inversion with zswap and max_pool_percent = 100

The major disadvantage of using zram is LRU inversion: 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 says that zswap does not suffer…
Tom Hale
  • 28,728
  • 32
  • 139
  • 229
5
votes
1 answer

Compress swap pages written to disk

This answer says that zswap decompresses pages before writing them to non-RAM swap. Is there any way to compress the pages written to disk, ideally with lz4? I hope to: Reduce SSD write wear Reduce swap disk allocation Speed up swap IO (hopefully…
Tom Hale
  • 28,728
  • 32
  • 139
  • 229
1
vote
2 answers

Effect of enabling zswap on zram without any disk swap

I have set up a system that has 4 GB RAM with 1.5 GiB of zram. It also has zswap enabled. I don't have any swap partition on the secondary storage. As I have noticed, the performance is good on my systems. Is the zswap being used on zram? Can using…
15 Volts
  • 1,969
  • 2
  • 19
  • 34
1
vote
1 answer

Which process (kernel thread) is doing the actual compression for zswap?

I can imagine actually two locations: In the kernel space belonging to the process whose ram is being swapped in/out From [kswapd0] However, digging into the kswapd source (mm/vmscan.c, init/main.c), I could find: kswapd is single-threaded, and is…
peterh
  • 9,488
  • 16
  • 59
  • 88
0
votes
0 answers

Recommended kernel parameters for zswap

There are a lot of proposals for this in the zram context, but not for zswap. What would be acceptable kernel parameters? vm.swappiness=100 (or even higher?) vm.vfs_cache_pressure=500 (really?) vm.oom_kill_allocating_task=1 vm.page-cluster = 0 …
mav
  • 1
0
votes
1 answer

CentOS 7 can Zswap be used? How to monitor Zswap? Is this a good idea?

Does CentOS 7 support Zswap? If so, how do I enable it and how to test to see if its working? Is this a good idea for a CentOS server? Enable attempt: chmod 777 /sys/module/zswap/parameters/enabled;echo 1 > /sys/module/zswap/parameters/enabled;…
Jeff Luyet
  • 299
  • 3
  • 16
0
votes
1 answer

When is zswap used?

I would like to reduce the wear of my SSD. I'm trying to understand the mechanics of zswap: Is zswap only used after the uncompresed swap is full? If no, what is the allocation policy?
Tom Hale
  • 28,728
  • 32
  • 139
  • 229