iommu/vfio: introduce best-fit iova allocation - #40
Merged
Conversation
minwooim
commented
Aug 8, 2025
Collaborator
Added two helpers to find adjacent range in the given @list. skiplist_find: To find a exact range matches with the @key (existing) skiplist_find_le: To find a largest range <= @key, previous adjacent skiplist_find_ge: To find a smallest range >= @key, next adjacent Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
Collaborator
|
LGTM. It would be good to add a few tests in |
Collaborator
Author
agreed. I will put some tests. |
Add test cases for skiplist to test skiplist_find_le() and skiplist_find_get(). Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
Introduce a best-fit IOVA allocation policy to vfio_iommu_type1 device to reuse previously allocated and freed IOVA ranges in the next allocation. Unlike `iommufd` which allocates the IOVA address in the kernel side, `vfio_iommu_type1` device should manage the IOVA ranges in libvfn to avoid permanently incremental memory allocation for a long-lived application like ``unvme-cli``. Firstly try to allocate from @free_iovas skiplist for a new IOVA allocation with a best-fit allocation method, and if not, it goes to the previous way with `__iova_reserve()`. Other than this, no functional changes. Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
iomartin
added a commit
to Eideticom/libvfn-pub
that referenced
this pull request
Aug 17, 2026
Martin/mlkem test v2
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.