[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 46/48] block: clean up bdrv_drain_all() throttling co
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 46/48] block: clean up bdrv_drain_all() throttling comments |
Date: |
Fri, 6 Dec 2013 17:36:45 +0100 |
Since cc0681c45430a1f1a4c2d06e9499b7775afc9a18 ("block: Enable the new
throttling code in the block layer.") bdrv_drain_all() no longer spins.
The code used to look as follows:
do {
busy = qemu_aio_wait();
/* FIXME: We do not have timer support here, so this is effectively
* a busy wait.
*/
QTAILQ_FOREACH(bs, &bdrv_states, list) {
while (qemu_co_enter_next(&bs->throttled_reqs)) {
busy = true;
}
}
} while (busy);
Note that throttle requests are kicked but I/O throttling limits are
still in effect. The loop spins until the vm_clock time allows the
request to make progress and complete.
The new throttling code introduced bdrv_start_throttled_reqs(). This
function not only kicks throttled requests but also temporarily disables
throttling so requests can run.
The outdated FIXME comment can be removed. Also drop the busy = true
assignment since we overwrite it immediately afterwards.
Reviewed-by: Alex Bligh <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/block.c b/block.c
index 1c83ef1..13f001a 100644
--- a/block.c
+++ b/block.c
@@ -1557,13 +1557,8 @@ void bdrv_drain_all(void)
BlockDriverState *bs;
while (busy) {
- /* FIXME: We do not have timer support here, so this is effectively
- * a busy wait.
- */
QTAILQ_FOREACH(bs, &bdrv_states, list) {
- if (bdrv_start_throttled_reqs(bs)) {
- busy = true;
- }
+ bdrv_start_throttled_reqs(bs);
}
busy = bdrv_requests_pending_all();
--
1.8.4.2
- [Qemu-devel] [PULL 35/48] qemu-iotests: add test for snapshot in qemu-img convert, (continued)
- [Qemu-devel] [PULL 35/48] qemu-iotests: add test for snapshot in qemu-img convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 36/48] qemu-nbd: add doc for option -f, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 37/48] qemu-img: add support for skipping zeroes in input during convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 38/48] qemu-img: fix usage instruction for qemu-img convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 39/48] block/iscsi: set bdi->cluster_size, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 40/48] block: add opt_transfer_length to BlockLimits, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 41/48] block/iscsi: set bs->bl.opt_transfer_length, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 42/48] qemu-img: dynamically adjust iobuffer size during convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 43/48] qemu-img: round down request length to an aligned sector, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 44/48] qemu-img: decrease progress update interval on convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 46/48] block: clean up bdrv_drain_all() throttling comments,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 47/48] aio: make aio_poll(ctx, true) block with no fds, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 48/48] qemu-iotests: filter QEMU monitor \r\n, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 45/48] qcow2: use start_of_cluster() and offset_into_cluster() everywhere, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 31/48] snapshot: distinguish id and name in load_tmp, Stefan Hajnoczi, 2013/12/06