Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-11 Thread Paolo Bonzini
On 11/07/2017 00:13, Emilio G. Cota wrote: > On Mon, Jul 10, 2017 at 17:33:07 -0400, Paolo Bonzini wrote: >> >>> I agree that it would be nice to have the same mechanism for all. >>> >>> The main hurdle I see is how to allow for concurrent code generation while >>> minimizing flushes of the single,

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-10 Thread Emilio G. Cota
On Mon, Jul 10, 2017 at 17:33:07 -0400, Paolo Bonzini wrote: > > > I agree that it would be nice to have the same mechanism for all. > > > > The main hurdle I see is how to allow for concurrent code generation while > > minimizing flushes of the single, fixed-size[*] code_gen_buffer. > > In user-

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-10 Thread Paolo Bonzini
> I agree that it would be nice to have the same mechanism for all. > > The main hurdle I see is how to allow for concurrent code generation while > minimizing flushes of the single, fixed-size[*] code_gen_buffer. > In user-mode this is tricky because there is no way to bound the number > of thre

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-10 Thread Emilio G. Cota
On Mon, Jul 10, 2017 at 14:05:01 +0200, Paolo Bonzini wrote: > On 09/07/2017 09:50, Emilio G. Cota wrote: > > User-mode is kept out of this: contention due to concurrent translation > > is more commonly found in full-system mode. > > Out of curiosity, is it harder or you just didn't try? It would

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-10 Thread Paolo Bonzini
On 09/07/2017 09:50, Emilio G. Cota wrote: > User-mode is kept out of this: contention due to concurrent translation > is more commonly found in full-system mode. Out of curiosity, is it harder or you just didn't try? It would be nice if the commit message mentioned the problems (if any) in addit

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-09 Thread Emilio G. Cota
On Sun, Jul 09, 2017 at 11:48:53 -1000, Richard Henderson wrote: > On 07/09/2017 11:29 AM, Emilio G. Cota wrote: (snip) > >Exactly. Also, in user-mode "vCPU threads" (i.e. host threads) come and > >go all the time, so this doesn't work well with having a single > >code_gen_buffer, which I assumed w

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-09 Thread Richard Henderson
On 07/09/2017 11:29 AM, Emilio G. Cota wrote: On Sun, Jul 09, 2017 at 11:19:37 -1000, Richard Henderson wrote: On 07/08/2017 09:50 PM, Emilio G. Cota wrote: This allows us to generate TCG code in parallel. MTTCG already uses it, although the next commit pushes down a lock to actually perform pa

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-09 Thread Emilio G. Cota
On Sun, Jul 09, 2017 at 11:19:37 -1000, Richard Henderson wrote: > On 07/08/2017 09:50 PM, Emilio G. Cota wrote: > >This allows us to generate TCG code in parallel. MTTCG already uses > >it, although the next commit pushes down a lock to actually > >perform parallel generation. > > > >User-mode is

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-09 Thread Richard Henderson
On 07/08/2017 09:50 PM, Emilio G. Cota wrote: This allows us to generate TCG code in parallel. MTTCG already uses it, although the next commit pushes down a lock to actually perform parallel generation. User-mode is kept out of this: contention due to concurrent translation is more commonly foun

Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-09 Thread Richard Henderson
On 07/08/2017 09:50 PM, Emilio G. Cota wrote: I was not sure about tci_regs. From code inspection it seems that they have to be per-thread, so I converted them, but I do not think anyone has ever tried to get MTTCG working with TCI. Yes, those should be per-thread. Really, they should be on th

[Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu

2017-07-09 Thread Emilio G. Cota
This allows us to generate TCG code in parallel. MTTCG already uses it, although the next commit pushes down a lock to actually perform parallel generation. User-mode is kept out of this: contention due to concurrent translation is more commonly found in full-system mode. This patch is fairly sma