Am 23.05.25 um 18:37 schrieb Aaron Lauterer: > From: Folke Gleumes <f.gleu...@proxmox.com> > > Expose buffers and cache as separate metrics instead of including them > in memfree and memused. > > Originally-by: Folke Gleumes <f.gleu...@proxmox.com> > [AL: rebased and adapted to changes that happened in the meantime] > Signed-off-by: Aaron Lauterer <a.laute...@proxmox.com> > --- > src/PVE/ProcFSTools.pm | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm > index 185b2b3..91a69be 100644 > --- a/src/PVE/ProcFSTools.pm > +++ b/src/PVE/ProcFSTools.pm > @@ -303,6 +303,8 @@ sub read_meminfo { > memfree => 0, > memavailable => 0, > memused => 0, > + membuffers => 0, > + memcached => 0, > memshared => 0, > swaptotal => 0, > swapfree => 0, > @@ -328,6 +330,8 @@ sub read_meminfo { > # available for a new workload, without pushing the system into swap, no > amount of calculating > # with BUFFER, CACHE, .. will get you there, only the kernel can know > this. > $res->{memused} = $res->{memtotal} - $d->{memavailable}; > + $res->{membuffers} = $d->{buffers}; > + $res->{memcached} = $d->{cached};
Note the comment above the line you add this, which was recently added. After reading would it make more sense to expose memavailable instead? As that, e.g., also includes things like SReclaimable, which can be huge, see [0] for some more background. [0]: https://lore.kernel.org/all/20131107101345.14d7b...@annuminas.surriel.com/#t _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel