[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 05/18] dirty-bitmap: Change bdrv_dirty_bitmap
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [PATCH v5 05/18] dirty-bitmap: Change bdrv_dirty_bitmap_size() to report bytes |
Date: |
Thu, 13 Jul 2017 13:37:44 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/12/2017 09:05 PM, Eric Blake wrote:
> We are still using an internal hbitmap that tracks a size in sectors,
> with the granularity scaled down accordingly, because it lets us
> use a shortcut for our iterators which are currently sector-based.
> But there's no reason we can't track the dirty bitmap size in bytes,
> since it is (mostly) an internal-only variable (remember, the size
> is how many bytes are covered by the bitmap, not how many bytes the
> bitmap occupies). Furthermore, we're already reporting bytes for
> bdrv_dirty_bitmap_granularity(); mixing bytes and sectors in our
> return values is a recipe for confusion. A later cleanup will
> convert dirty bitmap internals to be entirely byte-based,
> eliminating the intermediate sector rounding added here; and
> technically, since bdrv_getlength() already rounds up to sectors,
> our use of DIV_ROUND_UP is more for theoretical completeness than
> for any actual rounding.
>
> The only external caller in qcow2-bitmap.c is temporarily more verbose
> (because it is still using sector-based math), but will later be
> switched to track progress by bytes instead of sectors.
>
> Use is_power_of_2() while at it, instead of open-coding that, and
> add an assertion where bdrv_getlength() should not fail.
>
> Signed-off-by: Eric Blake <address@hidden>
>
Reviewed-by: John Snow <address@hidden>
- [Qemu-devel] [PATCH v5 00/18] make dirty-bitmap byte-based, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 01/18] dirty-bitmap: Report BlockDirtyInfo.count in bytes, as documented, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 02/18] hbitmap: Rename serialization_granularity to serialization_align, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 03/18] qcow2: Ensure bitmap serialization is aligned, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 04/18] dirty-bitmap: Drop unused functions, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 05/18] dirty-bitmap: Change bdrv_dirty_bitmap_size() to report bytes, Eric Blake, 2017/07/12
- Re: [Qemu-devel] [PATCH v5 05/18] dirty-bitmap: Change bdrv_dirty_bitmap_size() to report bytes,
John Snow <=
- [Qemu-devel] [PATCH v5 07/18] qcow2: Switch sectors_covered_by_bitmap_cluster() to byte-based, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 08/18] dirty-bitmap: Set iterator start by offset, not sector, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 09/18] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 06/18] dirty-bitmap: Change bdrv_dirty_bitmap_*serialize*() to take bytes, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 10/18] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 11/18] dirty-bitmap: Change bdrv_get_dirty_locked() to take bytes, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 12/18] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 13/18] mirror: Switch mirror_dirty_init() to byte-based iteration, Eric Blake, 2017/07/12
- [Qemu-devel] [PATCH v5 14/18] qcow2: Switch qcow2_measure() to byte-based iteration, Eric Blake, 2017/07/12