5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-06 21:17:37 +03:00

fix #1454: meminfo: also return arcsize

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
This commit is contained in:
Matthias Heiserer 2023-03-28 14:49:26 +02:00 committed by Thomas Lamprecht
parent 8ebb0f82ac
commit b21af8f501

View File

@ -283,6 +283,7 @@ sub read_meminfo {
swaptotal => 0,
swapfree => 0,
swapused => 0,
arcsize => 0,
};
my $fh = IO::File->new ("/proc/meminfo", "r");
@ -307,6 +308,11 @@ sub read_meminfo {
my $spages = PVE::Tools::file_read_firstline("/sys/kernel/mm/ksm/pages_sharing") // 0 ;
$res->{memshared} = int($spages) * 4096;
my $arcstats = PVE::Tools::file_get_contents("/proc/spl/kstat/zfs/arcstats");
if ($arcstats && $arcstats =~ m/size\s+\d+\s+(\d+)/m) {
$res->{arcsize} = int ($1);
}
return $res;
}