You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This changes Linux zram accounting to enumerate existing /sys/block/zramN devices instead of probing zram0, zram1, and so on until a file open fails.
On systems without zram, htop otherwise repeats failed sysfs lookups for /sys/block/zram0/disksize and /sys/block/zram0/mm_stat on refresh. Enumerating /sys/block avoids that repeated ENOENT path and also naturally handles non-contiguous zram numbering.
The implementation follows the existing Linux compat style: each enumerated zram directory is opened relative to the /sys/block directory using the openat-style path, and disksize / mm_stat are read with Compat_readfileat rather than fopen.
Thanks, fixed. The zram scan no longer uses fopen for the sysfs files: it opens each enumerated zram directory relative to /sys/block using the openat-style compat path and reads disksize/mm_stat with Compat_readfileat.
I also reran the requested build path successfully: ./autogen.sh && ./configure && make -j2
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
enhancementExtension or improvement to existing featureLinux 🐧Linux related issues
2 participants
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.
Summary
This changes Linux zram accounting to enumerate existing
/sys/block/zramNdevices instead of probingzram0,zram1, and so on until a file open fails.On systems without zram, htop otherwise repeats failed sysfs lookups for
/sys/block/zram0/disksizeand/sys/block/zram0/mm_staton refresh. Enumerating/sys/blockavoids that repeatedENOENTpath and also naturally handles non-contiguous zram numbering.The implementation follows the existing Linux compat style: each enumerated zram directory is opened relative to the
/sys/blockdirectory using the openat-style path, anddisksize/mm_statare read withCompat_readfileatrather thanfopen.Validation
git diff --check./autogen.sh && ./configure && make -j2