From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id F40A01FF13E for ; Fri, 20 Feb 2026 15:08:51 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 549DCAB53; Fri, 20 Feb 2026 15:09:42 +0100 (CET) From: Stoiko Ivanov To: pve-devel@lists.proxmox.com Subject: [PATCH common] procfstools: meminfo: handle ksm info not being readable Date: Fri, 20 Feb 2026 15:09:30 +0100 Message-ID: <20260220140932.472867-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1771596567785 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.068 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: UERNXZZIO7BINW5FZHB2TM3425R45QL6 X-Message-ID-Hash: UERNXZZIO7BINW5FZHB2TM3425R45QL6 X-MailFrom: s.ivanov@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: in certain restricted envrironments, e.g. `sbuild` /sys/kernel/mm/ksm/pages_sharing is present but not readable. pmg-api relies on memtotal to compute the maximal number of processes to start in PMG::Config, and this computation is triggered while building the man-pages. This results in a failure while building with `sbuild`. The change follows a commit which addressed running pmg with a kernel that does not have KSM enabled: 9c1ccaf (ProcFSTools: fix read_meminfo without KSM) The issue was (last) reported by Fabian, with a diff for pmg-api as workaround. Tested by building a libpve-common-perl package with a higher version than what's available in our repositories and including it when running mmdebstrap with `--hook-dir=/usr/share/mmdebstrap/hooks/file-mirror-automount` and afterwards building pmg-api with `make sbuild` Suggested-by: Fabian Grünbichler Signed-off-by: Stoiko Ivanov --- src/PVE/ProcFSTools.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm index 18a159d..726248f 100644 --- a/src/PVE/ProcFSTools.pm +++ b/src/PVE/ProcFSTools.pm @@ -352,7 +352,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") // 0; + my $spages = eval { PVE::Tools::file_read_firstline("/sys/kernel/mm/ksm/pages_sharing") } // 0; $res->{memshared} = int($spages) * 4096; my $arc_stats = eval { PVE::Tools::file_get_contents("/proc/spl/kstat/zfs/arcstats") }; -- 2.47.3