Repository navigation
[Feat] New address allocator - #6364
Draft
ShadowCurse wants to merge 3 commits into
Draft
ShadowCurse wants to merge 3 commits into
ShadowCurse wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6364 +/- ##
==========================================
+ Coverage 83.59% 83.60% +0.01%
==========================================
Files 282 283 +1
Lines 33585 33712 +127
==========================================
+ Hits 28074 28184 +110
- Misses 5511 5528 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ShadowCurse
force-pushed
the
new_address_allocator
branch
2 times, most recently
from
October 30, 2026 18:17
26935c6 to
b0ad0e8
Compare
Add new allocator of address ranges to replace the vm-allocator one. It tries to keep more or less the same API but differs in the implementation which gives it speed and memory usage benefits. The basic design of new allocator is to keep allocated ranges in a sorted static array, with free ranges being gaps between them. Compared to vm-allocator, which keeps free and allocated ranges in an interval tree of boxed nodes, measured on an m8g host with 16 to 255 allocated ranges: - first and last match allocations are 4 to 9 times faster, - an exact allocation followed by a free is 1.2 to 4.5 times faster with 16 ranges, and from 1.5 times faster to 4 times slower with 128 and 255, as both shift the ranges after the one they insert or remove, - cloning it for a snapshot takes a constant 53ns instead of 0.7us to 11us, - serializing and deserializing it is 70 to 450 times faster, and it takes 3.6 to 3.7 times less space in a snapshot. Compared to the parts of vm-allocator 0.1.4 used by Firecracker (error types, address allocator and interval tree), with coverage measured by llvm-cov over each implementation's own unit tests: - lines of code (excluding comments, blanks and tests): 591 vs 212, - instrumented lines: 451 vs 223, - line coverage: 90.2% vs 95.1%. The new allocator also comes with Kani proofs that, for any valid allocator, allocation with each policy and free behave as specified. Signed-off-by: Egor Lazarchuk <[email protected]>
Replace vm-allocator with new address allocator. Most noticable changes here are: - new allocator returns first address of the allocation, so callers don't need to call `.start()` all the time. - freeing a range is done with start/len pairs instaed of ranges Signed-off-by: Egor Lazarchuk <[email protected]>
Nothing uses it anymore. Signed-off-by: Egor Lazarchuk <[email protected]>
ShadowCurse
force-pushed
the
new_address_allocator
branch
from
October 30, 2026 18:32
b0ad0e8 to
57eb38b
Compare
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
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
Replace vm-allocator
AddressAllocatorwith home madeAddressAllocator. This brings some speed and memory savings with a much simpler internal implementation.Since this was the last type used from vm-allocator crate, drop the crate.
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 checkbuild --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyle --no-clippyto verify that the PRpasses the automated 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.