[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/5] block/mirror: support unaligned write in active mirro
From: |
Max Reitz |
Subject: |
Re: [PATCH v2 4/5] block/mirror: support unaligned write in active mirror |
Date: |
Fri, 18 Oct 2019 17:51:37 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 |
On 11.10.19 11:07, Vladimir Sementsov-Ogievskiy wrote:
> Prior 9adc1cb49af8d do_sync_target_write had a bug: it reset aligned-up
> region in the dirty bitmap, which means that we may not copy some bytes
> and assume them copied, which actually leads to producing corrupted
> target.
>
> So 9adc1cb49af8d forced dirty bitmap granularity to be
> request_alignment for mirror-top filter, so we are not working with
> unaligned requests. However forcing large alignment obviously decreases
> performance of unaligned requests.
>
> This commit provides another solution for the problem: if unaligned
> padding is already dirty, we can safely ignore it, as
> 1. It's dirty, it will be copied by mirror_iteration anyway
> 2. It's dirty, so skipping it now we don't increase dirtiness of the
> bitmap and therefore don't damage "synchronicity" of the
> write-blocking mirror.
>
> If unaligned padding is not dirty, we just write it, no reason to touch
> dirty bitmap if we succeed (on failure we'll set the whole region
> ofcourse, but we loss "synchronicity" on failure anyway).
>
> Note: we need to disable dirty_bitmap, otherwise we will not be able to
> see in do_sync_target_write bitmap state before current operation. We
> may of course check dirty bitmap before the operation in
> bdrv_mirror_top_do_write and remember it, but we don't need active
> dirty bitmap for write-blocking mirror anyway.
>
> New code-path is unused until the following commit reverts
> 9adc1cb49af8d.
>
> Suggested-by: Denis V. Lunev <address@hidden>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> block/mirror.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 68 insertions(+), 3 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- [PATCH v2 0/5] active-mirror: support unaligned guest operations, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [PATCH v2 3/5] block/block-backend: add blk_co_pwritev_part, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [PATCH v2 2/5] block/mirror: simplify do_sync_target_write, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [PATCH v2 4/5] block/mirror: support unaligned write in active mirror, Vladimir Sementsov-Ogievskiy, 2019/10/11
- Re: [PATCH v2 4/5] block/mirror: support unaligned write in active mirror,
Max Reitz <=
- [PATCH v2 5/5] Revert "mirror: Only mirror granularity-aligned chunks", Vladimir Sementsov-Ogievskiy, 2019/10/11
- [PATCH v2 1/5] hbitmap: handle set/reset with zero length, Vladimir Sementsov-Ogievskiy, 2019/10/11
- Re: [PATCH v2 0/5] active-mirror: support unaligned guest operations, Max Reitz, 2019/10/18