compswap-zram #1

Merged
solene merged 10 commits from compswap-zram into main 2026-10-28 22:03:13 +00:00
Owner

add zram support and rename project

add zram support and rename project
Prepare for zram support with a name tied to neither zswap nor zram.
Load both files into associative arrays instead of running awk for every value.
Prefix every system path with COMPSWAP_ROOT, so the script can be tested against hand-made files.
Detect zram swap devices next to zswap and only show the sections that
apply. zswap being disabled is no longer an error when zram is in use.

- New zram section: devices, algorithm, stored data, RAM used with
  allocator overhead, real and raw compression ratios, same-filled and
  incompressible pages, fill level, mem_limit and backing device.
- One "Effective RAM" line adds up what zswap and zram save.
- The swap section lists every device with its type, priority and
  usage, and splits usage between zswap, zram and disk.
- zram I/O goes through the block layer and is counted in pswpin and
  pswpout: subtract it to get real disk traffic.
- New hints: zram almost full, write failures, mem_limit reached, and
  no compressed swap in use at all.
Describe both mechanisms, the new zram section, and the extra data sources.
Warn when zram has a priority not higher than disk swap, and suggest vm.page-cluster=0 and a higher vm.swappiness, which suit zram better.
Below 64 MiB, the fixed allocator overhead skews the ratio and gave false "low ratio" warnings on a nearly empty zram. Show the ratio without color or hint in that case. Same rule for zswap.
Only suggest zstd for devices that do not use it already, and tell fragmentation (high allocator overhead) apart from poorly compressible data.
After switching from zswap to zram (or back), the old counters stay until reboot and cluttered the activity section. Hide them, and when neither mechanism is active, show the leftovers instead: they tell one was used since boot.
Disk counters run since boot, so after a switch between zswap and zram they include pages swapped out before it. Report this as information instead of a warning.
solene merged commit 72dd3cd0fa into main 2026-10-28 22:03:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/compswap!1
No description provided.