Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758524AbcCDHWq (ORCPT ); Fri, 4 Mar 2016 02:22:46 -0500 Received: from www.linutronix.de ([62.245.132.108]:34144 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751149AbcCDHWo (ORCPT ); Fri, 4 Mar 2016 02:22:44 -0500 Date: Fri, 4 Mar 2016 08:21:12 +0100 (CET) From: Thomas Gleixner To: Lan Tianyu cc: gleb@kernel.org, pbonzini@redhat.com, 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() In-Reply-To: <1457055312-27067-1-git-send-email-tianyu.lan@intel.com> Message-ID: References: <1457055312-27067-1-git-send-email-tianyu.lan@intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001,URIBL_BLOCKED=0.001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 932 Lines: 35 On Fri, 4 Mar 2016, 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 You want to leave the comment explaining the memory barriers and tell that kvm_flush_remote_tlbs() contains the smp_mb(). > - */ > - smp_mb(); > - > - /* > * Wait for all vcpus to exit guest mode and/or lockless shadow > * page table walks. > */ > -- > 1.8.4.rc0.1.g8f6a3e5.dirty > >