From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top, Nir Dothan <ndothan@redhat.com>
Subject: Re: [PATCH] treewide: By default, don't quit source after migration, keep sockets open
Date: Thu, 24 Jul 2025 11:48:36 +1000 [thread overview]
Message-ID: <aIGQ9JFdg1RvZNsE@zatzit> (raw)
In-Reply-To: <20250723111708.4d78111e@elisabeth>
[-- Attachment #1: Type: text/plain, Size: 3101 bytes --]
On Wed, Jul 23, 2025 at 11:17:08AM +0200, Stefano Brivio wrote:
> On Wed, 23 Jul 2025 10:27:30 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> > On Tue, Jul 22, 2025 at 11:12:49PM +0200, Stefano Brivio wrote:
[snip]
> > > > I think a preferable approach would be to EPOLL_CTL_DEL each socket at
> > > > the point we would close() them with --migrate-no-linger. I'd be fine
> > > > with that as a follow up improvement, though.
> > >
> > > I was pondering about adding this on top of the ignore_data_events
> > > trick, but, actually, the whole thing as of this patch is somewhat
> > > bogus because
> > >
> > > - we're ignoring events on TCP sockets (intentional),
> > >
> > > - we're ignoring events on the tap device (who cares, migration is only
> > > supported with vhost-user)
> > >
> > > - but *not* ignoring events on the vhost-user kick descriptor
> > > (oversight).
> > >
> > > On a second thought, it doesn't look safe to ignore events on the kick
> > > descriptor, and in any case, with this change, we don't want to prevent
> > > the guest to send out further packets. It's not expected anyway.
> > >
> > > So I just replaced the whole thing with EPOLL_CTL_DEL (epoll_del()) as
> > > we go through the sockets. It's simpler and arguably safer.
> >
> > Yes, that's what I had in mind as well (I thought I put that in the
> > mail, but it looks like I didn't). Just one additional concern that I
> > don't think need hold up merge: do we also need to epoll_del() our
> > listening sockets?
>
> Right, I had that thought as well, and this was somewhat covered by the
> first version because we'd ignore events on those. But that would still
> come with the risk of epoll_wait() loops.
Exactly.
> In the perspective of a simple implementation / fix mostly intended for
> KubeVirt such as this one, we know that the guest is suspended at that
> point, so we'll send a SYN to it, nothing comes back, we'll eventually
> time out in 10 seconds and try to reset the connection (in the unlikely
> case we're still running *and* getting traffic at that point).
Hrm. Maybe. Wouldn't surprise me if there are still some weird edge
cases in her, but, yes, I suspect they're not a huge deal.
> And I guess that's fine because if we're still running and getting
> traffic after that timeout something must have gone wrong, so sending a
> RST segment doesn't look that bad to me. If the connection was meanwhile
> established with the target node, I think our RST segment won't actually
> reset the connection because sequence numbers won't match.
>
> But surely it's not elegant and I think we should eventually have an
> explicit implementation of the whole thing, perhaps with a new socket
> state ("MIGRATED"?) and going through the whole list of listening
> sockets and... closing them, I suppose?
Right.
--
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2025-07-24 1:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 22:12 [PATCH] treewide: By default, don't quit source after migration, keep sockets open Stefano Brivio
2025-07-22 0:33 ` David Gibson
2025-07-22 21:12 ` Stefano Brivio
2025-07-23 0:27 ` David Gibson
2025-07-23 9:17 ` Stefano Brivio
2025-07-24 1:48 ` David Gibson [this message]
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=aIGQ9JFdg1RvZNsE@zatzit \
--to=david@gibson.dropbear.id.au \
--cc=ndothan@redhat.com \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
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 IMAP folder(s).