* [PATCH qemu-server] fix #6907: memory: allow multi-digit host nodes with hugepages
@ 2026-09-26 8:41 Michal Fox
2026-09-28 15:26 ` Max R. Carrara
0 siblings, 1 reply; 2+ messages in thread
From: Michal Fox @ 2026-09-26 8:41 UTC (permalink / raw)
To: pve-devel
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 <me@dualfroz.com>
---
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 = print_numa_hostnodes($hostnodelists);
die "more than 1 hostnode value in numa node is not supported when hugepages are enabled"
- if $hostnodes !~ m/^(\d)$/;
+ if $hostnodes !~ m/^\d+$/;
my $hugepages_size = hugepages_size($conf, $numa_memory);
$hugepages_topology->{$hugepages_size}->{$hostnodes} +=
hugepages_nr($numa_memory, $hugepages_size);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH qemu-server] fix #6907: memory: allow multi-digit host nodes with hugepages
2026-09-26 8:41 [PATCH qemu-server] fix #6907: memory: allow multi-digit host nodes with hugepages Michal Fox
@ 2026-09-28 15:26 ` Max R. Carrara
0 siblings, 0 replies; 2+ messages in thread
From: Max R. Carrara @ 2026-09-28 15:26 UTC (permalink / raw)
To: Michal Fox, pve-devel
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 <me@dualfroz.com>
> ---
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=scsi0;ide2;net0
cores: 2
hugepages: 2
keephugepages: 1
cpu: host,flags=+pdpe1gb
memory: 2048
meta: creation-qemu=11.0.3,ctime=1790606472
name: debian
net0: virtio=BC:24:11:18:79:1B,bridge=vmbr0,firewall=1
numa: 1
numa0: cpus=0-1,hostnodes=10,memory=1024,policy=bind
numa1: cpus=2-3,hostnodes=11,memory=1024,policy=bind
ostype: l26
scsi0: local-lvm:vm-100-disk-0,discard=on,iothread=1,size=16G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=7d0a0af3-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 <m.carrara@proxmox.com>
Tested-by: Max R. Carrara <m.carrara@proxmox.com>
> 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 = print_numa_hostnodes($hostnodelists);
>
> die "more than 1 hostnode value in numa node is not supported when hugepages are enabled"
> - if $hostnodes !~ m/^(\d)$/;
> + if $hostnodes !~ m/^\d+$/;
> my $hugepages_size = hugepages_size($conf, $numa_memory);
> $hugepages_topology->{$hugepages_size}->{$hostnodes} +=
> hugepages_nr($numa_memory, $hugepages_size);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-28 15:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-26 8:41 [PATCH qemu-server] fix #6907: memory: allow multi-digit host nodes with hugepages Michal Fox
2026-09-28 15:26 ` Max R. Carrara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox