From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>, Max Reitz <mreitz@redhat.com>,
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com, famz@redhat.com,
den@openvz.org, stefanha@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v22 19/30] qcow2: add persistent dirty bitmaps support
Date: Fri, 30 Jun 2017 13:28:04 -0500 [thread overview]
Message-ID: <300b367a-cc70-612f-70d0-7a447b720f22@redhat.com> (raw)
In-Reply-To: <fc19b4a1-081e-008d-5573-59e29419786f@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3642 bytes --]
On 06/30/2017 12:58 PM, John Snow wrote:
>>
>> "Structure of a bitmap directory entry:
>> ...
>> 8 - 11: bitmap_table_size
>> Number of entries in the bitmap table of the bitmap."
>>
>
> This is the number of bitmaps stored in the qcow2, not the size of one
> particular bitmap.
No, I was quoting from "Structure of a bitmap directory entry" (the same
struct that also includes a per-bitmap granularity).
However, on re-reading the difference between the bitmap table and the
bitmap data, I see that the bitmap_table_size it formally the number of
cluster mappings that the bitmap occupies - so while it is not a precise
size of the bitmap, it IS an approximation (where scaling has introduced
lost precision for all sizes that map within the final cluster). But my
point remains - we have some imprecision on whether bitmap_table_size
has to be clamped to the same number as you would get if the current
virtual disk size is converted into bitmaps, or whether it is valid to
have a qcow2 file where a bitmap table contains fewer cluster mappings
than would be required to cover the whole virtual file, or conversely
contains more cluster mappings than what you get even when rounding the
virtual table size up to the bitmap granularity and further scaled by
how many bits fit per cluster.
Concretely, if I'm using 512-byte clusters (the qcow2 minimum), and
qcow2 forces me to use a bitmap granularity no smaller than 9 (each bit
of the bitmap covers 512 bytes), then one cluster of bitmap data covers
2M of virtual size. If I have an image with a virtual size of exactly
4M, and a bitmap covering that image, then my bitmap table _should_ have
exactly two mappings (bitmap_table_size should be 2, because it required
2 8-byte entries in the table to give the mapping for the 2 clusters
used to contain all the bits of the bitmap; the remaining 496 bytes of
the bitmap table should be 0 because there are no further mappings).
But note that any size in the range (2M, 4M] as the same
bitmap_table_size of 2 for that granularity.
If the bitmap is tied to the image (has the 'auto' and/or 'dirty' bit
set), then I agree that the bitmap size should match the virtual image
size. But if the bitmap is independent, what technical reason do we
have that prevents us from having a bitmap covering 2M or less of data
(bitmap_table_size of 1), or more than 4M of data (bitmap_table_size of
3 or more), even though it has no relation to the current virtual image
size of 4M?
Meanwhile, if I use a bitmap granularity of 1k instead of 512, in the
same image with 512-byte clusters, a virtual size of 2M is
indistinguishable from a virtual size of 4M (both bitmaps fit within a
single cluster, or bitmap_table_size of 1; although the 2M case only
uses 256 of the 512 bytes in the bitmap data cluster).
I'm worried that we are too strict in stating that ALL bitmaps are tied
to the current virtual image size, but I'm also worried that our spec
might not be strict enough in enforcing that certain bitmaps MUST match
the virtual size (if the bitmap is automatically tracking writes to the
virtual image); and also worried whether we are setting ourselves up for
obscure failures based on the interaction of resize and/or internal
snapshots when bitmaps are in play (or whether we are being conservative
and forbidding those interactions until we've had time to further prove
that we handle their interaction safely).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-06-30 18:28 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 12:05 [Qemu-devel] [PATCH v22 00/30] qcow2: persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 01/30] specs/qcow2: fix bitmap granularity qemu-specific note Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 02/30] specs/qcow2: do not use wording 'bitmap header' Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 03/30] hbitmap: improve dirty iter Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 04/30] tests: add hbitmap iter test Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 05/30] block: fix bdrv_dirty_bitmap_granularity signature Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 06/30] block/dirty-bitmap: add deserialize_ones func Vladimir Sementsov-Ogievskiy
2017-06-30 1:55 ` Eric Blake
2017-06-30 2:01 ` Eric Blake
2017-06-30 17:52 ` John Snow
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 07/30] qcow2-refcount: rename inc_refcounts() and make it public Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 08/30] qcow2: add bitmaps extension Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 09/30] block/dirty-bitmap: fix comment for BlockDirtyBitmap.disabled field Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 10/30] block/dirty-bitmap: add readonly field to BdrvDirtyBitmap Vladimir Sementsov-Ogievskiy
2017-06-30 1:21 ` Max Reitz
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 11/30] qcow2: autoloading dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-06-30 1:35 ` Eric Blake
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 12/30] block: refactor bdrv_reopen_commit Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 13/30] block: new bdrv_reopen_bitmaps_rw interface Vladimir Sementsov-Ogievskiy
2017-06-28 12:10 ` Vladimir Sementsov-Ogievskiy
2017-06-28 12:36 ` Eric Blake
2017-06-28 13:02 ` Vladimir Sementsov-Ogievskiy
2017-06-28 13:13 ` Vladimir Sementsov-Ogievskiy
2017-06-28 13:34 ` Vladimir Sementsov-Ogievskiy
2017-06-28 13:31 ` Paolo Bonzini
2017-06-28 14:36 ` Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 14/30] qcow2: support .bdrv_reopen_bitmaps_rw Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 15/30] block/dirty-bitmap: add autoload field to BdrvDirtyBitmap Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 16/30] block: bdrv_close: release bitmaps after drv->bdrv_close Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 17/30] block: introduce persistent dirty bitmaps Vladimir Sementsov-Ogievskiy
2017-06-30 1:43 ` Eric Blake
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 18/30] block/dirty-bitmap: add bdrv_dirty_bitmap_next() Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 19/30] qcow2: add persistent dirty bitmaps support Vladimir Sementsov-Ogievskiy
2017-06-30 2:18 ` Eric Blake
2017-06-30 2:23 ` Max Reitz
2017-06-30 17:47 ` Eric Blake
2017-06-30 17:58 ` John Snow
2017-06-30 18:28 ` Eric Blake [this message]
2017-07-02 14:01 ` Max Reitz
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 20/30] qcow2: store bitmaps on reopening image as read-only Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 21/30] block: add bdrv_can_store_new_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 22/30] qcow2: add .bdrv_can_store_new_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 23/30] qmp: add persistent flag to block-dirty-bitmap-add Vladimir Sementsov-Ogievskiy
2017-07-07 7:54 ` Markus Armbruster
2017-07-07 8:07 ` Vladimir Sementsov-Ogievskiy
2017-07-07 12:21 ` Vladimir Sementsov-Ogievskiy
2017-07-07 13:25 ` Markus Armbruster
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 24/30] qmp: add autoload parameter " Vladimir Sementsov-Ogievskiy
2017-07-07 7:54 ` Markus Armbruster
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 25/30] qmp: add x-debug-block-dirty-bitmap-sha256 Vladimir Sementsov-Ogievskiy
2017-07-07 8:05 ` Markus Armbruster
2017-07-07 8:13 ` Daniel P. Berrange
2017-07-07 9:00 ` Markus Armbruster
2017-07-07 12:43 ` Vladimir Sementsov-Ogievskiy
2017-07-07 13:53 ` Markus Armbruster
2017-07-07 20:57 ` John Snow
2017-07-10 6:49 ` Markus Armbruster
2017-07-10 16:29 ` John Snow
2017-07-07 12:30 ` [Qemu-devel] [Qemu-block] " Eric Blake
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 26/30] iotests: test qcow2 persistent dirty bitmap Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 27/30] block/dirty-bitmap: add bdrv_remove_persistent_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 28/30] qcow2: add .bdrv_remove_persistent_dirty_bitmap Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 29/30] qmp: block-dirty-bitmap-remove: remove persistent Vladimir Sementsov-Ogievskiy
2017-06-28 12:05 ` [Qemu-devel] [PATCH v22 30/30] block: release persistent bitmaps on inactivate Vladimir Sementsov-Ogievskiy
2017-06-28 13:01 ` [Qemu-devel] [PATCH v22 00/30] qcow2: persistent dirty bitmaps Paolo Bonzini
2017-06-28 13:53 ` Vladimir Sementsov-Ogievskiy
2017-06-29 21:16 ` John Snow
2017-06-30 2:38 ` Max Reitz
2017-11-17 16:04 ` Eric Blake
2017-11-17 16:17 ` Vladimir Sementsov-Ogievskiy
2017-11-17 16:56 ` Eric Blake
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=300b367a-cc70-612f-70d0-7a447b720f22@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=famz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@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 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).