stability: always enable zram (drop memory-total gate)#756
Merged
Conversation
Compressed swap is cheap headroom even on high-RAM boxes; the 6 GiB MemTotal gate skipped exactly the pressured 8 GB multi-snap boxes (boris prod) that benefit most. Remove the gate so EnsureConfigured always configures zram; alreadyOn() keeps it idempotent.
Old buster kernels (4.19) expose zram comp_algorithm without zstd ([lzo] lz4 lz4hc). Writing zstd there fails EINVAL, which aborted EnsureConfigured before disksize/swapon, so zram never came up. zram already has a working default algorithm, so treat the comp_algorithm write as best-effort and only require disksize. Surfaced on borisarm64 (amd64 buster) once the memory gate was removed.
The swap fullness bar can't distinguish cold parked pages (benign) from active thrashing. Collect pswpin/pswpout from /proc/vmstat as swap_in_pages/swap_out_pages; the frontend deltas them like disk rates and renders 'in X · out Y KB/s' under the swap bar. Missing /proc/vmstat (or absent counters) degrades to 0. PSI intentionally left out — no kernel support on the target boxes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Remove the 6 GiB
MemTotalgate inbackend/stability/zram.gosoEnsureConfigured()always configures zram, regardless of total/available RAM.Why
The gate skipped exactly the boxes that benefit most: high-RAM but heavily-loaded machines (e.g. boris prod — 8 GB, ~15 snaps) fell above the 6 GiB threshold and never got compressed swap. Compressed swap is cheap headroom on any box, and
alreadyOn()keeps configuration idempotent, so unconditional enable is safe.Resolves the "Decision needed: how to lift the gate" item in
TODO-zram-health.md(the Health-page si/so + iowait visibility work remains open).Changes
zram.go: dropmemThresholdKBand the skip branch.zram_test.go: remove the now-obsolete above-threshold skip test.TODO-zram-health.md: record the decision (gate removed, always-on).TODO.md: drop gptfdisk from the 3rdparty migration list (already migrated in-tree).Test
go test ./stability/passes locally.