aboutsummaryrefslogtreecommitdiffstats
path: root/pcp/Platform.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2022-06-03 08:55:20 +0200
committerDaniel Lange <DLange@git.local>2022-06-03 08:55:20 +0200
commit937052b231259a47d881d539ad5748245ef55b99 (patch)
tree41071229fa007d8cf6902bb9253d2acd8cc66979 /pcp/Platform.c
parent1b805a31720727008b32b1129a167758519fd4db (diff)
downloaddebian_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 'pcp/Platform.c')
-rw-r--r--pcp/Platform.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pcp/Platform.c b/pcp/Platform.c
index b3d6ed4..342bf43 100644
--- a/pcp/Platform.c
+++ b/pcp/Platform.c
@@ -178,6 +178,7 @@ static const char* Platform_metricNames[] = {
[PCP_ZFS_ARC_BONUS_SIZE] = "zfs.arc.bonus_size",
[PCP_ZFS_ARC_COMPRESSED_SIZE] = "zfs.arc.compressed_size",
[PCP_ZFS_ARC_UNCOMPRESSED_SIZE] = "zfs.arc.uncompressed_size",
+ [PCP_ZFS_ARC_C_MIN] = "zfs.arc.c_min",
[PCP_ZFS_ARC_C_MAX] = "zfs.arc.c_max",
[PCP_ZFS_ARC_DBUF_SIZE] = "zfs.arc.dbuf_size",
[PCP_ZFS_ARC_DNODE_SIZE] = "zfs.arc.dnode_size",
@@ -510,8 +511,13 @@ void Platform_setMemoryValues(Meter* this) {
this->values[4] = pl->availableMem;
if (ppl->zfs.enabled != 0) {
- this->values[0] -= ppl->zfs.size;
- this->values[3] += ppl->zfs.size;
+ // ZFS does not shrink below the value of zfs_arc_min.
+ unsigned long long int shrinkableSize = 0;
+ if (ppl->zfs.size > ppl->zfs.min)
+ shrinkableSize = ppl->zfs.size - ppl->zfs.min;
+ this->values[0] -= shrinkableSize;
+ this->values[3] += shrinkableSize;
+ this->values[4] += shrinkableSize;
}
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy