forked from cloud-hypervisor/cloud-hypervisor
-
Notifications
You must be signed in to change notification settings - Fork 2
Multiple TCP Connections for Migration #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tpressure
merged 15 commits into
cyberus-technology:gardenlinux
from
phip1611:multiple-tcp
Nov 13, 2025
Merged
Multiple TCP Connections for Migration #39
tpressure
merged 15 commits into
cyberus-technology:gardenlinux
from
phip1611:multiple-tcp
Nov 13, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is not wired up to anywhere yet. We will use this to establish multiple connections for live migration. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
This has no functional change, but it is a requirement to remove the lock that used to obtain the MemoryManager instance. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
... to avoid having to grab a lock when we receive a chunk of memory over the migration socket. This will come in handy when we have multiple threads for receiving memory. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
To allow for accepting more connections in the migration receive code paths, we need to keep track of the listener. This commit adds a thin abstraction to be able to hold on to it regardless of whether it is a UNIX domain or TCP socket. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
We keep the listening socket around and accept as many connections as the sender wants to open. There are still some problems: We never tear these threads down again. We will handle this in subsequent commits. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
In anticipation of using multiple threads for sending memory, refactor the sending code to be in a single place. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
... to be able to re-use it when establishing multiple send connections. I moved the receive socket creation out for symmetry. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
... to simplify sending memory from multiple connections in future commits. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
For sending memory over multiple connections, we need a way to split up the work. With these changes, we can take a memory table and chop it into same-sized chunks for transmit. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
This does not actually use the additional connections yet, but we are getting closer! On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
This will stop us from listening for more connections on the TCP socket when migration has finished. Tearing down the individual connections will come in a subsequent commit. Co-authored-by: Philipp Schuster <[email protected]> On-behalf-of: SAP [email protected] On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]> Signed-off-by: Philipp Schuster <[email protected]>
... after the VM migration finishes. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
We don't die if we don't manage to establish more than the initial connection to the other side. To limit the weird failure cases, we do die when the other side only accepts some connections, but not all. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
This restores the old behavior/performance in case, we don't use multiple connections. On-behalf-of: SAP [email protected] Signed-off-by: Julian Stecklina <[email protected]>
c41aab5 to
af92338
Compare
|
LGTM 😄 On a more serious note: I ran 3000 migrations with 4 and 8 connections and everything works without any issues. |
d435a54
into
cyberus-technology:gardenlinux
13 of 14 checks passed
26 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replacement for #30 since I've taken over. For design, discussions, etc., please see there.