On Thu, Dec 01, 2022 at 10:49:27 +0000, Alex Bennée wrote: > Emilio Cota <c...@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.hender...@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