Skip to content
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

Reset dirty bitmap on Full Snapshot #4536

Merged
merged 3 commits into from
Apr 9, 2024
Merged

Reset dirty bitmap on Full Snapshot #4536

merged 3 commits into from
Apr 9, 2024

Conversation

JackThomson2
Copy link
Contributor

@JackThomson2 JackThomson2 commented Apr 2, 2024

Changes

A continuation of the pr here #4385

The changes are:

  • making sure we reset the firecracker internal bitmap when taking a full snapshot
  • handling the error which could occur when trying to reset KVM's dirty log

Reason

  • The full snapshot path doesn’t call Vmm:get_dirty_bitmap thus doesn’t call
    KVM_GET_DIRTY_LOG which doesn’t reset dirty pages.

Closes #4543.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@JackThomson2 JackThomson2 changed the title Reset dirty Reset dirty bitmap on Full Snaphot Apr 2, 2024
@JackThomson2 JackThomson2 changed the title Reset dirty bitmap on Full Snaphot Reset dirty bitmap on Full Snapshot Apr 2, 2024
Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 82.04%. Comparing base (326f52e) to head (266a78d).

Files Patch % Lines
src/vmm/src/vstate/memory.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4536      +/-   ##
==========================================
+ Coverage   82.03%   82.04%   +0.01%     
==========================================
  Files         253      253              
  Lines       31049    31072      +23     
==========================================
+ Hits        25470    25492      +22     
- Misses       5579     5580       +1     
Flag Coverage Δ
4.14-c5n.metal 79.50% <95.83%> (+0.01%) ⬆️
4.14-c7g.metal ?
4.14-m5n.metal 79.49% <95.83%> (+<0.01%) ⬆️
4.14-m6a.metal 78.71% <95.83%> (+0.01%) ⬆️
4.14-m6g.metal 76.69% <95.83%> (+0.01%) ⬆️
4.14-m6i.metal 79.49% <95.83%> (+<0.01%) ⬆️
4.14-m7g.metal 76.69% <95.83%> (?)
5.10-c5n.metal 82.04% <95.83%> (+0.01%) ⬆️
5.10-c7g.metal ?
5.10-m5n.metal 82.03% <95.83%> (+0.01%) ⬆️
5.10-m6a.metal 81.33% <95.83%> (+0.01%) ⬆️
5.10-m6g.metal 79.46% <95.83%> (+0.01%) ⬆️
5.10-m6i.metal 82.02% <95.83%> (+0.01%) ⬆️
5.10-m7g.metal 79.46% <95.83%> (?)
6.1-c5n.metal 82.04% <95.83%> (+0.01%) ⬆️
6.1-m5n.metal 82.03% <95.83%> (+0.01%) ⬆️
6.1-m6a.metal 81.33% <95.83%> (+0.01%) ⬆️
6.1-m6g.metal 79.46% <95.83%> (+0.01%) ⬆️
6.1-m6i.metal 82.02% <95.83%> (+0.01%) ⬆️
6.1-m7g.metal 79.46% <95.83%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JonathanWoollett-Light
Copy link
Contributor

The commit Updating clearing of the kvm dirty pages should have a commit message describing the changes. I am currently not sure why they are needed in addition to the previous commits.

Muskaan Singla and others added 3 commits April 9, 2024 12:12
When a diff snapshot it taken, it always contains all pages that were
dirtied since either instance start, or since the last diff snapshot was
taken, whichever is more recent. This is not what we document it to do:

> the diff consists of the memory pages which have been dirtied since
> the last snapshot creation or since the creation of the microVM,
> whichever of these events was the most recent.

Here "last snapshot creation" includes full snapshots, not just diff
snapshots (and that makes sense, if I take a diff snapshot after a full
snapshot, I expect the diff snapshot to be a diff compared to the full
snapshot).

Signed-off-by: Jack Thomson <[email protected]>
Co-authored-by: Roman Kovtyukh <[email protected]>
Co-authored-by: Muskaan Singla <[email protected]>
Test that taking full snapshot is as described in documentation:

> the diff consists of the memory pages which have been dirtied since
> the last snapshot creation or since the creation of the microVM,
> whichever of these events was the most recent.

Signed-off-by: Jack Thomson <[email protected]>
Co-authored-by: Roman Kovtyukh <[email protected]>
Co-authored-by: Pablo Barbáchano <[email protected]>
Changed to reset internal firecracker bitmap when creating a full
snapshot.

Signed-off-by: Jack Thomson <[email protected]>
Co-authored-by: Roman Kovtyukh <[email protected]>
Co-authored-by: Pablo Barbáchano <[email protected]>
@pb8o pb8o added Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` Status: Awaiting author Indicates that an issue or pull request requires author action labels Apr 9, 2024
@pb8o pb8o self-assigned this Apr 9, 2024
@pb8o pb8o added Status: Awaiting review Indicates that a pull request is ready to be reviewed and removed Status: Awaiting author Indicates that an issue or pull request requires author action labels Apr 9, 2024
@pb8o pb8o merged commit 9f8b0b2 into firecracker-microvm:main Apr 9, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Low Indicates that an issue or pull request should be resolved behind issues or pull requests labelled ` Status: Awaiting review Indicates that a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Diff Snapshotting feature does not take into account full snapshots
4 participants