From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2A02C1FF13F for ; Thu, 12 Mar 2026 15:55:39 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8067D1D1AE; Thu, 12 Mar 2026 15:55:35 +0100 (CET) From: Maximiliano Sandoval To: Dominik Csapak Subject: superseded: [PATCH qemu-server 2/2] memory: add default numa allocation policy In-Reply-To: <2d0c20dd-5870-43cc-9849-b2180bce94bf@proxmox.com> (Dominik Csapak's message of "Thu, 12 Mar 2026 15:43:07 +0100") References: <20260312105044.191421-1-m.sandoval@proxmox.com> <20260312105044.191421-3-m.sandoval@proxmox.com> <855dc01d-7612-415a-9be8-79bd873ad288@proxmox.com> <2d0c20dd-5870-43cc-9849-b2180bce94bf@proxmox.com> User-Agent: mu4e 1.12.9; emacs 30.1 Date: Thu, 12 Mar 2026 15:55:31 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773327295160 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.108 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) 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: J7ZBTAYFSJ7I4H4EKD46BLQV2DFGNND7 X-Message-ID-Hash: J7ZBTAYFSJ7I4H4EKD46BLQV2DFGNND7 X-MailFrom: m.sandoval@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 CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Dominik Csapak writes: > On 3/12/26 3:39 PM, Maximiliano Sandoval wrote: >> Dominik Csapak writes: >> >>> just for clarity: was this requested or did you just notice that it was missing? >> I noticed a while ago it was missing and never went around to fix it. >> Clarification was also requested a couple of times in enterprise >> support. > > ok > >> >>> On 3/12/26 11:50 AM, Maximiliano Sandoval wrote: >>>> This follows the host numa policy. >>>> 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..9e65b2b0 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} // 'default'; >>> >>> while the property itself was already optional (since it was only required when >>> the hostnodes were given) when we add this >>> we should mark 'default' as the default in the schema. >> This was set as a default a couple of lines above, is this what you >> meant? > > ahh oops, i did not see that, then disregard these comments here ;) > >> >>> >>> otherwise we could keep this check here and not set a default. >>> >> I will send a v2 where instead of `// 'default'` one checks for the >> default value in the schema. > > no IMO it's fine as it is, just wanted to give an alternative to setting > the default, but since you did that already that's not necessary. > >> >>>> $mem_object .= ",host-nodes=$hostnodes,policy=$policy"; >>>> } else { >>>> die "numa hostnodes need to be defined to use hugepages" if $conf->{hugepages}; >> Superseded-by: https://lore.proxmox.com/all/20260312145423.434537-1-m.sandoval@proxmox.com/T/#u -- Maximiliano