On Tue, Jan 14, 2014 at 09:41:41AM +0800, Fam Zheng wrote: > On Mon, 01/13 23:44, rudy...@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