Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nfkwr-00083q-MN for qemu-devel@nongnu.org; Thu, 11 Feb 2010 21:08:01 -0500 Received: from [199.232.76.173] (port=49402 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nfkwr-00083X-CI for qemu-devel@nongnu.org; Thu, 11 Feb 2010 21:08:01 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nfkwp-0003X0-NI for qemu-devel@nongnu.org; Thu, 11 Feb 2010 21:08:01 -0500 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:46853) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nfkwp-0003Wo-3P for qemu-devel@nongnu.org; Thu, 11 Feb 2010 21:07:59 -0500 Message-ID: <4B74B800.2060006@lab.ntt.co.jp> Date: Fri, 12 Feb 2010 11:08:00 +0900 From: OHMURA Kei MIME-Version: 1.0 References: <4B6FE5DA.6000502@lab.ntt.co.jp> <4B73FB39.1000200@redhat.com> In-Reply-To: <4B73FB39.1000200@redhat.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/3] qemu-kvm: Wrap phys_ram_dirty with additional inline functions. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: ohmura.kei@lab.ntt.co.jp, kvm@vger.kernel.org, Jan Kiszka , qemu-devel@nongnu.org, Yoshiaki Tamura > Why do you need a counter? It may be sufficient to set a single bit. > This reduces the memory overhead and perhaps cache thrashing. Thanks for looking into this. I agree with your opinion. Our motivation here is to skip traveling when the dirty bitmap is really sparse or dense, so either setting a bit or counting up would be fine. There is one advantage to the counter approach that we can make this large traveling granularity flexible. In case of the bit approach, the maximum granularity is limited to HOST_LONG_BITS. If you think this flexibility is to be useless, we would take the bit approach. By the way, this is about filling the gap of the dirty bitmap management between kvm and qemu. Do you think we should set a bit when qemu's phys_ram_dirty is 0xff or !0? Radically, if we could have a bit-based phys_ram_dirty_by_word, we may just OR the dirty bitmap of kvm with qemu in kvm_get_dirty_pages_log_range()...