On Tue, 15 Jan 2013 19:43:40 -0500 Christoffer Dall <cdall@xxxxxxxxxxxxxxx> wrote: > @@ -201,9 +222,13 @@ void kvm_flush_remote_tlbs(struct kvm *kvm) > { > long dirty_count = kvm->tlbs_dirty; > > - smp_mb(); > + smp_mb(); /* TODO: Someone should explain this! */ > if (make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH)) > ++kvm->stat.remote_tlb_flush; > + /* > + * TODO: Someone should explain this, why is it a cmpxchg, what > + * happens if the dirty is different from dirty_count? > + */ > cmpxchg(&kvm->tlbs_dirty, dirty_count, 0); > } If it's different from the old value, that means another attempt which forces us to care about TLBs has been done? So I think making tlbs_dirty 0 is safe only when it's not changed during executing this function. Takuya -- 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