Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758640AbcCDIEW (ORCPT ); Fri, 4 Mar 2016 03:04:22 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36593 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751090AbcCDIET (ORCPT ); Fri, 4 Mar 2016 03:04:19 -0500 Subject: Re: [PATCH] KVM: Remove redundant smp_mb() in the kvm_mmu_commit_zap_page() To: Lan Tianyu , gleb@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org References: <1457055312-27067-1-git-send-email-tianyu.lan@intel.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiao Guangrong From: Paolo Bonzini Message-ID: <56D9417E.4000206@redhat.com> Date: Fri, 4 Mar 2016 09:04:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1457055312-27067-1-git-send-email-tianyu.lan@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1085 Lines: 38 On 04/03/2016 02:35, Lan Tianyu wrote: > The following kvm_flush_remote_tlbs() will call smp_mb() inside and so > remove smp_mb() here. > > Signed-off-by: Lan Tianyu > --- > arch/x86/kvm/mmu.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index a54ecd9..6315416 100644 > --- a/arch/x86/kvm/mmu.c > +++ b/arch/x86/kvm/mmu.c > @@ -2383,12 +2383,6 @@ static void kvm_mmu_commit_zap_page(struct kvm *kvm, > return; > > /* > - * wmb: make sure everyone sees our modifications to the page tables > - * rmb: make sure we see changes to vcpu->mode > - */ > - smp_mb(); > - > - /* > * Wait for all vcpus to exit guest mode and/or lockless shadow > * page table walks. > */ > kvm_flush_remote_tlbs loads kvm->tlbs_dirty before issuing the memory barrier. I think it's okay if the load is done earlier, but I'd like Guangrong to take a look. In any case, this patch is not going to be included in 4.6. I'll queue it directly for 4.7. Paolo Looks good, but I'd like Xiao to take a look.