Received: from eggs.gnu.org ([2001:4830:134:3::10]:54999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5q8T-0006cc-Tl for qemu-devel@nongnu.org; Thu, 26 May 2016 03:55:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5q8Q-0005vk-Lk for qemu-devel@nongnu.org; Thu, 26 May 2016 03:55:17 -0400 Sender: Paolo Bonzini References: <1464100220-21317-1-git-send-email-pl@kamp.de> <20160526065045.GA10734@ad.usersys.redhat.com> <20160526071024.GB10734@ad.usersys.redhat.com> From: Paolo Bonzini Message-ID: <413c4af8-ba30-bfbf-9a84-d1d92ddac0e4@redhat.com> Date: Thu, 26 May 2016 09:55:10 +0200 MIME-Version: 1.0 In-Reply-To: <20160526071024.GB10734@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2] block/io: optimize bdrv_co_pwritev for small requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , Peter Lieven Cc: kwolf@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, stefanha@redhat.com, mreitz@redhat.com On 26/05/2016 09:10, Fam Zheng wrote: > > diff --git a/block/io.c b/block/io.c > index d480097..a6523cf 100644 > --- a/block/io.c > +++ b/block/io.c > @@ -1435,8 +1435,10 @@ int coroutine_fn bdrv_co_pwritev(BlockDriverState *bs, > * than one aligned block. > */ > if (bytes < align) { > + bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_TAIL); > qemu_iovec_add(&local_qiov, head_buf + bytes, align - bytes); > bytes = align; > + bdrv_debug_event(bs, BLKDBG_PWRITEV_RMW_AFTER_TAIL); > } > } This doesn't look too wrong... Should the right sequence of events be head/after_head or head/after_tail? It's probably simplest to just emit all four events. Paolo