Backup and commit re-query the source block status for every task and
size a task by the copy buffer, so a long run of zeroes turns into a
crowd of small write-zeroes requests. This series reuses what the
up-front scan already learned and lets one write-zeroes task cover a
whole run.
Backup of a 16G qcow2 image holding 1G of data, the rest never
allocated, sync=full to a raw target on ext4:
tasks time
before 16384 1.6s
after 1088 1.0s
Such an image is the normal case rather than a corner one: a guest with
discard enabled on a disk which is mostly free leaves exactly this
shape behind.
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
CC: John Snow <jsnow@redhat.com>
CC: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
Denis V. Lunev (9):
block/commit: pass BDRV_WANT_PRECISE to block-status
iotests/040: cover large and fragmented commit runs
block/commit: batch block-status queries
iotests/124: cover backup of zero clusters and holes
block/block-copy: don't reserve memory for zero tasks
block/block-copy: extract block_copy_set_task_method()
block/block-copy: track known-zero source clusters
block/backup: pre-fill zero_bitmap for full/bitmap
block/block-copy: coalesce write-zeroes tasks
block/backup.c | 93 ++++++---
block/block-copy.c | 239 +++++++++++++++++++---
block/commit.c | 50 ++++-
include/block/block-copy.h | 5 +
tests/qemu-iotests/040 | 95 ++++++++-
tests/qemu-iotests/040.out | 4 +-
tests/qemu-iotests/124 | 402 ++++++++++++++++++++++++++++++++++++-
tests/qemu-iotests/124.out | 4 +-
8 files changed, 811 insertions(+), 81 deletions(-)
base-commit: 0a1ebd448b38afaa118597cbb633dbec24ef74d3
--
2.53.0