diff options
author | Daniel Lange <DLange@git.local> | 2022-06-03 08:55:20 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2022-06-03 08:55:20 +0200 |
commit | 937052b231259a47d881d539ad5748245ef55b99 (patch) | |
tree | 41071229fa007d8cf6902bb9253d2acd8cc66979 /linux/Platform.c | |
parent | 1b805a31720727008b32b1129a167758519fd4db (diff) | |
download | debian_htop-937052b231259a47d881d539ad5748245ef55b99.tar.gz debian_htop-937052b231259a47d881d539ad5748245ef55b99.tar.bz2 debian_htop-937052b231259a47d881d539ad5748245ef55b99.zip |
New upstream version 3.2.1upstream/3.2.1
Diffstat (limited to 'linux/Platform.c')
-rw-r--r-- | linux/Platform.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/linux/Platform.c b/linux/Platform.c index 775f9ae..38b66e8 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -358,8 +358,13 @@ void Platform_setMemoryValues(Meter* this) { this->values[4] = pl->availableMem; if (lpl->zfs.enabled != 0 && !Running_containerized) { - this->values[0] -= lpl->zfs.size; - this->values[3] += lpl->zfs.size; + // ZFS does not shrink below the value of zfs_arc_min. + unsigned long long int shrinkableSize = 0; + if (lpl->zfs.size > lpl->zfs.min) + shrinkableSize = lpl->zfs.size - lpl->zfs.min; + this->values[0] -= shrinkableSize; + this->values[3] += shrinkableSize; + this->values[4] += shrinkableSize; } } @@ -1035,7 +1040,7 @@ bool Platform_init(void) { char lineBuffer[256]; while (fgets(lineBuffer, sizeof(lineBuffer), fd)) { // detect lxc or overlayfs and guess that this means we are running containerized - if (String_startsWith(lineBuffer, "lxcfs ") || String_startsWith(lineBuffer, "overlay ")) { + if (String_startsWith(lineBuffer, "lxcfs /proc") || String_startsWith(lineBuffer, "overlay ")) { Running_containerized = true; break; } |