Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1355527

Re: [PATCH] KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page()

From Lan Tianyu <tianyu.lan@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page()
Date 2016-03-11 02:40 +0100
Message-ID <rbkdA-74F-15@gated-at.bofh.it> (permalink)
References (3 earlier) <r8TAT-44r-15@gated-at.bofh.it> <ralEK-6YM-1@gated-at.bofh.it> <rarKb-2CK-27@gated-at.bofh.it> <rba4y-8hd-11@gated-at.bofh.it> <rbaHg-q8-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016年03月10日 23:26, Paolo Bonzini wrote:
> 
> 
> 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?

Paolo:
	Sure. I will do that.

Guangrong:
	Thanks a lot for your input.

-- 
Best regards
Tianyu Lan

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH] KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page() Lan Tianyu <tianyu.lan@intel.com> - 2016-03-08 10:00 +0100
  Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Paolo Bonzini <pbonzini@redhat.com> - 2016-03-08 16:30 +0100
    Re: [PATCH] KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page() Lan Tianyu <tianyu.lan@intel.com> - 2016-03-09 08:40 +0100
      Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Paolo Bonzini <pbonzini@redhat.com> - 2016-03-10 18:10 +0100
        Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-03-10 19:20 +0100
    Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-03-10 15:50 +0100
      Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Paolo Bonzini <pbonzini@redhat.com> - 2016-03-10 16:30 +0100
        Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Paolo Bonzini <pbonzini@redhat.com> - 2016-03-10 16:40 +0100
          Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-03-10 16:50 +0100
            Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Paolo Bonzini <pbonzini@redhat.com> - 2016-03-10 17:10 +0100
              Re: [PATCH] KVM: Remove redundant smp_mb() in the  kvm_mmu_commit_zap_page() Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-03-10 19:20 +0100
        Re: [PATCH] KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page() Lan Tianyu <tianyu.lan@intel.com> - 2016-03-11 02:40 +0100

csiph-web