All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: John Snow <jsnow@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, armbru@redhat.com,
	stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH 09/25] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap
Date: Wed, 7 Jun 2017 14:40:35 +0200	[thread overview]
Message-ID: <df3d9424-49f4-172a-8b9e-08fbdf5b062a@redhat.com> (raw)
In-Reply-To: <f733fb1b-b625-e809-9740-7c093651c2d8@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2460 bytes --]

On 2017-06-02 00:29, John Snow wrote:
> 
> 
> On 05/31/2017 09:43 AM, Max Reitz wrote:
>> On 2017-05-30 08:50, Vladimir Sementsov-Ogievskiy wrote:
>>> Thank you for this scenario. Hmm.
>>>
>>> So, as I need guarantee that image and bitmap are unchanged,
>>> bdrv_set_dirty should return error and fail the whole write. Ok?
>>
>> I don't know. That would mean that you couldn't commit to an image that
>> has a persistent auto-loading bitmap, which doesn't seem very nice to me.
>>
>> I'm not quite sure what to do myself. So first I'd definitely want the
>> commit operation to succeed. That means we'd have to automatically make
>> the bitmap non-readonly once we write to it. The "readonly" flag would
>> then be an "unchanged" flag, rather, to signify that the bitmap has not
>> been changed since it was loaded, which means that it does not need to
>> be written back to the image file.
>>
>> Now the issue remains that if you modify a persistent bitmap that is
>> stored in an image file that is opened RO when it's closed, you won't be
>> able to write the modifications back.
>>> So in addition, I guess we'd need to "flush" all persistent bitmaps
>> (that is, write all modifications back to the file and set the
>> "unchanged" flag (you could also call it "dirty" and then mean the
>> opposite) for each bitmap) not only when the image is closed or
>> invalidated, but also when it is reopened read-only.
>>
> 
> Makes sense.
> 
>> (block-commit reopens the backing BDS R/W, then writes to them, thus
>> modifying the dirty bitmaps, and finally reopens the BDS as read-only;
>> before that happens, we will have to flush the modified bitmap data.)
>>
> 
> OK, so it would perhaps be enough to toggle the RO flag on/off when
> nodes get reopened. When they get reopened RO, we'd need to flush at
> that point.
> 
> (Right?)

Right.

> Of course, a changed flag makes this a little moot as it is probably
> more flexible; but there is something slightly attractive about the more
> rigid form.
> 
> (Hmm, for the purposes of periodic flushing, we may want a changed flag
> anyway...)

I don't mind either way. I like a dirty flag because this is a common
concept (we basically cache the persistent bitmaps in RAM, so it's
natural for them to have a dirty/clean state); but I also like keeping
the read-only flag because it's probably simpler to implement (and makes
just as much sense).

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 498 bytes --]

  reply	other threads:[~2017-06-07 12:40 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 12:25 [Qemu-devel] [PATCH v18 00/25] qcow2: persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 01/25] specs/qcow2: fix bitmap granularity qemu-specific note Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 02/25] specs/qcow2: do not use wording 'bitmap header' Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 03/25] hbitmap: improve dirty iter Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 04/25] tests: add hbitmap iter test Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 05/25] block: fix bdrv_dirty_bitmap_granularity signature Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 06/25] block/dirty-bitmap: add deserialize_ones func Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 07/25] qcow2-refcount: rename inc_refcounts() and make it public Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 08/25] qcow2: add bitmaps extension Vladimir Sementsov-Ogievskiy
2017-05-29 15:34   ` Max Reitz
2017-05-03 12:25 ` [Qemu-devel] [PATCH 09/25] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap Vladimir Sementsov-Ogievskiy
2017-05-19 23:02   ` John Snow
2017-05-25  9:34     ` Vladimir Sementsov-Ogievskiy
2017-05-31 22:58     ` John Snow
2017-06-01  7:23       ` Sementsov-Ogievskiy Vladimir
2017-05-29 15:49   ` Max Reitz
2017-05-29 18:35   ` Max Reitz
2017-05-30  6:50     ` Vladimir Sementsov-Ogievskiy
2017-05-30  7:31       ` Vladimir Sementsov-Ogievskiy
2017-05-30  7:47         ` Vladimir Sementsov-Ogievskiy
2017-05-31 13:43       ` Max Reitz
2017-05-31 14:29         ` Vladimir Sementsov-Ogievskiy
2017-05-31 14:44           ` Max Reitz
2017-05-31 15:05             ` Vladimir Sementsov-Ogievskiy
2017-05-31 15:53               ` Max Reitz
2017-06-01 22:35                 ` John Snow
2017-06-01 22:29         ` John Snow
2017-06-07 12:40           ` Max Reitz [this message]
2017-05-03 12:25 ` [Qemu-devel] [PATCH 10/25] qcow2: autoloading dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-05-29 16:17   ` Max Reitz
2017-05-03 12:25 ` [Qemu-devel] [PATCH 11/25] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 12/25] block: bdrv_close: release bitmaps after drv->bdrv_close Vladimir Sementsov-Ogievskiy
2017-05-29 16:34   ` Max Reitz
2017-05-03 12:25 ` [Qemu-devel] [PATCH 13/25] block: introduce persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-05-29 16:49   ` Max Reitz
2017-05-03 12:25 ` [Qemu-devel] [PATCH 14/25] block/dirty-bitmap: add bdrv_dirty_bitmap_next() Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 15/25] qcow2: add persistent dirty bitmaps support Vladimir Sementsov-Ogievskiy
2017-05-29 17:07   ` Max Reitz
2017-05-03 12:25 ` [Qemu-devel] [PATCH 16/25] block: add bdrv_can_store_new_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 17/25] qcow2: add .bdrv_can_store_new_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 18/25] qmp: add persistent flag to block-dirty-bitmap-add Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 19/25] qmp: add autoload parameter " Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 20/25] qmp: add x-debug-block-dirty-bitmap-sha256 Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 21/25] iotests: test qcow2 persistent dirty bitmap Vladimir Sementsov-Ogievskiy
2017-05-29 17:31   ` Max Reitz
2017-05-03 12:25 ` [Qemu-devel] [PATCH 22/25] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 23/25] qcow2: add .bdrv_remove_persistent_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-05-03 12:25 ` [Qemu-devel] [PATCH 24/25] qmp: block-dirty-bitmap-remove: remove persistent Vladimir Sementsov-Ogievskiy
2017-05-29 17:38   ` Max Reitz
2017-05-03 12:25 ` [Qemu-devel] [PATCH 25/25] block: release persistent bitmaps on inactivate Vladimir Sementsov-Ogievskiy
2017-05-29 17:54   ` Max Reitz
2017-05-30  6:30     ` Vladimir Sementsov-Ogievskiy
2017-05-31 13:37       ` Max Reitz
2017-05-15  9:51 ` [Qemu-devel] ping Re: [PATCH v18 00/25] qcow2: persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-05-27  9:05   ` [Qemu-devel] ping2 " Vladimir Sementsov-Ogievskiy
2017-05-30  8:16 [Qemu-devel] [PATCH v19 " Vladimir Sementsov-Ogievskiy
2017-05-30  8:17 ` [Qemu-devel] [PATCH 09/25] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap Vladimir Sementsov-Ogievskiy
2017-05-31 23:48   ` John Snow
2017-06-01  7:30     ` Sementsov-Ogievskiy Vladimir
2017-06-01 18:55       ` John Snow
2017-06-01 23:25       ` John Snow
2017-06-02  8:56         ` Vladimir Sementsov-Ogievskiy
2017-06-02  9:01           ` Vladimir Sementsov-Ogievskiy
2017-06-02  9:45             ` Vladimir Sementsov-Ogievskiy
2017-06-02 18:46               ` John Snow
2017-06-03 17:02                 ` Sementsov-Ogievskiy Vladimir

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=df3d9424-49f4-172a-8b9e-08fbdf5b062a@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vsementsov@virtuozzo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.