public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH ksm-control-daemon] ksmtuned: use PSS instead of RSZ for caluculating memory usage
@ 2024-04-08 13:25 Stefan Lendl
  2024-04-08 15:36 ` [pve-devel] applied: " Thomas Lamprecht
       [not found] ` <bbfc1739-4324-4795-9c97-dc069821c83e@web.de>
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Lendl @ 2024-04-08 13:25 UTC (permalink / raw)
  To: pve-devel

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                      |  1 +
 debian/patches/use-pss-instead-of-rsz.diff | 11 +++++++++++
 2 files changed, 12 insertions(+)
 create mode 100644 debian/patches/use-pss-instead-of-rsz.diff

diff --git a/debian/patches/series b/debian/patches/series
index 24e8678..1bdac37 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -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
index 0000000..885bf30
--- /dev/null
+++ b/debian/patches/use-pss-instead-of-rsz.diff
@@ -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 () {
-- 
2.44.0





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied: [PATCH ksm-control-daemon] ksmtuned: use PSS instead of RSZ for caluculating memory usage
  2024-04-08 13:25 [pve-devel] [PATCH ksm-control-daemon] ksmtuned: use PSS instead of RSZ for caluculating memory usage Stefan Lendl
@ 2024-04-08 15:36 ` Thomas Lamprecht
       [not found] ` <bbfc1739-4324-4795-9c97-dc069821c83e@web.de>
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-04-08 15:36 UTC (permalink / raw)
  To: Proxmox VE development discussion, Stefan Lendl

Am 08/04/2024 um 15:25 schrieb Stefan Lendl:
> 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                      |  1 +
>  debian/patches/use-pss-instead-of-rsz.diff | 11 +++++++++++
>  2 files changed, 12 insertions(+)
>  create mode 100644 debian/patches/use-pss-instead-of-rsz.diff
> 
>

applied, thanks!

I made a follow-up that introduced a `KSM_PS_METRIC` variable which can
be set in `/etc/ksmtuned.conf` to override the metric to something else,
like `rsz` (resident set size) – if e.g. it turns out that for some setups
the PSS one is rather slow.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH ksm-control-daemon] ksmtuned: use PSS instead of RSZ for caluculating memory usage
       [not found] ` <bbfc1739-4324-4795-9c97-dc069821c83e@web.de>
@ 2024-04-17 15:00   ` Thomas Lamprecht
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-04-17 15:00 UTC (permalink / raw)
  To: Roland, Proxmox VE development discussion

Am 11/04/2024 um 12:04 schrieb Roland:
> where arcsize is not taken into account
> 
> https://bugzilla.proxmox.com/show_bug.cgi?id=3859

I think this bug should be split, as those are two completely different
things implementation wise.
The existing one could be kept for RRD, and a new one added for ksmtuned.
For the latter it might be simpler to fix, as we do not have to care about
upgrading some RRD schema in a cluster, which has a few orders of complexity
more compared to checking the ARC on-demand in ksmtuned.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-17 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-08 13:25 [pve-devel] [PATCH ksm-control-daemon] ksmtuned: use PSS instead of RSZ for caluculating memory usage Stefan Lendl
2024-04-08 15:36 ` [pve-devel] applied: " Thomas Lamprecht
     [not found] ` <bbfc1739-4324-4795-9c97-dc069821c83e@web.de>
2024-04-17 15:00   ` [pve-devel] " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal