From: "rudyfly@163.com" <rudyfly@163.com>
To: Stefan Hajnoczi <stefanha@gmail.com>, Fam Zheng <famz@redhat.com>
Cc: "rudy.zhangmin" <rudy.zhangmin@huawei.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Question about drive mirror
Date: Tue, 14 Jan 2014 23:55:31 +0800 [thread overview]
Message-ID: <2014011423553091311128@163.com> (raw)
In-Reply-To: 20140114055736.GD14979@stefanha-thinkpad.redhat.com
[-- Attachment #1: Type: text/plain, Size: 2282 bytes --]
Thank you for your detailed reply.
Now, I am modifying the code to change the reading and writing processes,
My purpose is that after it send the writing requestion and the writing requestion
is not come back, then it send the reading requestion.
I think this way will be more reading and writing pressure than before.
I don't know why in mirror_iteration, each iteration send the number of data is
continuous dirty data, the maximum is the size of free_buffer(default is 10M),
I think the way will reduce the performance of IO,because the mirror will wait long
time to send next reading requestion. I think each iteration send the number of data
should base on the granularity ,we can set the granularity is 1M. This way may be
let the reading and writing is parallel.
zhang min
From: Stefan Hajnoczi
Date: 2014-01-14 13:57
To: Fam Zheng
CC: rudyfly@163.com; rudy.zhangmin; qemu-devel
Subject: Re: [Qemu-devel] Question about drive mirror
On Tue, Jan 14, 2014 at 09:41:41AM +0800, Fam Zheng wrote:
> On Mon, 01/13 23:44, rudyfly@163.com wrote:
> > I tested the capability of drive mirror, I found the IO is low. Then I read the code,
> > The code mirror_run() will call mirror_iteration() to read the size of buffer data
> > from source storage, when the read callback ,and then in mirror_read_complete ()
> > write the data to the target storage, It is serial.
And it also uses throttling to avoid impacting the guest too much. It's
considered a background job, i.e. not trying to saturate storage
bandwidth.
That said, improving performance while keeping I/O isolated from higher
priority guest I/O can be good.
> > Now, I hope when it is writing the data to target storage ,we can send the request
> > of reading data from source storage. Because of using coroutine to do it ,there is
> > some troubles to achieve it. why not use Multi-thread?
> > Some one can give me some idea?
It can be parallelized by splitting the code into two separate loops:
A reader coroutine that reads data from the source device and places
buffers in a queue.
A writer coroutine that takes buffers from the queue and writes data to
the target device.
(In fact there could be multiple readers and writers.)
Stefan
[-- Attachment #2: Type: text/html, Size: 4467 bytes --]
prev parent reply other threads:[~2014-01-14 15:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-13 15:44 [Qemu-devel] Question about drive mirror rudyfly
2014-01-14 1:41 ` Fam Zheng
2014-01-14 5:57 ` Stefan Hajnoczi
2014-01-14 15:55 ` rudyfly [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=2014011423553091311128@163.com \
--to=rudyfly@163.com \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rudy.zhangmin@huawei.com \
--cc=stefanha@gmail.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).