From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TujkV-0005MC-Pj for qemu-devel@nongnu.org; Mon, 14 Jan 2013 08:06:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TujkU-0006Gy-KD for qemu-devel@nongnu.org; Mon, 14 Jan 2013 08:06:47 -0500 Received: from mail-wg0-f43.google.com ([74.125.82.43]:45640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TujaI-0003pJ-4N for qemu-devel@nongnu.org; Mon, 14 Jan 2013 07:56:14 -0500 Received: by mail-wg0-f43.google.com with SMTP id e12so2034097wge.22 for ; Mon, 14 Jan 2013 04:56:13 -0800 (PST) Date: Mon, 14 Jan 2013 13:56:10 +0100 From: Stefan Hajnoczi Message-ID: <20130114125610.GA18147@stefanha-thinkpad.redhat.com> References: <1355319999-30627-1-git-send-email-pbonzini@redhat.com> <1355319999-30627-12-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1355319999-30627-12-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 11/20] mirror: support more than one in-flight AIO operation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Wed, Dec 12, 2012 at 02:46:30PM +0100, Paolo Bonzini wrote: > @@ -137,21 +163,58 @@ static void coroutine_fn mirror_iteration(MirrorBlockJob *s) > bdrv_round_to_clusters(s->target, > sector_num, nb_sectors_chunk, > §or_num, &nb_sectors); > - bitmap_set(s->cow_bitmap, sector_num / nb_sectors_chunk, > - nb_sectors / nb_sectors_chunk); > + > + /* The rounding may make us copy sectors before the > + * first dirty one. > + */ > + cluster_num = sector_num / nb_sectors_chunk; > + } > + > + /* Wait for I/O to this cluster (from a previous iteration) to be done. */ > + while (test_bit(cluster_num, s->in_flight_bitmap)) { > + trace_mirror_yield_in_flight(s, sector_num, s->in_flight); > + qemu_coroutine_yield(); > } in_flight_bitmap is never set in this patch. Either you'll set it in a later patch or this is a bug? Why can we get away with testing only cluster_num and not all bits up to and including cluster_num + nb_chunks? Is there an assumption that requests are issued in ascending order?