[RFC v2 0/3] migration: reduce time of loading non-iterable vmstate

Chuang Xu posted 3 patches 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221212164942.3614611-1-xuchuangxclwt@bytedance.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Xu <peterx@redhat.com>, David Hildenbrand <david@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>
There is a newer version of this series
[RFC v2 0/3] migration: reduce time of loading non-iterable vmstate
Posted by Chuang Xu 1 year, 4 months ago
Hi!

In this version:

- rebase to latest upstream.
- add sanity check to address_space_to_flatview().
- postpone the init of the vring cache until migration's loading completes. 

Please review, Chuang.

[v1]

The duration of loading non-iterable vmstate accounts for a significant
portion of downtime (starting with the timestamp of source qemu stop and
ending with the timestamp of target qemu start). Most of the time is spent
committing memory region changes repeatedly.

This patch packs all the changes to memory region during the period of
loading non-iterable vmstate in a single memory transaction. With the
increase of devices, this patch will greatly improve the performance.

Here are the test results:
test vm info:
- 32 CPUs 128GB RAM
- 8 16-queue vhost-net device
- 16 4-queue vhost-user-blk device.

	time of loading non-iterable vmstate
before		about 210 ms
after		about 40 ms
Re: [RFC v2 0/3] migration: reduce time of loading non-iterable vmstate
Posted by Peter Xu 1 year, 4 months ago
On Tue, Dec 13, 2022 at 12:49:39AM +0800, Chuang Xu wrote:
> 
> Hi!

Chuang,

> 
> In this version:
> 
> - rebase to latest upstream.
> - add sanity check to address_space_to_flatview().
> - postpone the init of the vring cache until migration's loading completes. 

Since there'll be other changes besides migration, please consider also
copy the relevant maintainers too on either memory and virtio in your next
post:

$ ./scripts/get_maintainer.pl -f softmmu/memory.c -f hw/virtio/virtio.c
Paolo Bonzini <pbonzini@redhat.com> (supporter:Memory API)
Peter Xu <peterx@redhat.com> (supporter:Memory API)
David Hildenbrand <david@redhat.com> (supporter:Memory API)
"Philippe Mathieu-Daudé" <philmd@linaro.org> (reviewer:Memory API)
"Michael S. Tsirkin" <mst@redhat.com> (supporter:virtio)
qemu-devel@nongnu.org (open list:All patches CC here)

-- 
Peter Xu


Re: [RFC v2 0/3] migration: reduce time of loading non-iterable vmstate
Posted by Chuang Xu 1 year, 4 months ago
On 2022/12/13 上午4:23, Peter Xu wrote:

On Tue, Dec 13, 2022 at 12:49:39AM +0800, Chuang Xu wrote:

Hi!

Chuang,


In this version:

- rebase to latest upstream.
- add sanity check to address_space_to_flatview().
- postpone the init of the vring cache until migration's loading completes.

Since there'll be other changes besides migration, please consider also
copy the relevant maintainers too on either memory and virtio in your next
post:

$ ./scripts/get_maintainer.pl -f softmmu/memory.c -f hw/virtio/virtio.c
Paolo Bonzini <pbonzini@redhat.com> <pbonzini@redhat.com> (supporter:Memory API)
Peter Xu <peterx@redhat.com> <peterx@redhat.com> (supporter:Memory API)
David Hildenbrand <david@redhat.com> <david@redhat.com> (supporter:Memory API)
"Philippe Mathieu-Daudé" <philmd@linaro.org> <philmd@linaro.org>
(reviewer:Memory API)
"Michael S. Tsirkin" <mst@redhat.com> <mst@redhat.com>
(supporter:virtio)qemu-devel@nongnu.org (open list:All patches CC
here)



Sorry I forgot to update the cc list..

Thanks for your reminder!