On 10/03/2016 15:40, Xiao Guangrong wrote: > long dirty_count = kvm->tlbs_dirty; > > + /* > + * read tlbs_dirty before doing tlb flush to make sure not tlb > request is > + * lost. > + */ > smp_mb(); > + > if (kvm_make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH)) > ++kvm->stat.remote_tlb_flush; > cmpxchg(&kvm->tlbs_dirty, dirty_count, 0); > > > Any comment? Compared to smp_load_acquire(), smp_mb() adds an ordering between stores and loads. Is the The load of kvm->tlbs_dirty should then be /* * Read tlbs_dirty before setting KVM_REQ_TLB_FLUSH in * kvm_make_all_cpus_request. This */ long dirty_count = smp_load_acquire(kvm->tlbs_dirty); Tianyu, I think Xiao provided the information that I was missing. Would you like to prepare the patch? Thanks, Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html