[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 03/27] vpc: unlock Coroutine lock to make IO submit C
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 03/27] vpc: unlock Coroutine lock to make IO submit Concurrently |
Date: |
Tue, 30 Apr 2019 17:42:20 +0200 |
From: Zhengui li <address@hidden>
Concurrent IO becomes serial IO because of the qemu Coroutine lock,
which reduce IO performance severely.
So unlock Coroutine lock before bdrv_co_pwritev and
bdrv_co_preadv to fix it.
Signed-off-by: Zhengui li <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vpc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/vpc.c b/block/vpc.c
index a902a4c54d..0c279b87c8 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -639,8 +639,10 @@ vpc_co_preadv(BlockDriverState *bs, uint64_t offset,
uint64_t bytes,
qemu_iovec_reset(&local_qiov);
qemu_iovec_concat(&local_qiov, qiov, bytes_done, n_bytes);
+ qemu_co_mutex_unlock(&s->lock);
ret = bdrv_co_preadv(bs->file, image_offset, n_bytes,
&local_qiov, 0);
+ qemu_co_mutex_lock(&s->lock);
if (ret < 0) {
goto fail;
}
@@ -697,8 +699,10 @@ vpc_co_pwritev(BlockDriverState *bs, uint64_t offset,
uint64_t bytes,
qemu_iovec_reset(&local_qiov);
qemu_iovec_concat(&local_qiov, qiov, bytes_done, n_bytes);
+ qemu_co_mutex_unlock(&s->lock);
ret = bdrv_co_pwritev(bs->file, image_offset, n_bytes,
&local_qiov, 0);
+ qemu_co_mutex_lock(&s->lock);
if (ret < 0) {
goto fail;
}
--
2.20.1
- [Qemu-block] [PULL 00/27] Block layer patches, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 03/27] vpc: unlock Coroutine lock to make IO submit Concurrently,
Kevin Wolf <=
- [Qemu-block] [PULL 02/27] block: Fix AioContext switch for bs->drv == NULL, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 04/27] vmdk: Set vmdk parent backing_format to vmdk, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 05/27] block/vhdx: Remove redundant IEC binary prefixes definition, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 06/27] block/vhdx: Use IEC binary prefixes for size constants, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 01/27] tests/qemu-iotests: Fix output of qemu-io related tests, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 07/27] cutils: Fix size_to_str() on 32-bit platforms, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 09/27] qcow2: Avoid COW during metadata preallocation, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 11/27] qcow2: Fix full preallocation with external data file, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 10/27] qcow2: Add errp to preallocate_co(), Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 08/27] qemu-img: Saner printing of large file sizes, Kevin Wolf, 2019/04/30