[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 04/10] block: Support meta dirty bitmap
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH v6 04/10] block: Support meta dirty bitmap |
Date: |
Mon, 18 Jul 2016 16:57:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 15.07.2016 22:27, John Snow wrote:
> From: Fam Zheng <address@hidden>
>
> The added group of operations enables tracking of the changed bits in
> the dirty bitmap.
>
> Signed-off-by: Fam Zheng <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> Signed-off-by: John Snow <address@hidden>
> ---
> block/dirty-bitmap.c | 52
> ++++++++++++++++++++++++++++++++++++++++++++
> include/block/dirty-bitmap.h | 9 ++++++++
> 2 files changed, 61 insertions(+)
>
> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
> index 628b77c..9c53c56 100644
> --- a/block/dirty-bitmap.c
> +++ b/block/dirty-bitmap.c
> @@ -38,6 +38,7 @@
[...]
> +int bdrv_dirty_bitmap_get_meta(BlockDriverState *bs,
> + BdrvDirtyBitmap *bitmap, int64_t sector,
> + int nb_sectors)
> +{
> + uint64_t i;
> + int gran = bdrv_dirty_bitmap_granularity(bitmap) >> BDRV_SECTOR_BITS;
> +
> + /* To optimize: we can make hbitmap to internally check the range in a
> + * coarse level, or at least do it word by word. */
So you really want to leave even the simple optimizations for later? :-)
(i.e. "int gran = hbitmap_granularity(bitmap->meta);")
Max
> + for (i = sector; i < sector + nb_sectors; i += gran) {
> + if (hbitmap_get(bitmap->meta, i)) {
> + return true;
> + }
> + }
> + return false;
> +}
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v6 00/10] Dirty bitmap changes for migration/persistence work, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 02/10] HBitmap: Introduce "meta" bitmap to track bit changes, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 03/10] tests: Add test code for meta bitmap, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 04/10] block: Support meta dirty bitmap, John Snow, 2016/07/15
- Re: [Qemu-devel] [PATCH v6 04/10] block: Support meta dirty bitmap,
Max Reitz <=
- [Qemu-devel] [PATCH v6 01/10] block: Hide HBitmap in block dirty bitmap interface, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 08/10] block: BdrvDirtyBitmap serialization interface, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 06/10] block: Assert that bdrv_release_dirty_bitmap succeeded, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 05/10] block: Add two dirty bitmap getters, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 07/10] hbitmap: serialization, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 10/10] block: More operations for meta dirty bitmap, John Snow, 2016/07/15
- [Qemu-devel] [PATCH v6 09/10] tests: Add test code for hbitmap serialization, John Snow, 2016/07/15