qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Prasad Pandit <ppandit@redhat.com>
Cc: Fabiano Rosas <farosas@suse.de>,
	qemu-devel@nongnu.org, berrange@redhat.com,
	Prasad Pandit <pjp@fedoraproject.org>
Subject: Re: [PATCH v7 0/5] Allow to enable multifd and postcopy migration together
Date: Tue, 4 Mar 2025 09:42:40 -0500	[thread overview]
Message-ID: <Z8cRYO1Kacl7vl-I@x1.local> (raw)
In-Reply-To: <CAE8KmOzkVpG5iUqwShWWMF4+96-cbNm1AU8b=s3187EyWXXT4g@mail.gmail.com>

On Tue, Mar 04, 2025 at 03:17:14PM +0530, Prasad Pandit wrote:
> Hi,
> 
> On Mon, 3 Mar 2025 at 19:42, Peter Xu <peterx@redhat.com> wrote:
> > On Mon, Mar 03, 2025 at 04:17:53PM +0530, Prasad Pandit wrote:
> > > * I think we (you, me, Peter) are all looking at things differently.
> > >     - In my view Patch-2 is the minimal change _required_  to enable
> > > multifd & postcopy. In your view we are _revamping_ channel discovery
> > > parts while _sneaking_ in a feature of enabling multifd & postcopy
> > > together.
> > >     - In my view Patch-5 in this series is an isolated change because
> > > it adds a new migration command to allow multifd threads sync from
> > > source side. But Peter thinks without that 'flush and sync' Patch-2 is
> > > incomplete, so we should merge it back there.
> >
> > Just to mention, my suggestion does not conflict with splitting patch 2, as
> > long as you keep every patch complete on its own.
> >
> > Patch 5 needs to be squashed to either patch 2 or a split patch out of
> > patch 2, because current patch 2 (or any possible way to split it into
> > smaller ones, then one of them which enables the feature) is buggy.
> 
> * I'll try to segregate different parts, then we can discuss how to
> split them across patches:
> 
> Terminology:
>     _requires_  => is without which migration shall not work at all.
>     _essential_ => is without which there may be issues.
> 
> 1. Enable Multifd and Postcopy together
>     - It _requires_ removal of the Multifd capability check in
> migration/options.c
>     - It _requires_ identification of the CH_POSTCOPY connection when it arrives
>         - so enum { CH_MAIN, CH_MULTIFD, CH_POSTCOPY } is defined
>         - To identify channels, related changes are made to the
> channel discovery part (if .. else conditionals) in
> migration_ioc_process_incoming() function.
>         - These changes help to establish all channel connections.
> After that, the migration proceeds as usual until it's time to start
> the Postcopy phase.
>     - When time comes to start Postcopy phase, we shutdown multifd channels.
>         - it _requires_ calling multifd_send_shutdown()
>         - It _requires_ moving
> file_cleanup_outgoing/socket_cleanup_outgoing calls to
> migration_cleanup() function.
>     - When Postcopy phase starts, we don't want ram_save_target
> _page() function to call ram_save_multifd_page() function, because
> migrate_multifd() is still true.
>         - It _requires_ adding the !migration_in_postcopy() checks.

IIUC Fabiano is not asking you to drop them, but split them.  Split still
"requires" them to be present, as long as before the enablement patch.

For example, if you want you can put the channel changes into a separate
patch, but without enabling the feature.  That single patch (after applied)
should keep migration working as before.

> 
> * Above changes are minimal _required_ to enable multifd and postcopy
> together, while also ensuring that migration continues to work when
> those options are not enabled together. With these changes, guest
> migration across two machines works without any observed failures.
> 
> 2. The multifd_ram_flush_and_sync() call/command and the
> assert(!migration_in_postcopy()) call in multifd_recv_thread()
>     - These calls help to ensure that no multifd data is left behind
> when the Postcopy phase starts.
>     - And that multifd_recv threads shall not be active when the
> Postcopy is running.
>     - They protect the guests from potential state corruption.
> 
> * It is up to us to decide whether (2) is _required_ OR _essential_
> for the feature. Individual opinions can vary here.
> 
> 3. Revamp of the channel discovery parts by moving those bits to
> connection.c or other places.
>     - This entails moving the channel discovery parts from
> migration_ioc_process_incoming() function to somewhere else because it
> makes more sense to move it there and maybe it reduces complexity and
> makes the sources easier to understand.*
> 
> * It is up to us to decide whether (3) is _required_  OR  _essential_
> for the feature. Individual opinions can vary here.
> 
> * IMHO (1) is _required_,  (2) is _essential_,  and (3) is neither
> _required_ nor _essential_ for the - Enable multifd and postcopy
> together - feature. (3) is a completely unrelated change to this
> feature.
> 
> Since it is an individual opinion, we all can think differently here
> and that is perfectly fine. Once we have some consensus, we can decide
> how to split or merge patches and move forward.
> 
> Hope it helps. Thank you.
> ---
>   - Prasad
> 

-- 
Peter Xu



  reply	other threads:[~2025-03-04 14:44 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 12:17 [PATCH v7 0/5] Allow to enable multifd and postcopy migration together Prasad Pandit
2025-02-28 12:17 ` [PATCH v7 1/5] migration/multifd: move macros to multifd header Prasad Pandit
2025-02-28 12:17 ` [PATCH v7 2/5] migration: enable multifd and postcopy together Prasad Pandit
2025-02-28 12:17 ` [PATCH v7 3/5] tests/qtest/migration: consolidate set capabilities Prasad Pandit
2025-02-28 12:17 ` [PATCH v7 4/5] tests/qtest/migration: add postcopy tests with multifd Prasad Pandit
2025-02-28 15:11   ` Fabiano Rosas
2025-03-03  9:33     ` Prasad Pandit
2025-02-28 12:17 ` [PATCH v7 5/5] migration: add MULTIFD_RECV_SYNC migration command Prasad Pandit
2025-02-28 13:42   ` Peter Xu
2025-03-03 11:43     ` Prasad Pandit
2025-03-03 14:50       ` Peter Xu
2025-03-04  8:10         ` Prasad Pandit
2025-03-04 14:35           ` Peter Xu
2025-03-05 11:21             ` Prasad Pandit
2025-03-05 12:54               ` Peter Xu
2025-03-07 11:45                 ` Prasad Pandit
2025-03-07 22:48                   ` Peter Xu
2025-03-10  7:36                     ` Prasad Pandit
2025-03-13 12:43                     ` Prasad Pandit
2025-03-13 20:08                       ` Peter Xu
2025-03-17 12:30                         ` Prasad Pandit
2025-03-17 15:00                           ` Peter Xu
2025-03-07 22:51                   ` Peter Xu
2025-03-10 14:38                     ` Fabiano Rosas
2025-03-10 17:08                       ` Prasad Pandit
2025-03-10 19:58                         ` Fabiano Rosas
2025-03-11 10:01                           ` Prasad Pandit
2025-03-11 12:44                             ` Fabiano Rosas
2025-02-28 14:53 ` [PATCH v7 0/5] Allow to enable multifd and postcopy migration together Fabiano Rosas
2025-03-03 10:47   ` Prasad Pandit
2025-03-03 14:12     ` Peter Xu
2025-03-04  9:47       ` Prasad Pandit
2025-03-04 14:42         ` Peter Xu [this message]
2025-03-05  7:41           ` Prasad Pandit
2025-03-05 13:56             ` Fabiano Rosas
2025-03-06  7:51               ` Prasad Pandit
2025-03-06 13:48                 ` Fabiano Rosas

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=Z8cRYO1Kacl7vl-I@x1.local \
    --to=peterx@redhat.com \
    --cc=berrange@redhat.com \
    --cc=farosas@suse.de \
    --cc=pjp@fedoraproject.org \
    --cc=ppandit@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).