[pve-devel] [PATCH qemu-server v2 3/4] vmstatus: switch mem stat to PSS of VM cgroup

Aaron Lauterer a.lauterer at proxmox.com
Wed Jul 9 18:37:00 CEST 2025


Instead of RSS, let's use the same PSS values as for the specific host
view as default, in case this value is not overwritten by the balloon
info.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 src/PVE/QemuServer.pm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 4dd30c4..22172ea 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -2635,10 +2635,6 @@ sub vmstatus {
 
         $d->{uptime} = int(($uptime - $pstat->{starttime}) / $cpuinfo->{user_hz});
 
-        if ($pstat->{vsize}) {
-            $d->{mem} = int(($pstat->{rss} / $pstat->{vsize}) * $d->{maxmem});
-        }
-
         my $old = $last_proc_pid_stat->{$pid};
         if (!$old) {
             $last_proc_pid_stat->{$pid} = {
@@ -2689,6 +2685,8 @@ sub vmstatus {
             }
         }
         close($fh);
+
+        $d->{mem} = $d->{memhost};
     }
 
     return $res if !$full;
-- 
2.39.5





More information about the pve-devel mailing list