qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] drive-mirror: Change the amount of data base on


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] drive-mirror: Change the amount of data base on granularity
Date: Mon, 24 Feb 2014 14:36:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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



reply via email to

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