From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E3B9093149 for ; Mon, 8 Apr 2024 15:26:40 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C36BDB6A0 for ; Mon, 8 Apr 2024 15:26:40 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 8 Apr 2024 15:26:40 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id CED904409E for ; Mon, 8 Apr 2024 15:26:39 +0200 (CEST) From: Stefan Lendl To: pve-devel@lists.proxmox.com Date: Mon, 8 Apr 2024 15:25:53 +0200 Message-ID: <20240408132552.293049-2-s.lendl@proxmox.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.019 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [ksm-control-scripts.new] Subject: [pve-devel] [PATCH ksm-control-daemon] ksmtuned: use PSS instead of RSZ for caluculating memory usage X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2024 13:26:41 -0000 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 --- 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