[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 10/10] qcow2: Forward ZERO_WRITE flag for full preallocati
From: |
Max Reitz |
Subject: |
Re: [PATCH v7 10/10] qcow2: Forward ZERO_WRITE flag for full preallocation |
Date: |
Fri, 24 Apr 2020 16:28:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
On 24.04.20 16:27, Kevin Wolf wrote:
> The BDRV_REQ_ZERO_WRITE is currently implemented in a way that first the
> image is possibly preallocated and then the zero flag is added to all
> clusters. This means that a copy-on-write operation may be needed when
> writing to these clusters, despite having used preallocation, negating
> one of the major benefits of preallocation.
>
> Instead, try to forward the BDRV_REQ_ZERO_WRITE to the protocol driver,
> and if the protocol driver can ensure that the new area reads as zeros,
> we can skip setting the zero flag in the qcow2 layer.
>
> Unfortunately, the same approach doesn't work for metadata
> preallocation, so we'll still set the zero flag there.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> ---
> block/qcow2.c | 22 +++++++++++++++++++---
> tests/qemu-iotests/274.out | 4 ++--
> 2 files changed, 21 insertions(+), 5 deletions(-)
Thanks for the resend! :)
Max
signature.asc
Description: OpenPGP digital signature
- [PATCH v7 02/10] block: Add flags to bdrv(_co)_truncate(), (continued)
- [PATCH v7 02/10] block: Add flags to bdrv(_co)_truncate(), Kevin Wolf, 2020/04/24
- [PATCH v7 05/10] raw-format: Support BDRV_REQ_ZERO_WRITE for truncate, Kevin Wolf, 2020/04/24
- [PATCH v7 01/10] block: Add flags to BlockDriver.bdrv_co_truncate(), Kevin Wolf, 2020/04/24
- [PATCH v7 08/10] iotests: Filter testfiles out in filter_img_info(), Kevin Wolf, 2020/04/24
- [PATCH v7 09/10] iotests: Test committing to short backing file, Kevin Wolf, 2020/04/24
- [PATCH v7 06/10] file-posix: Support BDRV_REQ_ZERO_WRITE for truncate, Kevin Wolf, 2020/04/24
- Re: [PATCH v7 00/10] block: Fix resize (extending) of short overlays, Max Reitz, 2020/04/24
- [PATCH v7 10/10] qcow2: Forward ZERO_WRITE flag for full preallocation, Kevin Wolf, 2020/04/24
- Re: [PATCH v7 00/10] block: Fix resize (extending) of short overlays, Kevin Wolf, 2020/04/27