From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC4SK-0001a2-UG for qemu-devel@nongnu.org; Wed, 21 Aug 2013 05:12:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VC4SC-0001y4-Ep for qemu-devel@nongnu.org; Wed, 21 Aug 2013 05:11:56 -0400 Received: from mail6.webfaction.com ([74.55.86.74]:60123 helo=smtp.webfaction.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC4SC-0001xh-Am for qemu-devel@nongnu.org; Wed, 21 Aug 2013 05:11:48 -0400 Message-ID: <52148453.8030109@ctshepherd.com> Date: Wed, 21 Aug 2013 10:11:47 +0100 From: Charlie Shepherd MIME-Version: 1.0 References: <1377023667-20256-1-git-send-email-charlie@ctshepherd.com> <5213D628.4030409@redhat.com> <5213F37C.8090300@ctshepherd.com> <521476ED.5030308@redhat.com> In-Reply-To: <521476ED.5030308@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] Make cow_co_is_allocated and cow_update_bitmap more efficient List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, stefanha@gmail.com, gabriel@kerneis.info, qemu-devel@nongnu.org On 21/08/2013 09:14, Paolo Bonzini wrote: > Il 21/08/2013 00:53, Charlie Shepherd ha scritto: >> What if nb_sectors > 512 * 8? > For cow_co_is_allocated, you have the luxury of returning information > only for the fewer than nb_sectors. That is, you can set *num_same to a > smaller value than nb_sectors, even if sector_num + *num_same has the > same state as the [sector_num, sector_num + *num_same) range. It will > cause extra calls to is_allocated in the callers, but that's it. So we can report a conservative estimate of *num_same? It still seems worthwhile to me to be as efficient as possible, I guess that means processing a sector's worth of metadata at a time? Charlie