Skip to content

zramctl: fix MEM-USED column description to make it clear it is a peak value #3695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ticpu
Copy link

@ticpu ticpu commented Aug 22, 2025

The MEM-USED column was incorrectly documented as showing current memory consumption. This is due to confusing naming in the kernel's zram implementation:

  • Kernel field "mem_used_total" (3rd in mm_stat) = current memory usage
  • Kernel field "mem_used_max" (5th in mm_stat) = peak memory usage

zramctl maps these as:

  • TOTAL column <= mem_used_total (current usage)
  • MEM-USED column <= mem_used_max (peak usage)

The misleading "MEM-USED" name suggests current usage, but it actually shows the peak memory usage (high water mark) since device creation or last reset. This is tracked by the kernel's max_used_pages which only increases when current usage exceeds the stored maximum.

The MEM-USED column was incorrectly documented as showing current
memory consumption. This is due to confusing naming in the kernel's
zram implementation:

- Kernel field "mem_used_total" (3rd in mm_stat) = current memory usage
- Kernel field "mem_used_max" (5th in mm_stat) = peak memory usage

zramctl maps these as:
- TOTAL column <= mem_used_total (current usage)
- MEM-USED column <= mem_used_max (peak usage)

The misleading "MEM-USED" name suggests current usage, but it actually
shows the peak memory usage (high water mark) since device creation
or last reset. This is tracked by the kernel's max_used_pages which
only increases when current usage exceeds the stored maximum.

Fixed description from:
"memory zram have been consumed to store compressed data" to
"peak memory usage to store compressed data".

Mise à jour de la traduction française.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant