All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com,
	crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com,
	pbonzini@redhat.com, jsnow@redhat.com, mreitz@redhat.com,
	kwolf@redhat.com, den@openvz.org
Subject: Re: [PATCH v2 08/33] block/backup: drop support for copy_range
Date: Fri, 28 May 2021 18:29:29 +0300	[thread overview]
Message-ID: <c54a78a1-1276-e5f7-2fe1-e7348116b83b@virtuozzo.com> (raw)
In-Reply-To: <20210520142205.607501-9-vsementsov@virtuozzo.com>

20.05.2021 17:21, Vladimir Sementsov-Ogievskiy wrote:
> copy_range is not a default behavior since 6a30f663d4c0b3c, and it's
> now available only though x-perf experimantal argument, so it's OK to
> drop it.
> 
> Even when backup is used to copy disk to same filesystem, and
> filesystem supports zero-copy copy_range, copy_range is probably not
> what we want for backup: backup has good property of making a copy of
> active disk, with no impact to active disk itself (unlike creating a
> snapshot). And if copy_range instead of copying data adds fs-level
> references, and on next guest write COW operation occurs, it's seems
> most possible, that new block will be allocated for original vm disk,
> not for backup disk. Thus, fragmentation of original disk will
> increase.
> 
> We can simply add support back on demand. Now we want to publish
> copy-before-write filter, and instead of thinking how to pass
> use-copy-range argument to block-copy (create x-block-copy parameter
> for new public filter driver, or may be set it by hand after filter
> node creation?), instead of this let's just drop copy-range support in
> backup for now.
> 
> After this patch copy-range support in block-copy becomes unused. Let's
> keep it for a while, it won't hurt:
> 
> 1. If there would be request for supporting copy_range in backup
>     (and/or in a new public copy-before-write filter), it will be easy
>     to satisfy it.
> 
> 2. Probably, qemu-img convert will reuse block-copy, and qemu-img has
>     option to enable copy-range. qemu-img convert is not a backup, and
>     copy_range may be more reasonable for some cases in context of
>     qemu-img convert.
> 

Actually, I know one case, where copy_range for backup job may be reasonable:

Using backup in push-backup with fleecing scheme in

    [PATCH 0/6] push backup with fleecing

Of-course, no real sense in using push-backup-with-fleecing scheme with both temp image and final backup target being on the same file system (no benefit of fleecing, we can use simple backup without temporary image).

But we absolutely don't care about fragmentation of temp disk.

Still, it doesn't make sense, as temp-image and real-backup-target should not be on same file-system..

Could it be some distributed filesystem, where it still make sense to call copy_range? Theoretically could.


Another thought: I'm going also to implement RAM-cache driver, to optimize push-backup-with-fleecing scheme. I'll need a way to copy data from RAM-cache node to final-target. I can implement copy_range for RAM-cache, and this will allow to not create extra buffer, but use the buffer that is already allocated and own by RAM-cache.. Still, this behavior is obviously good, it should work automatically, no reason to make it optional..


Hmm, so what should be summarized:

- Actually, block-copy does copy_range. So, probably it's good to change the copy_range() function in qemu to fallback to read+write..

And about copy_range itself, what we want:

1. We want to control does it influence fragmentation of source disk. When copying from temporary image we don't care. But when source of block-copy is active disk in we do care to not influence how original disk lay in filesystem. Probably, we even want an option for copy_range() syscall to control this thing.

2. We want to be efficient with copy_size, ie size of chunks to copy. We even have existing issue in block-copy: write-zero is limited to BLOCK_COPY_MAX_BUFFER which is obviously inefficient.

For copy-size we should have some good defaults or automatic detection logic..

For copy_range fragmentation..

If we have some internal copy_range-like optimizations like zero-copy from RAM-cache node, or maybe copy compressed data from one qcow2 node to another without decompression, it should be done anyway, it shouldn't be set by user option. Still, for file-posix, we don't know, does underlying filesystem copy_range() implementation lead to fragmentation or not. And we don't know is user OK with it or not. So we need an option.. So, it's probably better to keep x-perm.copy-range for now, until we don't have a good idea on interface.

-- 
Best regards,
Vladimir


  reply	other threads:[~2021-05-28 15:30 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 14:21 [PATCH v2 00/33] block: publish backup-top filter Vladimir Sementsov-Ogievskiy
2021-05-20 14:21 ` [PATCH v2 01/33] block: rename bdrv_replace_child to bdrv_replace_child_tran Vladimir Sementsov-Ogievskiy
2021-05-31 12:52   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 02/33] block: comment graph-modifying function not updating permissions Vladimir Sementsov-Ogievskiy
2021-05-31 12:56   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 03/33] block: introduce bdrv_replace_child_bs() Vladimir Sementsov-Ogievskiy
2021-05-31 14:18   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 04/33] block: introduce blk_replace_bs Vladimir Sementsov-Ogievskiy
2021-05-20 14:21 ` [PATCH v2 05/33] qdev-properties: PropertyInfo: add realized_set_allowed field Vladimir Sementsov-Ogievskiy
2021-05-31 15:51   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 06/33] qdev: allow setting drive property for realized device Vladimir Sementsov-Ogievskiy
2021-05-31 15:59   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 07/33] block: rename backup-top to copy-before-write Vladimir Sementsov-Ogievskiy
2021-05-31 16:08   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 08/33] block/backup: drop support for copy_range Vladimir Sementsov-Ogievskiy
2021-05-28 15:29   ` Vladimir Sementsov-Ogievskiy [this message]
2021-05-20 14:21 ` [PATCH v2 09/33] block-copy: always set BDRV_REQ_SERIALISING flag Vladimir Sementsov-Ogievskiy
2021-05-20 14:21 ` [PATCH v2 10/33] block/backup: move cluster size calculation to block-copy Vladimir Sementsov-Ogievskiy
2021-05-20 14:21 ` [PATCH v2 11/33] block/copy-before-write: relax permission requirements when no parents Vladimir Sementsov-Ogievskiy
2021-05-20 14:21 ` [PATCH v2 12/33] block/copy-before-write: drop extra bdrv_unref on failure path Vladimir Sementsov-Ogievskiy
2021-05-31 16:19   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 13/33] block/copy-before-write: use file child instead of backing Vladimir Sementsov-Ogievskiy
2021-05-31 16:22   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 14/33] block/copy-before-write: bdrv_cbw_append(): replace child at last Vladimir Sementsov-Ogievskiy
2021-05-31 16:55   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 15/33] block/copy-before-write: introduce cbw_init() Vladimir Sementsov-Ogievskiy
2021-05-31 16:57   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 16/33] block/copy-before-write: cbw_init(): rename variables Vladimir Sementsov-Ogievskiy
2021-05-20 14:21 ` [PATCH v2 17/33] block/copy-before-write: cbw_init(): use file child after attaching Vladimir Sementsov-Ogievskiy
2021-05-20 14:21 ` [PATCH v2 18/33] block/copy-before-write: cbw_init(): use options Vladimir Sementsov-Ogievskiy
2021-05-31 17:03   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 19/33] block/copy-before-write: initialize block-copy bitmap Vladimir Sementsov-Ogievskiy
2021-05-31 17:10   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 20/33] block/block-copy: make setting progress optional Vladimir Sementsov-Ogievskiy
2021-08-10 15:22   ` Hanna Reitz
2021-05-20 14:21 ` [PATCH v2 21/33] block/copy-before-write: make public block driver Vladimir Sementsov-Ogievskiy
2021-05-20 14:21 ` [PATCH v2 22/33] qapi: publish copy-before-write filter Vladimir Sementsov-Ogievskiy
2021-06-01  9:08   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 23/33] python/qemu/machine.py: refactor _qemu_args() Vladimir Sementsov-Ogievskiy
2021-06-01 10:05   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 24/33] python/qemu/machine: QEMUMachine: improve qmp() method Vladimir Sementsov-Ogievskiy
2021-06-01 10:19   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 25/33] iotests.py: VM: add own __enter__ method Vladimir Sementsov-Ogievskiy
2021-06-01 10:58   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 26/33] iotests/222: fix pylint and mypy complains Vladimir Sementsov-Ogievskiy
2021-06-01 11:16   ` Max Reitz
2021-05-20 14:21 ` [PATCH v2 27/33] iotests/222: constantly use single quotes for strings Vladimir Sementsov-Ogievskiy
2021-06-01 11:17   ` Max Reitz
2021-05-20 14:22 ` [PATCH v2 28/33] iotests: move 222 to tests/image-fleecing Vladimir Sementsov-Ogievskiy
2021-06-01 11:17   ` Max Reitz
2021-05-20 14:22 ` [PATCH v2 29/33] iotests.py: hmp_qemu_io: support qdev Vladimir Sementsov-Ogievskiy
2021-06-01 11:19   ` Max Reitz
2021-05-20 14:22 ` [PATCH v2 30/33] iotests/image-fleecing: proper source device Vladimir Sementsov-Ogievskiy
2021-06-01 11:29   ` Max Reitz
2021-05-20 14:22 ` [PATCH v2 31/33] iotests/image-fleecing: rename tgt_node Vladimir Sementsov-Ogievskiy
2021-06-01 11:46   ` Max Reitz
2021-05-20 14:22 ` [PATCH v2 32/33] iotests/image-fleecing: prepare for adding new test-case Vladimir Sementsov-Ogievskiy
2021-06-01 11:47   ` Max Reitz
2021-05-20 14:22 ` [PATCH v2 33/33] iotests/image-fleecing: add test-case for copy-before-write filter Vladimir Sementsov-Ogievskiy
2021-06-01 12:02   ` Max Reitz
2021-05-31 17:11 ` [PATCH v2 00/33] block: publish backup-top filter Max Reitz
2021-05-31 17:35   ` Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c54a78a1-1276-e5f7-2fe1-e7348116b83b@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.