diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2013-04-05 11:32:19 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-04-05 18:58:05 +0200 |
commit | 5905fbc9c94ccd744c1b249472eafcc2d827548a (patch) | |
tree | 71685e79fabea4499032719f71671420dec26a6b /include/block/block_int.h | |
parent | 76534da749ceb3b4c13ec09b173bcf6d6c2e36d4 (diff) | |
download | qemu-5905fbc9c94ccd744c1b249472eafcc2d827548a.zip qemu-5905fbc9c94ccd744c1b249472eafcc2d827548a.tar.gz qemu-5905fbc9c94ccd744c1b249472eafcc2d827548a.tar.bz2 |
block: fix I/O throttling accounting blind spot
I/O throttling relies on bdrv_acct_done() which is called when a request
completes. This leaves a blind spot since we only charge for completed
requests, not submitted requests.
For example, if there is 1 operation remaining in this time slice the
guest could submit 3 operations and they will all be submitted
successfully since they don't actually get accounted for until they
complete.
Originally we probably thought this is okay since the requests will be
accounted when the time slice is extended. In practice it causes
fluctuations since the guest can exceed its I/O limit and it will be
punished for this later on.
Account for I/O upon submission so that I/O limits are enforced
properly.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-By: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block_int.h')
-rw-r--r-- | include/block/block_int.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h index 0986a2d..83941d8 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -256,7 +256,7 @@ struct BlockDriverState { int64_t slice_start; int64_t slice_end; BlockIOLimit io_limits; - BlockIOBaseValue io_base; + BlockIOBaseValue slice_submitted; CoQueue throttled_reqs; QEMUTimer *block_timer; bool io_limits_enabled; |