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 52099946E5 for ; Fri, 24 Feb 2023 08:13:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2F17A5DD5 for ; Fri, 24 Feb 2023 08:13:05 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 24 Feb 2023 08:13:04 +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 54C1B48479; Fri, 24 Feb 2023 08:13:04 +0100 (CET) Message-ID: <35555eac-5639-2bb0-8ffe-c84789d1ca54@proxmox.com> Date: Fri, 24 Feb 2023 08:12:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 To: "DERUMIER, Alexandre" , Proxmox VE development discussion References: <20230213120021.3783742-1-aderumier@odiso.com> <20230213120021.3783742-16-aderumier@odiso.com> <8edb8da5-04b4-ed25-c56f-9626a2ee259f@proxmox.com> <00eab4f6356c760a55182497eb0ad0bac57bdcb4.camel@groupe-cyllene.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <00eab4f6356c760a55182497eb0ad0bac57bdcb4.camel@groupe-cyllene.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 v4 qemu-server 15/16] memory: virtio-mem : implement redispatch retry. 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, 24 Feb 2023 07:13:35 -0000 Am 23.02.23 um 16:01 schrieb DERUMIER, Alexandre: > >>> +    die "No more available blocks in virtiomem to balance all >>> requested memory\n" >>> +       if $target_total < 0; >> >> I fee like this message is a bit confusing. This can only happen on >> unplug, right? > yes,unplug only. (when guest os set memory block as unmovable). > I don't see case where it doesn't work on hotplug. > >> And reading that "no more blocks are available" sounds >> like a paradox then. It's rather that no more blocks can be >> unplugged. >> >> If we really want to, if the $target_total is negative, we could set >> it >> to 0 (best to do it at the call-side already) and try to unplug >> everything else? We won't reach the goal anymore, but we could still >> get >> closer to it in some cases. > > yes, good idea > >> Would need a bit more adaptation to avoid an >> endless loop: we also need to stop if all devices reached their >> current >> goal this round (and no new errors appeared), e.g. >> balance_virtiomem() >> could just have that info as its return value. >> > > I think we should still die with an error message in this case,(maybe > at the end of balance_virtiomem). We still have some memory not removed > in all cases if target_memory was < 0; > Sure, we still should die at the end. > something like: > > > my sub balance_virtiomem { > my ($vmid, $virtiomems, $blocksize, $target_total) = @_; > > my $nb_virtiomem = scalar(grep { !$_->{error} } values $virtiomems- >> %*); > > print"try to balance memory on $nb_virtiomem virtiomems\n"; > > my $target_total_err = undef; > if($target_total < 0) { > $target_total = 0; > $target_total_err = 1; > } > > ... > while ($total_finished != $nb_virtiomem) { > ... > } > ... > > die "No more virtiomem devices left to try to balance the remaining > memory\n" > if $target_total_err; > } > > Yes, like this we make one final round, which is good enough IMHO.