Re: [Qemu-devel] [PATCH V3 for-1.6 2/5] block: Modify the throttling code to implement the leaky bucket algorithm.

2013-07-26 Thread Benoît Canet
I think it is easier to understand written like this: int64_t total_leak = ((bs-io_limits.iops[BLOCK_IO_LIMIT_TOTAL] * delta) / NANOSECONDS_PER_SECOND); if (ios[BLOCK_IO_LIMIT_READ] = total_leak / 2) { read_leak =

Re: [Qemu-devel] [PATCH V3 for-1.6 2/5] block: Modify the throttling code to implement the leaky bucket algorithm.

2013-07-25 Thread Fam Zheng
On Tue, 07/23 18:29, Benoît Canet wrote: This patch replace the previous algorithm by the well described leaky bucket algorithm: A bucket is filled by the incoming IOs and a periodic timer decrement the counter to make the bucket leak. When a given threshold is reached the bucket is full and

[Qemu-devel] [PATCH V3 for-1.6 2/5] block: Modify the throttling code to implement the leaky bucket algorithm.

2013-07-23 Thread Benoît Canet
This patch replace the previous algorithm by the well described leaky bucket algorithm: A bucket is filled by the incoming IOs and a periodic timer decrement the counter to make the bucket leak. When a given threshold is reached the bucket is full and the IOs are hold. In this patch the threshold