aboutsummaryrefslogtreecommitdiff
path: root/block/vpc.c
diff options
context:
space:
mode:
authorZhengui li <lizhengui@huawei.com>2019-03-15 22:04:38 +0800
committerKevin Wolf <kwolf@redhat.com>2019-04-30 15:29:00 +0200
commit126734c4f7c38592f6f36ac9e02ab3aad13a656f (patch)
tree3406f5bfe9f02dbbc63966c4ae892e869a730fab /block/vpc.c
parent1bffe1ae7a7b707c3a14ea2ccd00d3609d3ce4d8 (diff)
vpc: unlock Coroutine lock to make IO submit Concurrently
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 <lizhengui@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vpc.c')
-rw-r--r--block/vpc.c4
1 files changed, 4 insertions, 0 deletions
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;
}