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)? Maybe it's worth adding a comment if that's what I missed. Paolo