[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock |
Date: |
Tue, 25 Aug 2015 18:49:54 -0400 (EDT) |
> 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 done by the owner thread or b) done while all others CPUs
> are paused.
>
> I argue that worrying about that is not worth it; let's protect
> the array with a seqlock, which on TSO is essentially free, and
> worry about more important things.
Got it, this makes sense.
Paolo
> Wrt the next two patches:
>
> Patch 27 is an improvement in that each TB has its own valid flag,
> which makes sense because this should only affect TB's that are
> trying to chain to/from it, not all TBs.
>
> Patch 28 uses the RCU QLIST which to me seems cleaner and less
> error-prone than open-coding an RCU LIST.
>
> Thanks,
>
> Emilio
>
- Re: [Qemu-devel] [RFC 25/38] cpu: add barriers around cpu->tcg_exit_req, (continued)
- [Qemu-devel] [RFC 23/38] cpu-exec: grab iothread lock during interrupt handling, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 24/38] cpu-exec: reset mmap_lock after exiting the CPU loop, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 09/38] rcu: fix comment with s/rcu_gp_lock/rcu_registry_lock/, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 30/38] translate-all: add tb_lock assertions, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 36/38] cputlb: use tcg_sched_work for tlb_flush_page_all, Emilio G. Cota, 2015/08/23
- [Qemu-devel] [RFC 35/38] cputlb: use cpu_tcg_sched_work for tlb_flush_all, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 34/38] translate-all: use tcg_sched_work for tb_flush, Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 19/38] tcg: add tcg_gen_smp_rmb(), Emilio G. Cota, 2015/08/23
[Qemu-devel] [RFC 22/38] cpu: update interrupt_request atomically, Emilio G. Cota, 2015/08/23