qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>,
	"jsnow@redhat.com" <jsnow@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Denis Lunev <den@virtuozzo.com>
Subject: Re: [PATCH 3/4] block/mirror: support unaligned write in active mirror
Date: Thu, 3 Oct 2019 09:34:43 +0000	[thread overview]
Message-ID: <5b267415-519f-f4ca-29d0-1bc9753b29f3@virtuozzo.com> (raw)
In-Reply-To: <3dc81329-443a-288c-0ea1-4190dfc33f5e@redhat.com>

02.10.2019 18:52, Max Reitz wrote:
> On 02.10.19 17:06, Vladimir Sementsov-Ogievskiy wrote:
>> 02.10.2019 18:03, Vladimir Sementsov-Ogievskiy wrote:
>>> 02.10.2019 17:57, Max Reitz wrote:
>>>> On 12.09.19 17:13, 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.
>>>>
>>>> But that’s not what active mirror is for.  The point of active mirror is
>>>> that it must converge because every guest write will contribute towards
>>>> that goal.
>>>>
>>>> If you skip active mirroring for unaligned guest writes, they will not
>>>> contribute towards converging, but in fact lead to the opposite.
>>>>
>>>
>>> The will not contribute only if region is already dirty. Actually, after
>>> first iteration of mirroring (copying the whole disk), all following writes
>>> will contribute, so the whole process must converge. It is a bit similar with
>>> running one mirror loop in normal mode, and then enable write-blocking.
>>>
>>
>>
>> In other words, we don't need "all guest writes contribute" to converge,
>> "all guest writes don't create new dirty bits" is enough, as we have parallel
>> mirror iteration which contiguously handles dirty bits.
> 
> Hm, in a sense.  But it does mean that guest writes will not contribute
> to convergence.
> 
> And that’s against the current definition of write-blocking, which does
> state that “when data is written to the source, write it (synchronously)
> to the target as well”.
> 

Hmm, understand. But IMHO our proposed behavior is better in general.
Do you think it's a problem to change spec now?
If yes, I'll resend with an option


-- 
Best regards,
Vladimir

  reply	other threads:[~2019-10-03  9:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12 15:13 [Qemu-devel] [PATCH 0/4] active-mirror: support unaligned guest operations Vladimir Sementsov-Ogievskiy
2019-09-12 15:13 ` [Qemu-devel] [PATCH 1/4] block/mirror: simplify do_sync_target_write Vladimir Sementsov-Ogievskiy
2019-10-02 14:57   ` Max Reitz
2019-09-12 15:13 ` [Qemu-devel] [PATCH 2/4] block/block-backend: add blk_co_pwritev_part Vladimir Sementsov-Ogievskiy
2019-10-02 14:57   ` Max Reitz
2019-09-12 15:13 ` [Qemu-devel] [PATCH 3/4] block/mirror: support unaligned write in active mirror Vladimir Sementsov-Ogievskiy
2019-10-02 14:57   ` Max Reitz
2019-10-02 15:03     ` Vladimir Sementsov-Ogievskiy
2019-10-02 15:06       ` Vladimir Sementsov-Ogievskiy
2019-10-02 15:52         ` Max Reitz
2019-10-03  9:34           ` Vladimir Sementsov-Ogievskiy [this message]
2019-10-04 12:59             ` Max Reitz
2019-10-04 13:22               ` Vladimir Sementsov-Ogievskiy
2019-10-04 14:48                 ` Max Reitz
2019-10-04 15:04                   ` Vladimir Sementsov-Ogievskiy
2019-10-04 15:27                     ` Max Reitz
2019-10-04 15:38                       ` Vladimir Sementsov-Ogievskiy
2019-10-04 16:31   ` Max Reitz
2019-10-11  8:33     ` Vladimir Sementsov-Ogievskiy
2019-10-11  8:58       ` Max Reitz
2019-10-11  9:09         ` Vladimir Sementsov-Ogievskiy
2019-10-11  9:10         ` Vladimir Sementsov-Ogievskiy
2019-09-12 15:13 ` [Qemu-devel] [PATCH 4/4] Revert "mirror: Only mirror granularity-aligned chunks" Vladimir Sementsov-Ogievskiy
2019-10-04 16:33   ` Max Reitz
2019-10-02  9:53 ` [PATCH 0/4] active-mirror: support unaligned guest operations Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b267415-519f-f4ca-29d0-1bc9753b29f3@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@virtuozzo.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).