From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages Date: Fri, 17 May 2013 02:39:07 +0800 Message-ID: <519527CB.6080608@linux.vnet.ibm.com> References: <1368706673-8530-1-git-send-email-xiaoguangrong@linux.vnet.ibm.com> <1368706673-8530-4-git-send-email-xiaoguangrong@linux.vnet.ibm.com> <20130516124349.GC14597@redhat.com> <5194DE48.3050208@linux.vnet.ibm.com> <20130516134321.GE14597@redhat.com> <20130516155728.GF14597@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: avi.kivity@gmail.com, mtosatti@redhat.com, pbonzini@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from e23smtp01.au.ibm.com ([202.81.31.143]:53047 "EHLO e23smtp01.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752410Ab3EPSjP (ORCPT ); Thu, 16 May 2013 14:39:15 -0400 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 May 2013 04:31:23 +1000 In-Reply-To: <20130516155728.GF14597@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 05/16/2013 11:57 PM, Gleb Natapov wrote: > One more thought. With current patch if zap_invalid_page() will be > called second time while another zap_invalid_page() is still running > (can that happen?) they will both run concurrently fighting for the Currently, it can not happen since zap_invalid_page is needed when slot is being deleted which protected by slot-lock. But we allow it to be concurrent as you commented: we can use it in ->release() instead of calling kvm_mmu_zap_all(), in that case, multiple call zap_invalid_page() can happen. > mmu_lock. Is this a problem? Are you worry about that it can not progress due to lock contention when walking active_list? Zapping at least 10 pages before releasing the lock should ensure that it can progress. Do you see any potential issue?