]> git.proxmox.com Git - ksm-control-daemon.git/commitdiff
ksmtuned: use PSS instead of RSZ for caluculating memory usage
authorStefan Lendl <s.lendl@proxmox.com>
Mon, 8 Apr 2024 13:25:53 +0000 (15:25 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 8 Apr 2024 14:17:54 +0000 (16:17 +0200)
PSS properly accounts for memory usage of shared libraries and is
therefore better suited when summing up memory usage of multiple
processes.

Signed-off-by: Stefan Lendl <s.lendl@proxmox.com>
debian/patches/series
debian/patches/use-pss-instead-of-rsz.diff [new file with mode: 0644]

index 24e86782786f30c8af1a53c108f90daf5860ca5f..1bdac377bfe57ae035e1363b1bad731da4307f85 100644 (file)
@@ -2,3 +2,4 @@ init-script.diff
 ksmtuned.diff
 adjust-ksm-slepp.diff
 awk-printf.diff
+use-pss-instead-of-rsz.diff
diff --git a/debian/patches/use-pss-instead-of-rsz.diff b/debian/patches/use-pss-instead-of-rsz.diff
new file mode 100644 (file)
index 0000000..885bf30
--- /dev/null
@@ -0,0 +1,11 @@
+--- ksm-control-scripts/ksmtuned       2024-04-08 15:10:04.218449486 +0200
++++ ksm-control-scripts.new/ksmtuned   2024-04-08 15:10:16.214620527 +0200
+@@ -72,7 +72,7 @@
+     # calculate how much memory is committed to running qemu processes
+     local progname
+     progname=${1:-kvm}
+-    ps -C "$progname" -o rsz | awk '{ sum += $1 }; END { printf ("%.0f", sum) }'
++    ps -C "$progname" -o pss= | awk '{ sum += $1 }; END { printf ("%.0f", sum) }'
+ }
+ free_memory () {