Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-02-05 Thread Emilio Cota
On Mon, Jan 30, 2023 at 09:09:47 -1000, Richard Henderson wrote: > On 1/29/23 23:27, Daniel P. Berrangé wrote: > > On Sun, Jan 29, 2023 at 05:38:08PM -0500, Emilio Cota wrote: > > > Since this is a correctness issue, I think we should ship with qtree > > > and use it when configuring with glib

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-30 Thread Richard Henderson
On 1/29/23 23:27, Daniel P. Berrangé wrote: On Sun, Jan 29, 2023 at 05:38:08PM -0500, Emilio Cota wrote: Since this is a correctness issue, I think we should ship with qtree and use it when configuring with glib <2.76.0. For later glib versions we would just use gtree, e.g. via typedef + inline

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-30 Thread Daniel P . Berrangé
On Sun, Jan 29, 2023 at 05:38:08PM -0500, Emilio Cota wrote: > On Wed, Jan 25, 2023 at 15:58:25 +, Daniel P. Berrangé wrote: > > On Wed, Jan 11, 2023 at 12:34:29PM +, Daniel P. Berrangé wrote: > > > On Tue, Jan 10, 2023 at 10:55:36PM -0500, Emilio Cota wrote: > > > > qemu-user can hang in

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-29 Thread Emilio Cota
On Wed, Jan 25, 2023 at 15:58:25 +, Daniel P. Berrangé wrote: > On Wed, Jan 11, 2023 at 12:34:29PM +, Daniel P. Berrangé wrote: > > On Tue, Jan 10, 2023 at 10:55:36PM -0500, Emilio Cota wrote: > > > qemu-user can hang in a multi-threaded fork. One common > > > reason is that when creating

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-29 Thread Emilio Cota
On Wed, Jan 11, 2023 at 12:10:53 +, Daniel P. Berrangé wrote: > On Tue, Jan 10, 2023 at 10:55:36PM -0500, Emilio Cota wrote: > > Performance impact on linux-user: > > - ~2% slowdown in spec06 > > - 1.05% slowdown in Nbench-int > > - 4.51% slowdown in Nbench-fp > > What do you get *before*

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-25 Thread Daniel P . Berrangé
On Wed, Jan 11, 2023 at 12:34:29PM +, Daniel P. Berrangé wrote: > On Tue, Jan 10, 2023 at 10:55:36PM -0500, Emilio Cota wrote: > > qemu-user can hang in a multi-threaded fork. One common > > reason is that when creating a TB, between fork and exec > > we manipulate a GTree whose memory

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-11 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 10:55:36PM -0500, Emilio Cota wrote: > qemu-user can hang in a multi-threaded fork. One common > reason is that when creating a TB, between fork and exec > we manipulate a GTree whose memory allocator (GSlice) is > not fork-safe. BTW, I just checked latest glib status

Re: [PATCH 2/2] tcg: use QTree instead of GTree

2023-01-11 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 10:55:36PM -0500, Emilio Cota wrote: > qemu-user can hang in a multi-threaded fork. One common > reason is that when creating a TB, between fork and exec > we manipulate a GTree whose memory allocator (GSlice) is > not fork-safe. > > Although POSIX does not mandate it, the

[PATCH 2/2] tcg: use QTree instead of GTree

2023-01-10 Thread Emilio Cota
qemu-user can hang in a multi-threaded fork. One common reason is that when creating a TB, between fork and exec we manipulate a GTree whose memory allocator (GSlice) is not fork-safe. Although POSIX does not mandate it, the system's allocator (e.g. tcmalloc, libc malloc) is probably fork-safe.