From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id CFE2C1FF09B for ; Mon, 28 Sep 2026 17:26:24 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 84F23216E1; Mon, 28 Sep 2026 17:26:20 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 28 Sep 2026 17:26:15 +0200 Message-Id: Subject: Re: [PATCH qemu-server] fix #6907: memory: allow multi-digit host nodes with hugepages To: "Michal Fox" , From: "Max R. Carrara" X-Mailer: aerc 0.18.2-0-ge037c095a049 References: <20260926084115.7-1-me@dualfroz.com> In-Reply-To: <20260926084115.7-1-me@dualfroz.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1790609175745 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.349 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: RELRFRZG7CVSEI6X6OLICYN2WU6SLNLI X-Message-ID-Hash: RELRFRZG7CVSEI6X6OLICYN2WU6SLNLI X-MailFrom: m.carrara@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: On Sat Sep 26, 2026 at 10:41 AM CEST, Michal Fox wrote: > When hugepages are enabled, each custom NUMA node must be bound to a > single host node. This was checked with a regex that only accepts a > single digit, so any host node from 10 upwards was rejected with a > misleading "more than 1 hostnode value" error, making hugepages > unusable on hosts with more than ten NUMA nodes. > > Accept any single node number instead. Ranges and lists are still > rejected as before. > > Signed-off-by: Michal Fox > --- Tested this using nested virtualization -- set up a PVE host with 16 sockets with one core each, so that I could get 16 NUMA nodes. Then, set up a plain debian VM with the following config: # cat /etc/pve/qemu-server/100.conf agent: 1 boot: order=3Dscsi0;ide2;net0 cores: 2 hugepages: 2 keephugepages: 1 cpu: host,flags=3D+pdpe1gb memory: 2048 meta: creation-qemu=3D11.0.3,ctime=3D1790606472 name: debian net0: virtio=3DBC:24:11:18:79:1B,bridge=3Dvmbr0,firewall=3D1 numa: 1 numa0: cpus=3D0-1,hostnodes=3D10,memory=3D1024,policy=3Dbind numa1: cpus=3D2-3,hostnodes=3D11,memory=3D1024,policy=3Dbind ostype: l26 scsi0: local-lvm:vm-100-disk-0,discard=3Don,iothread=3D1,size=3D16G,ssd=3D1 scsihw: virtio-scsi-single smbios1: uuid=3D7d0a0af3-812b-47ed-916d-09691c9501d1 sockets: 2 vmgenid: a4e34401-cce7-49b4-b253-1f0e792b2473 Tried to launch the VM before and after applying this patch -- after applying it, the error of the addressed branch indeed does not show up anymore. I still didn't get to actually launch the VM however, since hugepage allocation fails in my case. I did configure hugepages via the kernel cmdline, FYI. Probably something obvious I'm missing here, but anyhow, that's orthogonal to this patch. I checked the surrounding code of this patch as well, and the capture group that is removed is not used anywhere, so we're good in that regard. The scope of that branch is quite narrow too, so I didn't expect any surprises there. Thanks a lot for yet another contribution, it's much appreciated! Since the fix works as advertised, consider: Reviewed-by: Max R. Carrara Tested-by: Max R. Carrara > src/PVE/QemuServer/Memory.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/PVE/QemuServer/Memory.pm b/src/PVE/QemuServer/Memory.pm > index 27738cd9..9b7c24fa 100644 > --- a/src/PVE/QemuServer/Memory.pm > +++ b/src/PVE/QemuServer/Memory.pm > @@ -640,7 +640,7 @@ sub hugepages_topology { > my $hostnodes =3D print_numa_hostnodes($hostnodelists); > > die "more than 1 hostnode value in numa node is not supported wh= en hugepages are enabled" > - if $hostnodes !~ m/^(\d)$/; > + if $hostnodes !~ m/^\d+$/; > my $hugepages_size =3D hugepages_size($conf, $numa_memory); > $hugepages_topology->{$hugepages_size}->{$hostnodes} +=3D > hugepages_nr($numa_memory, $hugepages_size);