From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [test result] dirty logging without srcu update -- Re: [RFC][PATCH] srcu: Implement call_srcu() Date: Thu, 2 Feb 2012 23:44:50 +0900 Message-ID: <20120202234450.20b75999de0e3b05043ffb71@gmail.com> References: <1328016724.2446.229.camel@twins> <4F27F0E6.1040309@redhat.com> <1328017807.2446.230.camel@twins> <20120131222447.GH2391@linux.vnet.ibm.com> <1328091749.2760.34.camel@laptop> <4F29178A.1090306@redhat.com> <4F2918D5.4050104@redhat.com> <4F291B56.30600@oss.ntt.co.jp> <4F291B92.8070402@redhat.com> <4F291E1F.3030505@oss.ntt.co.jp> <4F293D14.5030008@redhat.com> <20120202144633.1fc9b997.yoshikawa.takuya@oss.ntt.co.jp> <4F2A611E.6090005@redhat.com> <4F2A63B9.8000405@oss.ntt.co.jp> <4F2A63C6.7030301@redhat.com> <4F2A682C.7090109@oss.ntt.co.jp> <4F2A6D46.6010406@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , Peter Zijlstra , paulmck@linux.vnet.ibm.com, Oleg Nesterov , linux-kernel , Marcelo Tosatti , KVM list To: Avi Kivity Return-path: In-Reply-To: <4F2A6D46.6010406@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Avi Kivity wrote: > > I have one concern about correctness issue though: > > > > concurrent rmap write protection may not be safe due to > > delayed tlb flush ... cannot happen? > > What do you mean by concurrent rmap write protection? > Not sure, but other codes like: - mmu_sync_children() for_each_sp(pages, sp, parents, i) protected |= rmap_write_protect(vcpu->kvm, sp->gfn); if (protected) kvm_flush_remote_tlbs(vcpu->kvm); - kvm_mmu_get_page() if (rmap_write_protect(vcpu->kvm, gfn)) kvm_flush_remote_tlbs(vcpu->kvm); I just wondered what can happen if GET_DIRTY_LOG is being processed behind these processing? They may find nothing to write protect and won't do kvm_flush_remote_tlbs() if the gfn has been already protected by GET_DIRTY_LOG. But GET_DIRTY_LOG may still be busy write protecting other pages and others can return before. (My code releases mmu_lock to not include __put_user() in the critical section.) I am not still enough familier with these code yet. (maybe empty concern) Takuya