Skip to content

Conversation

@phip1611
Copy link
Member

@phip1611 phip1611 commented Jan 27, 2026

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

@phip1611 phip1611 self-assigned this Jan 27, 2026
@phip1611 phip1611 force-pushed the poc-memory-copy-iterations-streamline branch 3 times, most recently from 5ff7630 to f776c16 Compare January 28, 2026 20:40
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>
@phip1611 phip1611 force-pushed the poc-memory-copy-iterations-streamline branch from f776c16 to 254ef69 Compare January 28, 2026 20:44
@phip1611 phip1611 changed the title vmm: migration: streamline memory transmission in a single method vmm: migration: streamline and cleanup do_memory_copy() Jan 28, 2026
@phip1611 phip1611 changed the title vmm: migration: streamline and cleanup do_memory_copy() vmm: migration: streamline and cleanup memory_copy_iterations() Jan 28, 2026
@phip1611 phip1611 force-pushed the poc-memory-copy-iterations-streamline branch from 254ef69 to 4488746 Compare January 28, 2026 20:59
@phip1611 phip1611 force-pushed the poc-memory-copy-iterations-streamline branch from 4488746 to 7ebf0d5 Compare January 29, 2026 08:51
Copy link

@olivereanderson olivereanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@amphi amphi left a 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>
@phip1611 phip1611 force-pushed the poc-memory-copy-iterations-streamline branch from 7ebf0d5 to 08e1456 Compare January 29, 2026 10:09
@phip1611 phip1611 merged commit ba8014e into cyberus-technology:gardenlinux Jan 29, 2026
11 checks passed
@phip1611 phip1611 deleted the poc-memory-copy-iterations-streamline branch January 29, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants