summaryrefslogtreecommitdiffstats
path: root/linux/Platform.c
diff options
context:
space:
mode:
authormulti <multi@in-addr.xyz>2020-09-24 19:13:25 +0100
committermulti <multi@in-addr.xyz>2020-09-24 23:27:27 +0100
commitdfa40ad0ebdb40a859ea16a264e775ce766bb037 (patch)
tree76f8531d98435add158fefb20b60c90f1fc02e25 /linux/Platform.c
parentf4bb50294a31c0d46dbcd742c4002f4fbb20d2a8 (diff)
Linux: consider the ZFS ARC to be cache.
This commit is based on a patch originally by @edef1c. The ZFS ARC is a cache (it's in the name), which will be evicted by the kernel if memory pressure so requires. Hence, the ARC should not be counted towards a system's total used memory, and should instead be grouped with the other caches in the system. Signed-off-by: edef <edef@edef.eu>
Diffstat (limited to 'linux/Platform.c')
-rw-r--r--linux/Platform.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux/Platform.c b/linux/Platform.c
index 0545fc46..4550097a 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -202,6 +202,8 @@ double Platform_setCPUValues(Meter* this, int cpu) {
void Platform_setMemoryValues(Meter* this) {
ProcessList* pl = (ProcessList*) this->pl;
+ LinuxProcessList* lpl = (LinuxProcessList*) this->pl;
+
long int usedMem = pl->usedMem;
long int buffersMem = pl->buffersMem;
long int cachedMem = pl->cachedMem;
@@ -210,6 +212,11 @@ void Platform_setMemoryValues(Meter* this) {
this->values[0] = usedMem;
this->values[1] = buffersMem;
this->values[2] = cachedMem;
+
+ if (lpl->zfs.enabled != 0) {
+ this->values[0] -= lpl->zfs.size;
+ this->values[2] += lpl->zfs.size;
+ }
}
void Platform_setSwapValues(Meter* this) {

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