linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lan Tianyu <tianyu.lan@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Xiao Guangrong <guangrong.xiao@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: gleb@kernel.org, mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page()
Date: Fri, 11 Mar 2016 09:13:58 +0800	[thread overview]
Message-ID: <56E21BD6.7000405@intel.com> (raw)
In-Reply-To: <56E19224.9090906@redhat.com>

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

  parent reply	other threads:[~2016-03-11  1:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04  1:35 [PATCH] KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page() Lan Tianyu
2016-03-04  7:21 ` Thomas Gleixner
2016-03-04  7:12   ` Lan Tianyu
2016-03-04  8:49     ` Paolo Bonzini
2016-03-08  8:36       ` Lan Tianyu
2016-03-08 15:27         ` Paolo Bonzini
2016-03-09  7:18           ` Lan Tianyu
2016-03-10 17:07             ` Paolo Bonzini
2016-03-10 18:08               ` Xiao Guangrong
2016-03-10 14:40           ` Xiao Guangrong
2016-03-10 15:26             ` Paolo Bonzini
2016-03-10 15:31               ` Paolo Bonzini
2016-03-10 15:45                 ` Xiao Guangrong
2016-03-10 16:04                   ` Paolo Bonzini
2016-03-10 17:57                     ` Xiao Guangrong
2016-03-11  1:13               ` Lan Tianyu [this message]
2016-03-04  8:04 ` Paolo Bonzini
2016-03-04 13:48   ` Xiao Guangrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E21BD6.7000405@intel.com \
    --to=tianyu.lan@intel.com \
    --cc=gleb@kernel.org \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).