[PATCH 0/9] block: cheaper zero handling in backup and commit

Denis V. Lunev posted 9 patches 4 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260828144554.1741910-1-den@openvz.org
Maintainers: John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
There is a newer version of this series
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(-)
[PATCH 0/9] block: cheaper zero handling in backup and commit
Posted by Denis V. Lunev 4 weeks, 1 day ago
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