foundObjects / zram-swap

A simple zram swap service for modern systemd Linux
MIT License
310 stars 42 forks source link

Backing device & recompression feature request #16

Open alazyworkaholic opened 6 months ago

alazyworkaholic commented 6 months ago

This script helps a lot but it still doesn't leverage all of zram's potential, at least when compiled with some optional features.

zram allows memory-constrained machines to not only compress some ram, but also write pages that have been idle for some time to disk. That requires compiling zram with CONFIG_ZRAM_WRITEBACK and CONFIG_ZRAM_TRACK_ENTRY_TIME, then echoing a number of seconds to /sys/block/zramX/idle.

zram also allows use of secondary compression algorithms through the CONFIG_ZRAM_MULTI_COMP option. So for example, if lzo can't compress a page, zstd could have a try.

I hope someone who knows how can add these features to the script.