qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] block: fix bdrv_exceed_iops_limits wait computation


From: Benoît Canet
Subject: [Qemu-devel] [PATCH] block: fix bdrv_exceed_iops_limits wait computation
Date: Wed, 20 Mar 2013 10:12:14 +0100

This patch fix an I/O throttling behavior triggered by limiting at 150 iops
and running a load of 50 threads doing random pwrites on a raw virtio device.

After a few moments the iops count start to oscillate steadily between 0 and a
value upper than the limit.

As the load keep running the period and the amplitude of the oscillation
increase until io bursts reaching the physical storage max iops count are
done.

These bursts are followed by guest io starvation.

As the period of this oscillation cycle is increasing the cause must be a
computation error leading to increase slowly the wait time.

This patch make the wait time a bit smaller and tests confirm that it solves
the oscillating behavior.

Signed-off-by: Benoit Canet <address@hidden>
---
 block.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 0a062c9..455d8b0 100644
--- a/block.c
+++ b/block.c
@@ -3739,7 +3739,7 @@ static bool bdrv_exceed_iops_limits(BlockDriverState *bs, 
bool is_write,
     }
 
     /* Calc approx time to dispatch */
-    wait_time = (ios_base + 1) / iops_limit;
+    wait_time = ios_base / iops_limit;
     if (wait_time > elapsed_time) {
         wait_time = wait_time - elapsed_time;
     } else {
-- 
1.7.10.4




reply via email to

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