[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 07/20] dirty-bitmap: Track bitmap size by byt
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [PATCH v7 07/20] dirty-bitmap: Track bitmap size by bytes |
Date: |
Wed, 13 Sep 2017 20:05:13 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/12/2017 04:31 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). 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.
>
> Use is_power_of_2() while at it, instead of open-coding that.
>
> Signed-off-by: Eric Blake <address@hidden>
>
Reviewed-by: John Snow <address@hidden>
- [Qemu-devel] [PATCH v7 01/20] block: Make bdrv_img_create() size selection easier to read, (continued)
- [Qemu-devel] [PATCH v7 01/20] block: Make bdrv_img_create() size selection easier to read, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 02/20] hbitmap: Rename serialization_granularity to serialization_align, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 03/20] qcow2: Ensure bitmap serialization is aligned, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 04/20] dirty-bitmap: Drop unused functions, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 05/20] dirty-bitmap: Check for size query failure during truncate, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 06/20] dirty-bitmap: Change bdrv_dirty_bitmap_size() to report bytes, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 07/20] dirty-bitmap: Track bitmap size by bytes, Eric Blake, 2017/09/12
- Re: [Qemu-devel] [PATCH v7 07/20] dirty-bitmap: Track bitmap size by bytes,
John Snow <=
- [Qemu-devel] [PATCH v7 08/20] dirty-bitmap: Change bdrv_dirty_bitmap_*serialize*() to take bytes, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 09/20] qcow2: Switch sectors_covered_by_bitmap_cluster() to byte-based, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 11/20] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 10/20] dirty-bitmap: Set iterator start by offset, not sector, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 12/20] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes, Eric Blake, 2017/09/12
- [Qemu-devel] [PATCH v7 13/20] dirty-bitmap: Change bdrv_get_dirty_locked() to take bytes, Eric Blake, 2017/09/12