Re: [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock

2015-09-04 Thread Paolo Bonzini
On 04/09/2015 10:50, Paolo Bonzini wrote: > Having now reviewed the patch, I think we can do better. > > The idea is: > > - only the CPU thread can set cpu->tb_jmp_cache[] > > - other threads can, under seqlock protection, _clear_ cpu->tb_jmp_cache[] > > - the seqlock can be protected by tb_l

Re: [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock

2015-09-04 Thread Paolo Bonzini
On 24/08/2015 02:23, Emilio G. Cota wrote: > This paves the way for a lockless tb_find_fast. Having now reviewed the patch, I think we can do better. The idea is: - only the CPU thread can set cpu->tb_jmp_cache[] - other threads can, under seqlock protection, _clear_ cpu->tb_jmp_cache[] - th

Re: [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock

2015-08-25 Thread Paolo Bonzini
> The seqlock for tb_jmp_cache is necessary the moment that the > array can be wiped out with a memset(), as shown above. That > function (tb_flush_jmp_cache) is called by tlb_flush_page, > which has many callers. > > One could argue that we could enforce calling tlb_flush_page to be > a) always d

Re: [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock

2015-08-25 Thread Emilio G. Cota
On Sun, Aug 23, 2015 at 18:14:58 -0700, Paolo Bonzini wrote: > On 23/08/2015 17:23, Emilio G. Cota wrote: > > This paves the way for a lockless tb_find_fast. > > > > Signed-off-by: Emilio G. Cota > > --- (snip) > > @@ -1707,12 +1735,14 @@ void tb_flush_jmp_cache(CPUState *cpu, target_ulong > > a

Re: [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock

2015-08-24 Thread Paolo Bonzini
On 23/08/2015 17:23, Emilio G. Cota wrote: > This paves the way for a lockless tb_find_fast. > > Signed-off-by: Emilio G. Cota > --- > cpu-exec.c| 8 +++- > exec.c| 2 ++ > include/qom/cpu.h | 15 +++ > qom/cpu.c | 2 +- > translate-all.c | 32 +

[Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock

2015-08-24 Thread Emilio G. Cota
This paves the way for a lockless tb_find_fast. Signed-off-by: Emilio G. Cota --- cpu-exec.c| 8 +++- exec.c| 2 ++ include/qom/cpu.h | 15 +++ qom/cpu.c | 2 +- translate-all.c | 32 +++- 5 files changed, 56 insertions