Omarchy installed zram-generator but never shipped a config for it, so the only zram tuning any machine had was whatever the ISO wrote once, and the VM sysctls were untouched kernel defaults aimed at spinning disks. The generator's own default caps the device at 4G, which on a large machine sends reclaim to the hibernation swapfile far earlier than it needs to go. Ship min(ram / 2, 8192) instead, matching what Fedora settles on, and state the priority explicitly since it has to sit above the pri=0 that omarchy-hibernation-setup gives the disk swapfile. The four sysctls follow from swap being RAM rather than a disk. swappiness above 100 says evicting an anonymous page beats dropping a page-cache page that would have to be read back, which is true once swap is compressed memory. page-cluster drops to one page per fault because the default of 8 buys readahead for a seek zram doesn't have and pays a decompression for each page. Zeroing watermark_boost_factor stops fragmentation from producing reclaim bursts while memory is still free, and raising watermark_scale_factor gives kswapd room to reclaim in the background instead of letting allocations stall in direct reclaim. The last two are what actually addresses the stutter people notice and misread as swap being used too eagerly: proactive swapping to zram is the cure, and synchronous direct reclaim is the disease. Every ISO-installed machine already has an unowned zram-generator.conf, which pacman would refuse to overwrite, so both upgrade paths need it listed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
13 lines
485 B
Plaintext
13 lines
485 B
Plaintext
# Compressed swap in RAM. zstd averages around 3:1, so the worst case for a
|
|
# full device is roughly a third of the size below.
|
|
#
|
|
# The generator's own default caps this at 4G, which sends machines with a lot
|
|
# of memory to the disk swapfile far earlier than they need to go.
|
|
[zram0]
|
|
zram-size = min(ram / 2, 8192)
|
|
compression-algorithm = zstd
|
|
|
|
# Above the pri=0 that omarchy-hibernation-setup gives the disk swapfile, so
|
|
# zram absorbs everything until it's full.
|
|
swap-priority = 100
|