mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-11 10:52:43 +00:00
ProcFSTools: fix read_meminfo without KSM
on kernel configs where KSM is not enabled (e.g. an openstack instance at OVH) the file /sys/kernel/mm/ksm/pages_sharing does not exist. In that case there is no memory shared so assuming 0 is reasonable. While this is not the case with our shipped kernel, and thus will probably not happen on a PVE installation, PMG can run quite happily with a different kernel (the reporter had this on an openstack instance at OVH). a quick grep through our codebase showed only the API2::Nodes::Nodeinfo::status call as user of the memshared property. Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This commit is contained in:
parent
890d25d963
commit
9c1ccaf922
@ -249,7 +249,7 @@ sub read_meminfo {
|
||||
$res->{swapfree} = $d->{swapfree};
|
||||
$res->{swapused} = $res->{swaptotal} - $res->{swapfree};
|
||||
|
||||
my $spages = PVE::Tools::file_read_firstline("/sys/kernel/mm/ksm/pages_sharing");
|
||||
my $spages = PVE::Tools::file_read_firstline("/sys/kernel/mm/ksm/pages_sharing") // 0 ;
|
||||
$res->{memshared} = int($spages) * 4096;
|
||||
|
||||
return $res;
|
||||
|
Loading…
Reference in New Issue
Block a user