From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753886Ab3EPSjR (ORCPT ); Thu, 16 May 2013 14:39:17 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:53048 "EHLO e23smtp01.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752699Ab3EPSjP (ORCPT ); Thu, 16 May 2013 14:39:15 -0400 Message-ID: <519527CB.6080608@linux.vnet.ibm.com> Date: Fri, 17 May 2013 02:39:07 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Gleb Natapov CC: avi.kivity@gmail.com, mtosatti@redhat.com, pbonzini@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages 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> In-Reply-To: <20130516155728.GF14597@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13051618-1618-0000-0000-000003E7DCE2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?