From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/4] KVM: Count the number of dirty pages for dirty logging Date: Tue, 27 Dec 2011 17:06:47 +0200 Message-ID: <4EF9DF07.2070208@redhat.com> References: <20111114182041.43570cdf.yoshikawa.takuya@oss.ntt.co.jp> <20111114182334.f57fbeae.yoshikawa.takuya@oss.ntt.co.jp> <4EC0E85F.80004@redhat.com> <4EF00F2F.6080305@oss.ntt.co.jp> <20111223111451.GD24308@amt.cnet> <20111224115251.2aaa9549cb0a98de79f7d918@gmail.com> <20111227135017.GB23270@amt.cnet> <4EF9D024.8050908@redhat.com> <20111228000322.33585bc7450433775326292e@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Takuya Yoshikawa , kvm@vger.kernel.org To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:5748 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754445Ab1L0PGw (ORCPT ); Tue, 27 Dec 2011 10:06:52 -0500 In-Reply-To: <20111228000322.33585bc7450433775326292e@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/27/2011 05:03 PM, Takuya Yoshikawa wrote: > Avi Kivity wrote: > > > > It should not be necessary, atomicity of updates to > > > memslot->dirty_bitmap, because of RCU updates to the memslot pointer > > > (note memslot = gfn_to_memslot(kvm, gfn); in mark_page_dirty). > > > > > > The order is: > > > > > > - update page data. > > > - grab memslot pointer. > > > - set page bit in memslot. > > > > > > > What if both grab the same memslot pointer, but set different bits? > > (Sorry for my bad wording, that is what I wanted to explain.) > > There seems to be possible concurrent __set_bit()'s to the same word > which will result in bit loss. > > I was thinking to change the kvm-unit-tests' dirty log test to write > to two consecutive pages concurrently. Is this good for debugging this? Yes, it already tests some concurrency issues. Please do write the test, we should do this a lot more often. -- error compiling committee.c: too many arguments to function