From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxNXz-0005xX-NI for qemu-devel@nongnu.org; Tue, 04 Nov 2008 10:10:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxNXz-0005xL-7n for qemu-devel@nongnu.org; Tue, 04 Nov 2008 10:10:23 -0500 Received: from [199.232.76.173] (port=49678 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxNXz-0005xI-4p for qemu-devel@nongnu.org; Tue, 04 Nov 2008 10:10:23 -0500 Received: from smtp.eu.citrix.com ([62.200.22.115]:59801) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KxNXy-00062c-VE for qemu-devel@nongnu.org; Tue, 04 Nov 2008 10:10:23 -0500 Message-ID: <491066A4.10302@eu.citrix.com> Date: Tue, 04 Nov 2008 15:13:40 +0000 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] vga optmization References: <20081103173111.GC30410@poweredge.glommer> <491034BC.2050806@eu.citrix.com> <49106171.5080209@redhat.com> <5d6222a80811040655u107e242cs6f1e7aaf33f2e6dc@mail.gmail.com> In-Reply-To: <5d6222a80811040655u107e242cs6f1e7aaf33f2e6dc@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Glauber Costa , aliguori@us.ibm.com Glauber Costa wrote: > On Tue, Nov 4, 2008 at 12:51 PM, Avi Kivity wrote: >> Stefano Stabellini wrote: >>> Why don't you make qemu_physical_sync_dirty_bitmap take also and end >>> address, and you merge the two bitmaps in this address range in this >>> function, so you don't have to change cpu_physical_memory_get_dirty at >>> all? >>> >>> I am saying to do something like: >>> >>> void qemu_physical_sync_dirty_bitmap(ram_addr_t start_addr, ram_addr_t >>> end_addr) >>> { >>> /* sync and merge the two bitmaps between start_addr and end_addr >>> */ >>> } >>> >>> then leave cpu_physical_memory_get_dirty untouched. >>> I would prefer this approch, it also leaves more space to other >>> optimizations. >>> >> That's how current kvm userspace works. It's also more correct, since the >> kvm bitmap feeds both the vga dirty bits and the live migration dirty bits. > > My reason to do this way, was to be lazy about updating the dirty bitmap. > But if the common case is to check for all pages in the region, then > it won't matter much. We have an optimization not to always check for all pages in the region, it is not really good looking, but it is working fine. I could send a patch with this optimization after yours, it only affects vga.c.