public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	"DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>,
	"f.ebner@proxmox.com" <f.ebner@proxmox.com>
Subject: Re: [pve-devel] qemu + tcmalloc for rbd
Date: Wed, 10 Jan 2024 15:53:37 +0100	[thread overview]
Message-ID: <b394a911-2842-455c-882b-7b50c81950a3@proxmox.com> (raw)
In-Reply-To: <2f04e8bd5c67726fecb4cba19c5f6bb728837bdc.camel@groupe-cyllene.com>

Am 10/01/2024 um 10:38 schrieb DERUMIER, Alexandre:
>>> Unfortunately, the QEMU patch seems rather hacky and I'd prefer to
>>> not
>>> include and maintain it. If tcmalloc would just provide malloc_trim()
>>> (e.g. as a no-op), there would be no need for the ugly
>>> at-runtime-detection at all.
> ok no problem.
> 
> Note that I don't remember to to have seen problem with a simple
> LD_preload, even if qemu is calling malloc_trim().
> But It's was only benchmark, and not production.

Yeah, because LD_PRELOAD just overrides symbols, but does not
unload libraries or the like.

So when you LD_PRELOAD the tcmalloc.so it will load the malloc
related functions, but as it doesn't ship any malloc_trim()
function (symbol), the one from glibc (which is still present)
will be called, which is useless but probably not that much
extra work as the glibc malloc heap is rather empty anyway.

In the case one builds and links directly against tcmalloc
glibc's malloc is completely out of the picture, so that's why
QEMU added a conflict if both, any of the alternative malloc
implementations and the malloc-trim configure option is enabled.

If we want to expose this dynamically the qemu patch probably
wouldn't be required for above reason anyway (or we could just
ship our tcmalloc, or a separate object, that provides a no-op
malloc_trim() function symbol).




  reply	other threads:[~2024-01-10 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 17:02 DERUMIER, Alexandre
2024-01-10  9:12 ` Fiona Ebner
2024-01-10  9:38   ` DERUMIER, Alexandre
2024-01-10 14:53     ` Thomas Lamprecht [this message]
2024-01-10 10:15   ` Thomas Lamprecht
2024-01-10 18:29     ` DERUMIER, Alexandre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b394a911-2842-455c-882b-7b50c81950a3@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=alexandre.derumier@groupe-cyllene.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal