From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: [PATCH 1/2] KVM: mmu_notifier: Flush TLBs before releasing mmu_lock Date: Wed, 15 Feb 2012 20:16:24 +0100 Message-ID: <20120215191624.GX9440@redhat.com> References: <20120210152831.6ac3ac87.yoshikawa.takuya@oss.ntt.co.jp> <20120214171044.GK9440@redhat.com> <20120214172947.GA22362@amt.cnet> <20120214185356.GQ9440@redhat.com> <20120214194342.GA24117@amt.cnet> <4F3B7867.7000807@redhat.com> <4F3B7F1F.40402@redhat.com> <4F3B9902.5000306@linux.vnet.ibm.com> <4F3BBC35.6010502@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Xiao Guangrong , Marcelo Tosatti , Takuya Yoshikawa , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:11281 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754680Ab2BOTQp (ORCPT ); Wed, 15 Feb 2012 14:16:45 -0500 Content-Disposition: inline In-Reply-To: <4F3BBC35.6010502@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Feb 15, 2012 at 04:07:49PM +0200, Avi Kivity wrote: > Well, it still has flushes inside the lock. And it seems to be more > complicated, but maybe that's because I thought of my idea and didn't > fully grok yours yet. If we go more complicated I prefer Avi's suggestion to move them all outside the lock. Yesterday I was also thinking at the regular pagetables and how we do not have similar issues there. On the regular pagetables we just do unconditional flush in fork when we make it readonly and KSM (the other place that ptes stuff readonly that later can cow) uses ptep_clear_flush which does an unconditional flush and furthermore it does it inside the PT lock, so generally we don't optimize for those things on the regular pagetables. But then these events don't happen as frequently as they can on KVM without EPT/NPT.