From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 6E65A1FF0C2 for ; Thu, 03 Dec 2026 12:34:13 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BB29021710; Thu, 03 Dec 2026 12:34:10 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 03 Dec 2026 12:34:05 +0100 Message-Id: Subject: Re: [PATCH qemu-server v6 4/5] memory: unify NUMA config parsing and resolution From: "Elias Huhsovitz" To: "Elias Huhsovitz" , X-Mailer: aerc 0.20.0 References: <20261203105300.70656-1-e.huhsovitz@proxmox.com> <20261203105300.70656-5-e.huhsovitz@proxmox.com> In-Reply-To: <20261203105300.70656-5-e.huhsovitz@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1796297645522 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.385 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: 5K74UMM75K5RIBCDVLJ5G545OMZEYSQA X-Message-ID-Hash: 5K74UMM75K5RIBCDVLJ5G545OMZEYSQA X-MailFrom: e.huhsovitz@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: I forgot to include a patch that fixes the test cases. Here is the diff that is missing: diff --git a/src/test/cfg2cmd/memory-numa-custom.conf.cmd b/src/test/cfg2cm= d/memory-numa-custom.conf.cmd index c20ff94a..86c9b773 100644 --- a/src/test/cfg2cmd/memory-numa-custom.conf.cmd +++ b/src/test/cfg2cmd/memory-numa-custom.conf.cmd @@ -18,7 +18,7 @@ -object 'memory-backend-ram,id=3Dram-node0,size=3D1024M' \ -numa 'node,nodeid=3D0,cpus=3D0-1,memdev=3Dram-node0' \ -object 'memory-backend-ram,id=3Dram-node1,size=3D1024M' \ - -numa 'node,nodeid=3D1,cpus=3D2,cpus=3D3,memdev=3Dram-node1' \ + -numa 'node,nodeid=3D1,cpus=3D2-3,memdev=3Dram-node1' \ -global 'PIIX4_PM.disable_s3=3D1' \ -global 'PIIX4_PM.disable_s4=3D1' \ -device 'pci-bridge,id=3Dpci.1,chassis_nr=3D1,bus=3Dpci.0,addr=3D0x1e' \ diff --git a/src/test/run_memory_tests.pl b/src/test/run_memory_tests.pl index 90f6a1bb..d9a6598d 100755 --- a/src/test/run_memory_tests.pl +++ b/src/test/run_memory_tests.pl @@ -18,12 +18,12 @@ my $tests =3D [ ['0', '0', 1], ['9', '9', 1], ['10', '10', 1], - ['0;1', '0,1', 0], + ['0;1', '0-1', 0], ['0;10', '0,10', 0], - ['0;1;10', '0,1,10', 0], - ['1;2', '1,2', 0], + ['0;1;10', '0-1,10', 0], + ['1;2', '1-2', 0], ['0-1', '0-1', 0], - ['0;1-2', '0,1-2', 0], + ['0;1-2', '0-2', 0], ]; for my $test (@$tests) { @@ -40,7 +40,7 @@ for my $test (@$tests) { }; # Without hugepages, multi-node bindings are valid; inspect the pa= rsed set. - my $nodes =3D PVE::QemuServer::Memory::get_effective_numa_cfg($bas= e_conf, 1, 1, 1024, 1); + my $nodes =3D PVE::QemuServer::Memory::get_effective_numa_cfg($bas= e_conf, 1024, 1); is( $nodes->[0]->{hostnodes}->short_string(), $expected, On Thu Dec 3, 2026 at 11:52 AM CET, Elias Huhsovitz wrote: > Currently NUMA configuration is read and interpreted at each call site. > Validation is scattered across differente paths, leading to inconsistent > rules when enabling NUMA with different additional options, such as > hugepages or memory hotplug. > > Introduce a single resolver, `get_effective_numa_cfg()`, that parses all > custom numa[N] entries, auto-completes omitted memory and CPU > assignments, generates a default topology when none is configured, and > validates the result in one place . All three call sites now consume the > resolved node list instead of re-parsing the raw config. > > As a side effect, users may now under-specify their NUMA config: omitted > memory values are distributed across the remaining nodes, and a fully > omitted CPU assignment is derived from sockets and cores. > > Signed-off-by: Elias Huhsovitz