[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock |
Date: |
Wed, 3 Oct 2018 14:07:31 -0400 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Wed, Oct 03, 2018 at 19:05:51 +0200, Paolo Bonzini wrote:
> On 03/10/2018 19:02, Emilio G. Cota wrote:
> >> For reads I agree, but you may actually get a torn read if the writer
> >> doesn't use atomic_set.
> >
> > But you cannot get a torn read if all reads that don't hold the lock
> > are coming from the same thread that performed the write.
>
> Ah, so you are relying on copy_tlb_helper(_locked) being invoked only
> from the vCPU thread (as opposed to someone else doing tlb_flush)?
Yes. tlb_flush_nocheck is always run by the owner thread--tlb_flush
checks for this, and if !qemu_cpu_is_self(cpu) then it schedules
async work on the owner thread.
> Maybe it's worth adding a comment if that's what I missed.
I'll send a v2 with an updated comment and a debug-only assert
in the copy helper.
Thanks,
E.
- [Qemu-devel] [PATCH 0/3] per-TLB lock, Emilio G. Cota, 2018/10/02
- [Qemu-devel] [PATCH 3/3] cputlb: read CPUTLBEntry.addr_write atomically, Emilio G. Cota, 2018/10/02
- [Qemu-devel] [PATCH 1/3] exec: introduce tlb_init, Emilio G. Cota, 2018/10/02
- [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock, Emilio G. Cota, 2018/10/02
- Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock, Alex Bennée, 2018/10/03
- Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock, Paolo Bonzini, 2018/10/03
- Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock, Emilio G. Cota, 2018/10/03
- Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock, Paolo Bonzini, 2018/10/03
- Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock, Emilio G. Cota, 2018/10/03
- Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock, Paolo Bonzini, 2018/10/03
- Re: [Qemu-devel] [PATCH 2/3] cputlb: serialize tlb updates with env->tlb_lock,
Emilio G. Cota <=
Re: [Qemu-devel] [PATCH 0/3] per-TLB lock, Paolo Bonzini, 2018/10/03