From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 3E345906CE for ; Fri, 3 Feb 2023 14:46:13 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2040653AC for ; Fri, 3 Feb 2023 14:45:43 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 3 Feb 2023 14:45:42 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6AC04452D7; Fri, 3 Feb 2023 14:45:42 +0100 (CET) Message-ID: Date: Fri, 3 Feb 2023 14:45:41 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 From: Fiona Ebner To: pve-devel@lists.proxmox.com, "aderumier@odiso.com" References: <20230202110344.840195-1-aderumier@odiso.com> <20230202110344.840195-10-aderumier@odiso.com> Content-Language: en-US In-Reply-To: <20230202110344.840195-10-aderumier@odiso.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.042 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.09 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v3 qemu-server 09/13] memory: use 64 slots && static dimm size when max is defined X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Feb 2023 13:46:13 -0000 Am 02.02.23 um 12:03 schrieb Alexandre Derumier: > @@ -179,17 +185,17 @@ sub get_numa_guest_to_host_map { > } > > sub foreach_dimm{ > - my ($conf, $vmid, $memory, $sockets, $func) = @_; > + my ($conf, $vmid, $memory, $current_size, $func) = @_; The parameter should not be called $current_size if you pass in $static_memory (they're only the same value if nothing is yet hotplugged). It's also not nice to use parameters as local variables. Renaming the parameter to $static_memory and doing my $current_size = $static_memory; is cleaner. I know I'm saying this often, but changing the argument here should be its own patch. It has nothing to do with 'max'. > > my $dimm_id = 0; > - my $current_size = 0; > my $dimm_size = 0; > > - if($conf->{hugepages} && $conf->{hugepages} == 1024) { > - $current_size = 1024 * $sockets; > + my $confmem = parse_memory($conf->{memory}); > + if ($confmem->{max}) { > + $dimm_size = $confmem->{max} / $MAX_SLOTS; > + } elsif($conf->{hugepages} && $conf->{hugepages} == 1024) { > $dimm_size = 1024; > } else { > - $current_size = 1024; > $dimm_size = 512; > } >