On Thu, Mar 31, 2022 at 11:08:46AM -0400, Peter Xu wrote: > Firstly, postcopy already preempts precopy due to the fact that we do > unqueue_page() first before looking into dirty bits. > > However that's not enough, e.g., when there're host huge page enabled, when > sending a precopy huge page, a postcopy request needs to wait until the whole > huge page that is sending to finish. That could introduce quite some delay, > the bigger the huge page is the larger delay it'll bring. > > This patch adds a new capability to allow postcopy requests to preempt > existing > precopy page during sending a huge page, so that postcopy requests can be > serviced even faster. > > Meanwhile to send it even faster, bypass the precopy stream by providing a > standalone postcopy socket for sending requested pages. > > Since the new behavior will not be compatible with the old behavior, this will > not be the default, it's enabled only when the new capability is set on both > src/dst QEMUs. > > This patch only adds the capability itself, the logic will be added in follow > up patches. > > Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > Signed-off-by: Peter Xu <pet...@redhat.com> > --- > migration/migration.c | 23 +++++++++++++++++++++++ > migration/migration.h | 1 + > qapi/migration.json | 8 +++++++- > 3 files changed, 31 insertions(+), 1 deletion(-)
> diff --git a/qapi/migration.json b/qapi/migration.json > index 18e2610e88..3523f23386 100644 > --- a/qapi/migration.json > +++ b/qapi/migration.json > @@ -463,6 +463,12 @@ > # procedure starts. The VM RAM is saved with running > VM. > # (since 6.0) > # > +# @postcopy-preempt: If enabled, the migration process will allow postcopy > +# requests to preempt precopy stream, so postcopy requests > +# will be handled faster. This is a performance feature > and > +# should not affect the correctness of postcopy migration. > +# (since 7.0) Now 7.1 Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|