qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Emilio Cota <cota@braap.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org, "Laurent Vivier" <laurent@vivier.eu>,
	ncopa@alpinelinux.org, "Kyle Evans" <kevans@freebsd.org>,
	"Warner Losh" <imp@bsdimp.com>,
	"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: [PATCH] linux-user,bsd-user: re-exec with G_SLICE=always-malloc
Date: Tue, 10 Jan 2023 23:01:50 -0500	[thread overview]
Message-ID: <Y740rpN1VLMV64Vp@cota-l14> (raw)
In-Reply-To: <87cz93cpum.fsf@linaro.org>

On Thu, Dec 01, 2022 at 10:49:27 +0000, Alex Bennée wrote:
> Emilio Cota <cota@braap.org> writes:
> > On Tue, Oct 04, 2022 at 13:00:47 +0100, Daniel P. Berrangé wrote:
> > (snip)
> >> Can't say I especially like this but I'm out of other ideas for how
> >> to guarantee a solution. Users can't set env vars prior to launching
> >> QEMU user emulators when using binfmt.
> >
> > An alternative is to not use GSlice between fork/exec. I'm
> > not sure if within that region there are other users besides
> > GTree (GArray perhaps?), but if there aren't, then just using
> > a different binary tree implementation should do.
> 
> Hmm my distros version of GArray certainly does and that is used quite
> heavily across gdbstub and plugins.

Then we might have to also import a GSlice-free GArray ("QArray").
Currently we just deadlock on POSIX-compliant code, which is
unacceptable.

> > Untested patches using ccan's AVL tree: 
> >   https://github.com/cota/qemu/commits/avl
> >
> > Would that be more palatable?
> 
> I think generally we wouldn't want to have multiple implementations
> unless there was a definite benefit (c.f. QHT). That said I think
> Richard's latest optimisation work:
> 
>   Subject: [PATCH v2 0/7] accel/tcg: Rewrite user-only vma tracking
>   Date: Thu, 27 Oct 2022 22:12:51 +1100
>   Message-Id: <20221027111258.348196-1-richard.henderson@linaro.org>
> 
> brings in the kernel's interval tree (with unit tests). I wonder if the
> page_collection use of GTree could be converted to that?

Thanks. I looked into reusing this but I don't think it's a drop-in
replacement for GTree.

> I don't know how you would defend against re-introducing it into
> linux-user though aside from commentary.

To close the loop:
I've sent a patch series that imports GTree-sans-GSlice as QTree,
and uses that for TCG:
  https://lists.gnu.org/archive/html/qemu-devel/2023-01/msg02080.html

Thanks,
		Emilio


      reply	other threads:[~2023-01-29 22:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 12:00 [PATCH] linux-user,bsd-user: re-exec with G_SLICE=always-malloc Daniel P. Berrangé
2022-10-04 12:05 ` Peter Maydell
2022-10-04 14:59 ` Richard Henderson
2022-10-06 18:12   ` Daniel P. Berrangé
2022-10-06 18:29     ` Richard Henderson
2022-10-06 18:49       ` Kyle Evans
2022-12-01  6:55 ` Emilio Cota
2022-12-01 10:49   ` Alex Bennée
2023-01-11  4:01     ` Emilio Cota [this message]

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=Y740rpN1VLMV64Vp@cota-l14 \
    --to=cota@braap.org \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=imp@bsdimp.com \
    --cc=kevans@freebsd.org \
    --cc=laurent@vivier.eu \
    --cc=ncopa@alpinelinux.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).