On Sun, Jul 09, 2017 at 16:56:23 -0400, Emilio G. Cota wrote: > On Sun, Jul 09, 2017 at 10:00:01 -1000, Richard Henderson wrote: > > On 07/08/2017 09:49 PM, Emilio G. Cota wrote: > > >+ atomic_set(&env->tlb_flush_count, env->tlb_flush_count + 1); > > > > Want atomic_read here, so they're all the same. > > It's not needed. Note that this thread is the only one ever writing > to env->tlb_flush_count, so the thread can read this value without > atomic accesses. > > You'll see this pattern all across the patchset.
We already have this kind of pattern in QEMU. See this patch and related discussion: https://patchwork.kernel.org/patch/9358939/ E.