[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [RFC PATCH 28/56] block: Widen dirty bitma
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [RFC PATCH 28/56] block: Widen dirty bitmap granularity to uint64_t for safety |
Date: |
Tue, 8 Aug 2017 09:55:19 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 08/07/2017 08:55 PM, John Snow wrote:
>
>
> On 08/07/2017 10:45 AM, Markus Armbruster wrote:
>> Block dirty bitmaps represent granularity in bytes as uint32_t. It
>> must be a power of two and a multiple of BDRV_SECTOR_SIZE.
>>
>> The trouble with uint32_t is computations like this one in
>> mirror_do_read():
>>
>> uint64_t max_bytes;
>>
>> max_bytes = s->granularity * s->max_iov;
>>
>> The operands of * are uint32_t and int, so the product is computed in
>> uint32_t (assuming 32 bit int), then zero-extended to uint64_t.
>>
>> Since granularity is generally combined with 64 bit file offsets, it's
>> best to make it 64 bits, too. Less opportunity to screw up.
And definitely conflicts with my work on byte-based block status.
>>
>> -uint32_t bdrv_dirty_bitmap_meta_granularity(BdrvDirtyBitmap *bitmap)
>> -{
>> - return BDRV_SECTOR_SIZE << hbitmap_granularity(bitmap->meta);
>> -}
>
> Why? Unused? Not cool enough to mention?
Already deleted as unused in my byte-based series.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [RFC PATCH 49/56] block: Make ImageCheck file offset unsigned in QAPI, (continued)
- [Qemu-block] [RFC PATCH 49/56] block: Make ImageCheck file offset unsigned in QAPI, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 52/56] block/nfs: Reject negative readahead-size, page-cache-size, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 30/56] block: Make write thresholds unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 40/56] blockjob: Lift speed sign conversion out of backup_job_create(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 48/56] block: Make mirror buffer size unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 54/56] qemu-img: blk_getlength() can fail, fix img_map() to check, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 46/56] blockjob: Make job commands' speed parameter unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 38/56] blockjob: Lift speed sign conversion out of block_job_set_speed(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 28/56] block: Widen dirty bitmap granularity to uint64_t for safety, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 50/56] block: Make BLOCK_IMAGE_CORRUPTED offset, size unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 55/56] block: Make MapEntry offsets and size unsigned in QAPI, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 56/56] crypto: Make QCryptoBlockInfoLUKS offsets unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 42/56] blockjob: Lift speed sign conversion out of stream_start(), Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 34/56] block: Make BlockDeviceStats sizes, offsets unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 14/56] migration: Fix migrate-set-cache-size error reporting, Markus Armbruster, 2017/08/07
- [Qemu-block] [RFC PATCH 47/56] blockjob: Make BlockJobInfo and event offsets unsigned in QAPI/QMP, Markus Armbruster, 2017/08/07