On 28.05.25 15:07, Andrey Zhadchenko wrote:
HBitmaps allow us to search set bits pretty fast. On the contrary,
when searching zeroes, we may be forced to fully traverse the lower
level.
When we run blockdev-backup with mode=full on top of snapshot filter
+ cbw filter, the job fills copy bitmap by calling block_status()
with range (X, virtual_size). The problem is that we check for zeroes
in this whole range. We also hit the worst case here, as access
bitmap is fully set and we need to scan the entire lowest level.
After scanning the full bitmap we actually ask the block status of
original image, which may return significantly lower amount of empty
clusters.
Beacuse of this, the backup job 'hangs' on block copy initializaiton
for a long time with 100% CPU.
Example copy bitmap buildup time for image with clu_size=65536 and
preallocated metadata
size 10T 11T
blockdev-backup 52s 57s
cbw + snap 325s 413s
cbw + snap + patch 55s 61s
To fix it, inverse the access bitmap in cbw filter: rather set it
when the user is not allowed to read the cluster.
Update qemu-iotest 257: now access bitmap have count 0 instead of
the image size 67108864
Signed-off-by: Andrey Zhadchenko<andrey.zhadche...@virtuozzo.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>
--
Best regards,
Vladimir