Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758604AbcCDH2Q (ORCPT ); Fri, 4 Mar 2016 02:28:16 -0500 Received: from mga02.intel.com ([134.134.136.20]:43668 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751090AbcCDH2N (ORCPT ); Fri, 4 Mar 2016 02:28:13 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,535,1449561600"; d="scan'208";a="901075025" Message-ID: <56D9354E.9040908@intel.com> Date: Fri, 04 Mar 2016 15:12:14 +0800 From: Lan Tianyu User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Thomas Gleixner 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() References: <1457055312-27067-1-git-send-email-tianyu.lan@intel.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1102 Lines: 44 On 2016年03月04日 15:21, Thomas Gleixner wrote: > 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(). That sounds more reasonable. Will update. Thanks. > >> - */ >> - smp_mb(); >> - >> - /* >> * Wait for all vcpus to exit guest mode and/or lockless shadow >> * page table walks. >> */ >> -- >> 1.8.4.rc0.1.g8f6a3e5.dirty >> >> -- Best regards Tianyu Lan