[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/8] block/backup: teach backup_cow_with_bounce_
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH 6/8] block/backup: teach backup_cow_with_bounce_buffer to copy more at once |
Date: |
Wed, 7 Aug 2019 20:25:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 07.08.19 10:07, Vladimir Sementsov-Ogievskiy wrote:
> backup_cow_with_offload can transfer more than on cluster. Let
> backup_cow_with_bounce_buffer behave similarly. It reduces number
> of IO and there are no needs to copy cluster by cluster.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> block/backup.c | 30 +++++++++++++++---------------
> 1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/block/backup.c b/block/backup.c
> index eb41e4af4f..c765c073ad 100644
> --- a/block/backup.c
> +++ b/block/backup.c
> @@ -104,22 +104,24 @@ static int coroutine_fn
> backup_cow_with_bounce_buffer(BackupBlockJob *job,
> int64_t start,
> int64_t end,
> bool is_write_notifier,
> - bool *error_is_read,
> - void **bounce_buffer)
> + bool *error_is_read)
> {
> int ret;
> BlockBackend *blk = job->common.blk;
> int nbytes;
> int read_flags = is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0;
> + void *bounce_buffer = blk_try_blockalign(blk, end);
s/end/end - start/ (or probably rather s/end/nbytes/ after that has been
set).
Rest looks good.
Max
>
> - assert(QEMU_IS_ALIGNED(start, job->cluster_size));
> - bdrv_reset_dirty_bitmap(job->copy_bitmap, start, job->cluster_size);
> - nbytes = MIN(job->cluster_size, job->len - start);
> - if (!*bounce_buffer) {
> - *bounce_buffer = blk_blockalign(blk, job->cluster_size);
> + if (!bounce_buffer) {
> + return -ENOMEM;
> }
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 4/8] block/backup: improve unallocated clusters skipping, (continued)
[Qemu-devel] [PATCH 3/8] block/io: handle alignment and max_transfer for copy_range, Vladimir Sementsov-Ogievskiy, 2019/08/07
[Qemu-devel] [PATCH 7/8] block/backup: merge duplicated logic into backup_do_cow, Vladimir Sementsov-Ogievskiy, 2019/08/07
[Qemu-devel] [PATCH 6/8] block/backup: teach backup_cow_with_bounce_buffer to copy more at once, Vladimir Sementsov-Ogievskiy, 2019/08/07
- Re: [Qemu-devel] [PATCH 6/8] block/backup: teach backup_cow_with_bounce_buffer to copy more at once,
Max Reitz <=
[Qemu-devel] [PATCH 8/8] block/backup: backup_do_cow: use bdrv_dirty_bitmap_next_dirty_area, Vladimir Sementsov-Ogievskiy, 2019/08/07
[Qemu-devel] [PATCH 2/8] block/backup: refactor write_flags, Vladimir Sementsov-Ogievskiy, 2019/08/07