From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: [PATCH 2/2] KVM: MMU: Flush TLBs only once in invlpg() before releasing mmu_lock Date: Tue, 14 Feb 2012 18:21:50 +0100 Message-ID: <20120214172150.GL9440@redhat.com> References: <20120210152831.6ac3ac87.yoshikawa.takuya@oss.ntt.co.jp> <20120210152950.b54969be.yoshikawa.takuya@oss.ntt.co.jp> <4F34BF7E.4050009@linux.vnet.ibm.com> <4F34C591.1030909@oss.ntt.co.jp> <4F34CA56.1080202@linux.vnet.ibm.com> <4F39E4E3.4050901@oss.ntt.co.jp> <4F39E971.5020302@oss.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Xiao Guangrong , avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:8801 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751466Ab2BNRV5 (ORCPT ); Tue, 14 Feb 2012 12:21:57 -0500 Content-Disposition: inline In-Reply-To: <4F39E971.5020302@oss.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Feb 14, 2012 at 01:56:17PM +0900, Takuya Yoshikawa wrote: > (2012/02/14 13:36), Takuya Yoshikawa wrote: > > > BTW, do you think that "kvm_mmu_flush_tlb()" should be moved inside of the > > mmu_lock critical section? > > > > Ah, forget about this. Trivially no. Yes the reason is that it's the local flush and guest mode isn't running if we're running that function so it's ok to run it later. About the other change you did in this patch 2/2, I can't find the code you're patching in the 3.2 upstream source, when I added the tlb flush to invlpg, I immediately used a cumulative need_flush at the end (before relasing mmu_lock of course). if (need_flush) kvm_flush_remote_tlbs(vcpu->kvm);