From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>,
"Chentao (Boby)" <boby.chen@huawei.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
"Wangting (Kathy)" <kathy.wangting@huawei.com>,
qemu-devel <qemu-devel@nongnu.org>,
Qinling <mail.qinling@huawei.com>,
"Zhangmin (Rudy)" <rudy.zhangmin@huawei.com>,
"Wubin (H)" <wu.wubin@huawei.com>
Subject: Re: [Qemu-devel] [PATCH] drive-mirror: Change the amount of data base on granularity
Date: Mon, 24 Feb 2014 14:36:56 +0100 [thread overview]
Message-ID: <530B4AF8.9000605@redhat.com> (raw)
In-Reply-To: <20140224132023.GC15488@stefanha-thinkpad.redhat.com>
Il 24/02/2014 14:20, Stefan Hajnoczi ha scritto:
>> Now, I change the amount of data in an iteration, it base on
>> granularity. We can set the granularity to 1M,so it can send
>>
>> 10 times read request, and then send write request. Once a write
>> request is done, it will have 1M free buffer to send next read
>> request.
>>
>> So this way can allow read/write to be parallelized.
This also means that in the dirty phase you have to send chunks of 1M
instead of say 64K. 64K is a common value of the granularity.
Try plotting the I/O rate against the granularity, you'll see that you
will not get top utilization at 10M, but you will not get it at 64K
either. What you need is probably as simple as this:
$ git diff block/mirror.c
diff --git a/block/mirror.c b/block/mirror.c
index e683959..66093da 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -231,7 +231,7 @@ static void coroutine_fn mirror_iteration(MirrorBlockJob *s)
nb_chunks += added_chunks;
next_sector += added_sectors;
next_chunk += added_chunks;
- } while (next_sector < end);
+ } while (nb_sectors < MAX_SECTORS_PER_MIRROR_OP && next_sector < end);
/* Allocate a MirrorOp that is used as an AIO callback. */
op = g_slice_new(MirrorOp);
for some value of MAX_SECTORS_PER_MIRROR_OP. You will need to run
some benchmarks in order to find the right value.
Paolo
prev parent reply other threads:[~2014-02-24 13:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-18 8:09 [Qemu-devel] [PATCH] drive-mirror: Change the amount of data base on granularity Chentao (Boby)
2014-02-24 13:20 ` Stefan Hajnoczi
2014-02-24 13:36 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=530B4AF8.9000605@redhat.com \
--to=pbonzini@redhat.com \
--cc=boby.chen@huawei.com \
--cc=famz@redhat.com \
--cc=kathy.wangting@huawei.com \
--cc=kwolf@redhat.com \
--cc=mail.qinling@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=rudy.zhangmin@huawei.com \
--cc=stefanha@gmail.com \
--cc=wu.wubin@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).