From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvbxE-000244-1B for qemu-devel@nongnu.org; Sun, 08 Nov 2015 21:13:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvbx9-0004W0-Rs for qemu-devel@nongnu.org; Sun, 08 Nov 2015 21:13:07 -0500 Date: Mon, 9 Nov 2015 10:12:54 +0800 From: Fam Zheng Message-ID: <20151109021254.GC17373@ad.usersys.redhat.com> References: <1446805353-3047-1-git-send-email-famz@redhat.com> <563CF31E.6030707@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <563CF31E.6030707@redhat.com> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] mirror: Improve zero-write and discard with fragmented image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org On Fri, 11/06 19:36, Max Reitz wrote: > > + next_sector = sector_num; > > + next_chunk = sector_num / sectors_per_chunk; > > @next_sector and @next_chunk set here... > > > hbitmap_next_sector = s->sector_num; > > - sector_num = s->sector_num; > > - sectors_per_chunk = s->granularity >> BDRV_SECTOR_BITS; > > - end = s->bdev_length / BDRV_SECTOR_SIZE; > > > > /* Extend the QEMUIOVector to include all adjacent blocks that will > > * be copied in this operation. > > @@ -198,14 +191,6 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) > > next_sector = sector_num; > > next_chunk = sector_num / sectors_per_chunk; > > ...and here already. So the above seems superfluous, considering that > they are not read in between. > > (If you keep hbitmap_next_sector = s->sector_num; above the sector_num = > ... block, that may reduce conflicts further) Indeed, thanks for noticing this. > > + case MIRROR_METHOD_DISCARD: > > + return mirror_do_zero_or_discard(s, sector_num, > > + contiguous_sectors, > > + false); > > s/false/true/? Yes, thanks. Fam