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 21CA9921DC for ; Mon, 13 Mar 2023 18:09:19 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 00690F5A2 for ; Mon, 13 Mar 2023 18:09:18 +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 ; Mon, 13 Mar 2023 18:09:17 +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 74763427DE; Mon, 13 Mar 2023 18:09:17 +0100 (CET) Message-ID: Date: Mon, 13 Mar 2023 18:09:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:111.0) Gecko/20100101 Thunderbird/111.0 Content-Language: de-AT, de-DE, en-GB To: Proxmox VE development discussion , Alexandre Derumier References: <20230313101600.1041713-1-aderumier@odiso.com> From: Thomas Lamprecht In-Reply-To: <20230313101600.1041713-1-aderumier@odiso.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.049 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.001 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 qemu-server] qemu options: add memory_allocator 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: Mon, 13 Mar 2023 17:09:19 -0000 Am 13/03/2023 um 11:16 schrieb Alexandre Derumier: > Add optional memory_allocator. > > Default is glibc malloc, tcmalloc is available to improve performance > of ceph librbd. Looks ok besides some config/api schema details I'd like to see changed. > > Signed-off-by: Alexandre Derumier > --- > PVE/QemuServer.pm | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 40be44d..8de6c82 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -723,6 +723,14 @@ EODESCR > description => "List of host cores used to execute guest processes, for example: 0,5,8-11", > optional => 1, > }, > + memory_allocator => { kebab-case for new properties please, but actually I'd like to have this nested in a property string here, e.g.: tuning => { optional => 1, type => 'string', format => { # <- probably in a $tuning_format variable allocator => { # ... }, } } > + optional => 1, > + type => 'string', > + enum => [ qw(glibc tcmalloc) ], system tcmalloc > + default => 'glibc', > + description => "Configure qemu process memory allocator. tcmalloc improve performance of ceph librbd", I'd change this to: description => "Override the memory allocator used in QEMU via LD_PRELOAD.", verbose_description => "Override the memory allocator used in QEMU via LD_PRELOAD." ." Using tcmalloc might improve performance if ceph librbd is used.", ." NOTE: you must install the libtcmalloc-minimal4 package first!" > + optional => 1, you got "optional" set to true twice > + }, > }; > > my $cicustom_fmt = { > @@ -5909,6 +5917,10 @@ sub vm_start_nolock { > > my $run_qemu = sub { > PVE::Tools::run_fork sub { > + > + $ENV{LD_PRELOAD} = "/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4" > + if $conf->{memory_allocator} && $conf->{memory_allocator} eq 'tcmalloc'; > + > PVE::Systemd::enter_systemd_scope($vmid, "Proxmox VE VM $vmid", %systemd_properties); > > my $tpmpid;