ZFS ARC memory on Linux is not subtracted from used memory when htop is running as root
GermanCoding opened this issue · comments
Hello,
I just noticed the following weird behaviour. If I run htop as a non-root user (with no capabilites) htop 3.3.0 properly treats ARC memory as cache memory:
However, when I run htop as root the memory bar looks like this:
The memory in question is ZFS ARC memory:
The top two screenshots are made with default htop settings, i.e. no customization applied.
Both the normal and the root user can access /proc/spl/kstat/zfs/arcstats
. Note that it's the unprivileged user that works properly. Both users can show the ARC stats bar in htop normally, it's just that the root user doesn't properly adjust the memory bar.
OS: Debian Bookworm, Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
htop: Tested both debian package and 3.3.0 built from source
ZFS: zfs-2.2.2-4~bpo12+1
Weirdly enough, the 3.3.0 release built from source now seemingly fixed itself (while the 3.2.2 from debian is still broken).