forked from cloud-hypervisor/cloud-hypervisor
-
Notifications
You must be signed in to change notification settings - Fork 2
vmm: migration: streamline and cleanup memory_copy_iterations() #72
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
phip1611
merged 4 commits into
cyberus-technology:gardenlinux
from
phip1611:poc-memory-copy-iterations-streamline
Jan 29, 2026
Merged
vmm: migration: streamline and cleanup memory_copy_iterations() #72
phip1611
merged 4 commits into
cyberus-technology:gardenlinux
from
phip1611:poc-memory-copy-iterations-streamline
Jan 29, 2026
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
5ff7630 to
f776c16
Compare
Users with Nix and a shell with direnv integration will be able to automatically enter the Nix development shell. Forgot to add this in [0]. [0] cyberus-technology#73 On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This is the first commit in a series of improvements `memory_copy_iterations()` and `struct MigrationState`. I verified everything in dozens of test runs with excessive logging together with three colleagues (StefanK, PascalS, SebastianE). The series is a pre-requisite for live migration statistics reporting. Previously, the initial transmission was done in a dedicated step and `memory_copy_iterations()` took only care of the delta transmission. This makes aggregating metrics unnecessarily difficult. Therefore, everything is now handled gracefully by `memory_copy_iterations()` in one single place. Further, this consolidation perfectly makes sense as all memory transmission is now streamlined in one function. I had to adapt the iteration counter: Iteration 0 : initial transmission Iteration 1..n: delta transmission ^ done inside the function Iteration n : final transmission ^ done outside the function On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
f776c16 to
254ef69
Compare
phip1611
commented
Jan 28, 2026
254ef69 to
4488746
Compare
4488746 to
7ebf0d5
Compare
olivereanderson
approved these changes
Jan 29, 2026
olivereanderson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
amphi
approved these changes
Jan 29, 2026
amphi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have one nit, feel free to ignore it.
This improves the code quality of `struct MigrationState` and memory_copy_iterations(). This significantly improves maintainability of the code. Further, I've added the ability for expected downtime calculation and dirty page calculation. The new names are much more descriptive. I also removed properties that didn't make sense. These changes have undergone intense manual testing where many colleagues attended (PascalS, StefanK, SebastianE). There is currently no easy way to check that things really work as a reviewer. PS: The old struct comes from an external contributor [0]. [0] cloud-hypervisor#7033 On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
7ebf0d5 to
08e1456
Compare
tpressure
approved these changes
Jan 29, 2026
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.
This is a cleanup and also a prerequisite for #43 (migration statistics). It ensures maintainability of the code and also adds a (very basic) dirty rate calculation.
Hints for Reviewers