all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH common] procfstools: meminfo: handle ksm info not being readable
@ 2026-02-20 14:09 Stoiko Ivanov
  2026-02-24 13:47 ` applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2026-02-20 14:09 UTC (permalink / raw)
  To: pve-devel

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 <f.gruenbichler@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 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





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

* applied: [PATCH common] procfstools: meminfo: handle ksm info not being readable
  2026-02-20 14:09 [PATCH common] procfstools: meminfo: handle ksm info not being readable Stoiko Ivanov
@ 2026-02-24 13:47 ` Fabian Grünbichler
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2026-02-24 13:47 UTC (permalink / raw)
  To: pve-devel, Stoiko Ivanov


On Fri, 20 Feb 2026 15:09:30 +0100, Stoiko Ivanov wrote:
> 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`.
> 
> [...]

Applied, thanks!

[1/1] procfstools: meminfo: handle ksm info not being readable
      commit: 8b92ff20eca78620873e2a4e97dbc17ed7ee82cb

Best regards,
-- 
Fabian Grünbichler <f.gruenbichler@proxmox.com>




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

end of thread, other threads:[~2026-02-24 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-20 14:09 [PATCH common] procfstools: meminfo: handle ksm info not being readable Stoiko Ivanov
2026-02-24 13:47 ` applied: " Fabian Grünbichler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal