From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202506 header.b=evbXJfU9; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id A551A5A0271 for ; Thu, 24 Jul 2025 03:50:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202506; t=1753321638; bh=nncldY5WM6Q+FWKzX7McZg/ERTe5/fmkQ5NHHoPkXg4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=evbXJfU9YnpE7O/e2q2yG8CK++DJBCrpI56MZCQCgvRaeOo0iVcEY0Wd8o5sGCNEv 6ius5G7stoHphRb9CZ0H7lplmxsMmpCSttjlZ6U7XYxh/tbpC8c3Qa99CdY+7NR5eu +6hYmFBwBemHltxgrNdUr7cixukoqxFimRSLH2bBDwL+Yz6Abf8vSaUot07VGgqkL1 E/AXVWInlWDeJOUQ0cHy1DZMo/n8lU863E9mNdKORkRVtSA35rf5qePPpWw5gRaKTN VrdAqsYktOwET/iDHVfUEP2/AjpWnHaz/XAPEL3t+Olm7LyYsY8uX2muTKktB9/NdA kK4j7CpwCQVlA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4bnYlp44nCz4xZh; Thu, 24 Jul 2025 11:47:18 +1000 (AEST) Date: Thu, 24 Jul 2025 11:48:36 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] treewide: By default, don't quit source after migration, keep sockets open Message-ID: References: <20250721221258.2874863-1-sbrivio@redhat.com> <20250722231249.22e09340@elisabeth> <20250723111708.4d78111e@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ScH9PO57il3spzMF" Content-Disposition: inline In-Reply-To: <20250723111708.4d78111e@elisabeth> Message-ID-Hash: BAUPEWZHBL4S2YBMGOV55QRXBA26XEQQ X-Message-ID-Hash: BAUPEWZHBL4S2YBMGOV55QRXBA26XEQQ X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top, Nir Dothan X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --ScH9PO57il3spzMF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 23, 2025 at 11:17:08AM +0200, Stefano Brivio wrote: > On Wed, 23 Jul 2025 10:27:30 +1000 > David Gibson 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 f= ine > > > > with that as a follow up improvement, though. =20 > > >=20 > > > 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 > > >=20 > > > - we're ignoring events on TCP sockets (intentional), > > >=20 > > > - we're ignoring events on the tap device (who cares, migration is on= ly > > > supported with vhost-user) > > >=20 > > > - but *not* ignoring events on the vhost-user kick descriptor > > > (oversight). > > >=20 > > > 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 preve= nt > > > the guest to send out further packets. It's not expected anyway. > > >=20 > > > 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. =20 > >=20 > > 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? >=20 > 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. >=20 > 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. --=20 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 --ScH9PO57il3spzMF Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmiBkPMACgkQzQJF27ox 2Gc4vA//Vh9CSnvZL15DH+zegeHkQOeQSMj9idwVi3gH9B7h6UOu3IMvCb//WAHi YY506kcjk3cl3HcF9exjqRYibkFQPdye2a/vZCahayMBUhUZ8SwEHco383YEO+Yr crPh653lc6npuvaZ6zt7WeEQm0wZlXQ+PQ7UUINkP/g0DSat0OHct1rvS4aelRyM H4vUng7+Gkan3qmv2J3GZ6h9aLSGhtTu2mKJ5f8JQ8CDMMDxBOvnU065w6A+tChl LjkrR4pIF4MnUXDlvT2SJ79Zw0ndFQq5cHIU5/O+5Us6NMePepHrTq52Jsisoq8L eqlVWP92oD6quMlqzFtqbN2gqp2YE3L3gRgkc8hQdzKa8jFvR9P5KVZWS4w1rERR AYxMb69X0p64gbsQ5Qs/sk3esc8qEnL+yQt+coHFQyFDUdHrdyhC+5TDiNfaLnbQ WM7jKNMYkwiasNHZaUgrahcjYhY+XGwsGhZ2ADpPI3duoiYZzv4PGdASaKUol/2C K80E0h39MjRr5NvAhJlG4wvZeeHPQbvbXFSH8hvzYdMl123554qPyfPM1SaRwduZ tnMo7B0osvZf2YAOY6yHjLzP7RCxBZyGrk176ssYIqiFmrjdOEjfyxafg8YK/Qjz YcK6wDqIGhWFiKsgyrWh6ijdfliDiYHbcQkhrJtaO9S4Zf/MiGA= =5gqP -----END PGP SIGNATURE----- --ScH9PO57il3spzMF--