qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH V2] block/io: optimize bdrv_co_pwri


From: Fam Zheng
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH V2] block/io: optimize bdrv_co_pwritev for small requests
Date: Thu, 26 May 2016 15:10:24 +0800
User-agent: Mutt/1.6.1 (2016-04-27)

On Thu, 05/26 14:50, Fam Zheng wrote:
> On Tue, 05/24 16:30, Peter Lieven wrote:
> > in a read-modify-write cycle a small request might cause
> > head and tail to fall into the same aligned block. Currently
> > QEMU reads the same block twice in this case which is
> > not necessary.
> > 
> > Signed-off-by: Peter Lieven <address@hidden>
> 
> Thanks, applied to my block branch:
> 
> https://github.com/famz/qemu/tree/block
> 

Looks like this breaks iotests 077 (hang), the blkdebug break points expected
by the script are not hit now. While squashing in below patch fixes the case, I
think it is more appropriate to keep the patch as is and fix the case itself.

Dropped from my queue, please send another version with test case update so I
can apply together.

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);
         }
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]