diff options
author | Benny Baumann <BenBE@geshi.org> | 2022-05-29 21:10:26 +0200 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2022-05-30 07:50:57 +0200 |
commit | c0a9e92eeaf53c53ca806f0ffa75a75c8a912e48 (patch) | |
tree | 0c0130933a0ef4704bbb9534f2f72206e677c1ee /freebsd | |
parent | 491c6f1044630a4134393ef91df8bcf387ae5268 (diff) |
Implement FreeBSD support for minimum ZFS ARC size
Diffstat (limited to 'freebsd')
-rw-r--r-- | freebsd/Platform.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/freebsd/Platform.c b/freebsd/Platform.c index d21fc807..1a731b71 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -227,6 +227,7 @@ double Platform_setCPUValues(Meter* this, unsigned int cpu) { void Platform_setMemoryValues(Meter* this) { const ProcessList* pl = this->pl; + const FreeBSDProcessList* fpl = (const FreeBSDProcessList*) pl; this->total = pl->totalMem; this->values[0] = pl->usedMem; @@ -234,6 +235,16 @@ void Platform_setMemoryValues(Meter* this) { // this->values[2] = "shared memory, like tmpfs and shm" this->values[3] = pl->cachedMem; // this->values[4] = "available memory" + + if (fpl->zfs.enabled) { + // ZFS does not shrink below the value of zfs_arc_min. + unsigned long long int shrinkableSize = 0; + if (fpl->zfs.size > fpl->zfs.min) + shrinkableSize = fpl->zfs.size - fpl->zfs.min; + this->values[0] -= shrinkableSize; + this->values[3] += shrinkableSize; + // this->values[4] += shrinkableSize; + } } void Platform_setSwapValues(Meter* this) { |