-
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
Fix 16K host page support #4916
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4916 +/- ##
==========================================
- Coverage 84.09% 84.05% -0.04%
==========================================
Files 251 251
Lines 28061 28089 +28
==========================================
+ Hits 23597 23610 +13
- Misses 4464 4479 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
2f523ef
to
a879102
Compare
pub const HOST_PAGE_SIZE: usize = 4096; | ||
pub static mut HOST_PAGE_SIZE: usize = 4096; | ||
|
||
/// Updates the HOST_PAGE_SIZE global variable to the output of |
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.
Instead of modifying a global, could we make it a function that returns the pagesize? Or use lazy_static!
.
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.
added a method to return the host page size.
a879102
to
82a4d30
Compare
#[derive(Debug)] | ||
pub struct IovDeque<const L: u16> { | ||
pub iov: *mut libc::iovec, | ||
pub bytes: u32, |
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 suppose this should be mentioned in the changelog.
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.
added a note in the Fixed section
a10e8bb
to
c8f2643
Compare
3fa7522
to
2472eb4
Compare
Firecracker was assumming page sizes for both host and guest are 4K. But they can differ, so split into 2 values. Signed-off-by: Egor Lazarchuk <[email protected]>
Define global variable with host page size and update it at the very beginning of the main function in Firecracker. This way data types which rely on specific host page size can adapt to it. Signed-off-by: Egor Lazarchuk <[email protected]>
Remove restriction on size and host page size. Signed-off-by: Egor Lazarchuk <[email protected]>
Add note about making `IovDeque` to work with any host page size. Signed-off-by: Egor Lazarchuk <[email protected]>
2472eb4
to
9c4e018
Compare
Changes
Separate
PAGE_SIZE
constant into 2:GUEST_PAGE_SIZE
andHOST_PAGE_SIZE
.HOST_PAGE_SIZE
has a default of 4K, but is also queried at runtime to support other page sizes.The only structure which did not work with non default 4K pages is
IovDeque
. This PR updates itand removes restrictions on the queue size and on the host page size.
Tested16K pages support on rp5 with 16K page kernel.
Reason
Previously Firecracker was working on hosts with non 4K pages, but with 1.10 version we introduced
IovDeque
typewhich assumed the host page size to be 4K.
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
tools/devtool checkstyle
to verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md
.Runbook for Firecracker API changes.
integration tests.
TODO
.rust-vmm
.