[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 27/76] block: Pause block jobs in bdrv_drain_all
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 27/76] block: Pause block jobs in bdrv_drain_all |
Date: |
Tue, 28 Apr 2015 17:00:09 +0200 |
From: Fam Zheng <address@hidden>
This is necessary to suppress more IO requests from being generated from
block job coroutines.
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/block.c b/block.c
index 670d7e4..70aed80 100644
--- a/block.c
+++ b/block.c
@@ -2040,6 +2040,16 @@ void bdrv_drain_all(void)
bool busy = true;
BlockDriverState *bs;
+ QTAILQ_FOREACH(bs, &bdrv_states, device_list) {
+ AioContext *aio_context = bdrv_get_aio_context(bs);
+
+ aio_context_acquire(aio_context);
+ if (bs->job) {
+ block_job_pause(bs->job);
+ }
+ aio_context_release(aio_context);
+ }
+
while (busy) {
busy = false;
@@ -2051,6 +2061,16 @@ void bdrv_drain_all(void)
aio_context_release(aio_context);
}
}
+
+ QTAILQ_FOREACH(bs, &bdrv_states, device_list) {
+ AioContext *aio_context = bdrv_get_aio_context(bs);
+
+ aio_context_acquire(aio_context);
+ if (bs->job) {
+ block_job_resume(bs->job);
+ }
+ aio_context_release(aio_context);
+ }
}
/* make a BlockDriverState anonymous by removing from bdrv_state and
--
1.8.3.1
- [Qemu-block] [PULL 18/76] qemu-iotests: Some qemu-img convert tests, (continued)
- [Qemu-block] [PULL 18/76] qemu-iotests: Some qemu-img convert tests, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 17/76] qemu-img convert: Rewrite copying logic, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 19/76] blkdebug: Add bdrv_truncate(), Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 20/76] vhdx: Fix zero-fill iov length, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 21/76] thread-pool: clean up thread_pool_completion_bh(), Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 22/76] scripts: add 'qemu coroutine' command to qemu-gdb.py, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 25/76] MAINTAINERS: Add Fam Zheng as Null block driver maintainer, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 24/76] block/null: Support reopen, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 23/76] block/null: Latency simulation by adding new option "latency-ns", Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 26/76] blockjob: Allow nested pause, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 27/76] block: Pause block jobs in bdrv_drain_all,
Kevin Wolf <=
- [Qemu-block] [PULL 28/76] qemu-iotests: Test that "stop" doesn't drain block jobs, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 31/76] virtio_blk: comment fix, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 29/76] blockjob: Update function name in comments, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 32/76] m25p80: add missing blk_attach_dev_nofail, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 30/76] block: avoid unnecessary bottom halves, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 33/76] m25p80: fix s->blk usage before assignment, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 34/76] block: document block-stream in qmp-commands.hx, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 35/76] block: add bdrv_get_device_or_node_name(), Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 36/76] block: use bdrv_get_device_or_node_name() in error messages, Kevin Wolf, 2015/04/28
- [Qemu-block] [PULL 37/76] block: add 'node-name' field to BLOCK_IMAGE_CORRUPTED, Kevin Wolf, 2015/04/28