qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Fam Zheng <famz@redhat.com>
Cc: "rudyfly@163.com" <rudyfly@163.com>,
	"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 13:57:36 +0800	[thread overview]
Message-ID: <20140114055736.GD14979@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <20140114014141.GA1377@T430.nay.redhat.com>

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

  reply	other threads:[~2014-01-14  5:58 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 [this message]
2014-01-14 15:55     ` rudyfly

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=20140114055736.GD14979@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rudy.zhangmin@huawei.com \
    --cc=rudyfly@163.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).