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 32DAB1FF0B2 for ; Mon, 24 Aug 2026 17:23:00 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EDD602165C; Mon, 24 Aug 2026 17:22:56 +0200 (CEST) Message-ID: <07c68cc8-e6f8-413c-b097-d36faedbebb8@proxmox.com> Date: Mon, 24 Aug 2026 17:22:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH qemu-server v2 2/3] memory: add default NUMA allocation policy To: Maximiliano Sandoval , pve-devel@lists.proxmox.com References: <20260312145423.434537-1-m.sandoval@proxmox.com> <20260312145423.434537-3-m.sandoval@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260312145423.434537-3-m.sandoval@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787584938800 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.822 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: ZA7FKLKK4IF7YUKM44KIBJU7R7W4NQ63 X-Message-ID-Hash: ZA7FKLKK4IF7YUKM44KIBJU7R7W4NQ63 X-MailFrom: f.ebner@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: Am 12.03.26 um 3:54 PM schrieb Maximiliano Sandoval: > This follows the host NUMA policy. This is the default policy in QEMU, > see > https://www.qemu.org/docs/master/interop/qemu-qmp-ref.html#object-QMP-qom.MemoryBackendProperties. The reason we don't allow policy 'default' is that it doesn't work in combination with host-nodes: kvm: host-nodes must be empty for policy default, or you should explicitly specify a policy other than default > > Signed-off-by: Maximiliano Sandoval > --- > src/PVE/QemuServer/Memory.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/src/PVE/QemuServer/Memory.pm b/src/PVE/QemuServer/Memory.pm > index bcf6f9c5..f21b0b8d 100644 > --- a/src/PVE/QemuServer/Memory.pm > +++ b/src/PVE/QemuServer/Memory.pm > @@ -40,11 +40,12 @@ my $numa_fmt = { > }, > policy => { > type => 'string', > - enum => [qw(preferred bind interleave)], > + enum => [qw(default preferred bind interleave)], > description => "NUMA allocation policy.", > verbose_description => < NUMA allocation policy. Possible values are: > > + - default: default host policy > - preferred: prefer the given host node list for allocation > - bind: restrict memory allocation to the given host node list > - interleave: interleave memory allocations across the given host node list > @@ -53,6 +54,7 @@ The models are explained in more details at the kernel's documentation > https://docs.kernel.org/admin-guide/mm/numa_memory_policy.html#components-of-memory-policies. > EODESC > optional => 1, > + default => 'default', > }, > }; > PVE::JSONSchema::register_format('pve-qm-numanode', $numa_fmt); > @@ -450,8 +452,7 @@ sub config { > my $hostnodes = print_numa_hostnodes($hostnodelists); > > # policy > - my $policy = $numa->{policy}; > - die "you need to define a policy for hostnode $hostnodes\n" if !$policy; > + my $policy = $numa->{policy} // $numa_fmt->{policy}->{default}; > $mem_object .= ",host-nodes=$hostnodes,policy=$policy"; > } else { > die "numa hostnodes need to be defined to use hugepages" if $conf->{hugepages};