qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 4/4] block/qcow2: introduce parallel subreque


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v2 4/4] block/qcow2: introduce parallel subrequest handling in read and write
Date: Wed, 14 Aug 2019 18:24:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 30.07.19 16:18, Vladimir Sementsov-Ogievskiy wrote:
> It improves performance for fragmented qcow2 images.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>  block/qcow2.c      | 125 +++++++++++++++++++++++++++++++++++++++++----
>  block/trace-events |   1 +
>  2 files changed, 115 insertions(+), 11 deletions(-)
> 
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 37766b8b7c..5f0e66ea48 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c

[...]

> @@ -2017,6 +2018,62 @@ fail:
>      return ret;
>  }
>  
> +typedef struct Qcow2AioTask {
> +    AioTask task;
> +
> +    BlockDriverState *bs;
> +    QCow2ClusterType cluster_type; /* only for read */
> +    uint64_t file_cluster_offset;
> +    uint64_t offset;
> +    uint64_t bytes;
> +    QEMUIOVector *qiov;
> +    uint64_t qiov_offset;
> +    QCowL2Meta *l2meta; /* only for write */
> +} Qcow2AioTask;
> +
> +#define QCOW2_MAX_WORKERS 8

Maybe move this to the top, or even qcow2.h?

[...]

> @@ -2112,7 +2182,16 @@ static coroutine_fn int 
> qcow2_co_preadv_part(BlockDriverState *bs,
>          qiov_offset += cur_bytes;
>      }
>  
> -    return 0;
> +out:
> +    if (aio) {
> +        aio_task_pool_wait_all(aio);
> +        if (ret == 0) {
> +            ret = aio_task_pool_status(aio);
> +        }
> +        g_free(aio);
> +    }
> +
> +    return ret;

My gcc complains here that ret may be initialized.  (Which is indeed the
case if @bytes is 0.)

The rest looks good to me.

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]