From 42ad44d1fea072d23f2e0067bca4ba6bc0b2a523 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 4 Sep 2023 10:57:43 +0200 Subject: Adding upstream version 1.42.2. Signed-off-by: Daniel Baumann --- collectors/proc.plugin/proc_meminfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'collectors/proc.plugin') diff --git a/collectors/proc.plugin/proc_meminfo.c b/collectors/proc.plugin/proc_meminfo.c index cd1ba872c..a357cc782 100644 --- a/collectors/proc.plugin/proc_meminfo.c +++ b/collectors/proc.plugin/proc_meminfo.c @@ -230,7 +230,9 @@ int do_proc_meminfo(int update_every, usec_t dt) { } // http://calimeroteknik.free.fr/blag/?article20/really-used-memory-on-gnu-linux - unsigned long long MemCached = Cached + SReclaimable + KReclaimable - Shmem; + // KReclaimable includes SReclaimable, it was added in kernel v4.20 + unsigned long long reclaimable = KReclaimable > 0 ? KReclaimable : SReclaimable; + unsigned long long MemCached = Cached + reclaimable - Shmem; unsigned long long MemUsed = MemTotal - MemFree - MemCached - Buffers; // The Linux kernel doesn't report ZFS ARC usage as cache memory (the ARC is included in the total used system memory) if (!inside_lxc_container) { -- cgit v1.2.3