All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Eric Blake <eblake@redhat.com>, John Snow <jsnow@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>, "Denis V. Lunev" <den@openvz.org>,
	Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>,
	Dmitry Mishin <dim@virtuozzo.com>,
	Igor Sukhih <igor@virtuozzo.com>,
	yur@virtuozzo.com, Peter Krempa <pkrempa@redhat.com>,
	"libvir-list@redhat.com" <libvir-list@redhat.com>
Subject: Re: RFC: Qemu backup interface plans
Date: Tue, 25 May 2021 12:19:11 +0300	[thread overview]
Message-ID: <998c92cc-2d32-cd96-9fa4-9abff189e7a0@virtuozzo.com> (raw)
In-Reply-To: <60dd7a7a-3838-8d11-66f4-2cbd08fbf575@redhat.com>

25.05.2021 11:50, Max Reitz wrote:
> On 19.05.21 08:11, Vladimir Sementsov-Ogievskiy wrote:
>> 18.05.2021 19:39, Max Reitz wrote:
> 
> [...]
> 
>>> On 17.05.21 14:07, Vladimir Sementsov-Ogievskiy wrote:
> 
> [...]
> 
>>>> Not also, that there is another benefit of such thing: we'll implement this callback in qcow2 driver, so that backup will read clusters not in guest cluster order, but in host cluster order, to read more sequentially, which should bring better performance on rotating disks.
>>>
>>> I’m not exactly sure how you envision this to work, but block_status also already gives you the host offset in *map.
>>>
>>
>> But block-status doesn't give a possibility to read sequentially. For this, user should call block-status several times until the whole disk covered, then sort the segments by host offset. I wonder, could it be implemented as some iterator, like
>>
>> read_iter = bdrv_get_sequential_read_iter(source)
>>
>> while (extents = bdrv_read_next(read_iter)):
>>    for ext in extents:
>>      start_writing_task(target, ext.offset, ext.bytes, ext.qiov)
>>
>> where bdrv_read_next will read guest data in host-cluster-sequence..
> 
> How would you implement this, though?

I don't know :) That's why I wrote "I wonder".. Anyway I have enough work with all previous steps.

> qcow2 doesn’t have a reverse mapping either, so it too would need to read all L2 table entries and sort them, wouldn’t it?
> 

Hmm, yes. With current qcow2, it seems to be the only way. And we'll be limited by memory, so probably, read several L2 tables, do sort, return sorted extents, read next bunch of L2 tables and so on.

And then, I agree, we can just implement with help of current block_status() implementation.

Or probably we can implement reverse mapping in qcow2 as extension. But I doubt that it worth the complexity.. Still, it depends on how much extra IO will it cost (almost nothing, as should work through qcow2 cache) and how much performance benefit will it bring (no idea, it should be measured).

-- 
Best regards,
Vladimir


  reply	other threads:[~2021-05-25  9:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 12:07 RFC: Qemu backup interface plans Vladimir Sementsov-Ogievskiy
2021-05-18 16:39 ` Max Reitz
2021-05-19  6:11   ` Vladimir Sementsov-Ogievskiy
2021-05-19 11:20     ` Kevin Wolf
2021-05-19 11:49       ` Vladimir Sementsov-Ogievskiy
2021-05-19 12:00         ` Kevin Wolf
2021-05-25  8:50     ` Max Reitz
2021-05-25  9:19       ` Vladimir Sementsov-Ogievskiy [this message]
2021-05-21 22:05 ` 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=998c92cc-2d32-cd96-9fa4-9abff189e7a0@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=den@openvz.org \
    --cc=dim@virtuozzo.com \
    --cc=eblake@redhat.com \
    --cc=igor@virtuozzo.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=nshirokovskiy@virtuozzo.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yur@virtuozzo.com \
    /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.