-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[1.7] fix(vmm): only use memfd if no vhost-user-blk devices configured #4501
Merged
kalyazin
merged 6 commits into
firecracker-microvm:firecracker-v1.7
from
kalyazin:memfd_anon_1.7
Mar 15, 2024
Merged
[1.7] fix(vmm): only use memfd if no vhost-user-blk devices configured #4501
kalyazin
merged 6 commits into
firecracker-microvm:firecracker-v1.7
from
kalyazin:memfd_anon_1.7
Mar 15, 2024
Conversation
This file contains 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
Page faults are more expensive for shared memory mapping (like memfd). For this reason, we only back guest memory with a memfd if a vhost-user-blk device is configured in the VM, otherwise we fall back to anonymous private memory. This is recovering performance demonstrated before commit 027a992 had been merged. The vhost-user-blk branch in VM creation is not currently covered by Rust integration tests, because we are looking for a converging solution, so guest memory is always created in the same way, and implementing required integration test infrastructure code (spawing a backend process) would not be useful long term. (cherry picked from commit 931207b) Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
This is because guest memory is backed by anon private mapping in a regular case. (cherry picked from commit d6a775d) Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
Huge pages tests search for memory mapping name, which is now anon private instead of memfd. (cherry picked from commit eb219d7) Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
Mention memfd page fault overhead and host pagecache usage for virtio block devices compared to vhost-user. (cherry picked from commit 8ed3e4a) Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
Adds a changelog entry that VMs that do not use vhost-user-blk devices are backed by anon private memory mapping. (cherry picked from commit a6ee3b5) Signed-off-by: Nikita Kalyazin <kalyazin@amazon.com>
5e6f8e3
to
fea676d
Compare
roypat
approved these changes
Mar 15, 2024
bchalios
approved these changes
Mar 15, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## firecracker-v1.7 #4501 +/- ##
====================================================
- Coverage 81.65% 81.55% -0.10%
====================================================
Files 243 243
Lines 29834 29848 +14
====================================================
- Hits 24360 24344 -16
- Misses 5474 5504 +30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
wearyzen
approved these changes
Mar 15, 2024
740d3c5
into
firecracker-microvm:firecracker-v1.7
7 of 8 checks passed
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.
Changes
Backport #4498
Reason
To avoid page fault latency regression.
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 thisPR.
[ ] API changes follow the Runbook for Firecracker API changes.CHANGELOG.md
.[ ] All added/changed functionality is tested.[ ] NewTODO
s link to an issue.contribution quality standards.
rust-vmm
.