From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753918AbcBWORc (ORCPT ); Tue, 23 Feb 2016 09:17:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38506 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753570AbcBWORb (ORCPT ); Tue, 23 Feb 2016 09:17:31 -0500 Subject: Re: [PATCH v3 11/11] KVM: MMU: apply page track notifier To: Xiao Guangrong References: <1455449503-20993-1-git-send-email-guangrong.xiao@linux.intel.com> <1455449503-20993-12-git-send-email-guangrong.xiao@linux.intel.com> <56C702F9.3070309@redhat.com> <56CBE2C2.7020005@linux.intel.com> Cc: gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kai.huang@linux.intel.com, jike.song@intel.com From: Paolo Bonzini Message-ID: <56CC69F6.2000305@redhat.com> Date: Tue, 23 Feb 2016 15:17:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56CBE2C2.7020005@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 23 Feb 2016 14:17:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/02/2016 05:40, Xiao Guangrong wrote: >>> >>> @@ -7878,6 +7877,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) >>> kfree(kvm->arch.vioapic); >>> kvm_free_vcpus(kvm); >>> kfree(rcu_dereference_check(kvm->arch.apic_map, 1)); >>> + kvm_mmu_uninit_vm(kvm); >> >> This function is not necessary, since the VM is disappearing anyway and >> the page tracker is not going to be called. > > I think it is still necessary, as we are using srcu to protect the > notifier, so > we should wait all the callers of notifier callbacks gone, i.e, > synchronize_srcu() is needed anyway. You're right. Paolo