linux: add a disk-backed swap meter - #2081
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change collects non-zram disk-backed swap usage from Poem
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk remains; the change is merge-ready after normal checks and review. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Expose disk-backed swap separately from zram so users can distinguish backing-store pressure from compressed RAM usage. Co-authored-by: Codex <noreply@openai.com>
|
There's a swap meter already. Extend that in case you feel the zram use case warrants that? |
Thanks, I'm ready to extend the existing Swap meter rather than add a separate meter. One UI question before I revise it. /proc/swaps provides per-device Used values, but those include pages reported globally as SwapCached. The current Swap meter shows that cache separately. Would you prefer disk-backed and zram components to show backing-store occupancy, with SwapCached moved to text-only/removed from the bar. That would make the displayed disk/zram components honest and non-overlapping. Let me try to illustrate: Submitted implementation Swap: 2.25G / 40G Zram: 0.7G (2.0G) / 8G Suggested: extend the Swap meter Swap: 2.5G / 40G cache: 0.25G (included in a backing store) |
|
Do the math properly? ChatGPT Codex recommends:
Example: The columns are in KiB:
So in this example:
Shell commandYou can calculate it directly from To specifically distinguish zram vs disk swap, you can use: Important: zram's |
|
Thank you for the review and guidance. I’ll maintain the change in my fork as a separate disk-swap meter. Its purpose is to make disk-backed swap immediately visible, since it has materially different latency and stall implications from RAM-backed zram, a direction that may not fit upstream. The existing Zram meter remains useful for its compression and RAM-cost view. |
Expose disk-backed swap separately from zram so users can distinguish backing-store pressure from compressed RAM usage.
I chose Dsw abbreviation that is open to a better alternative.