Repository navigation
refactor the rbtree / interval tree in virtio thunk and fix issue for virtio driver - #12469
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
191558b to
8afff35
Compare
dayatsin-amd
left a comment
There was a problem hiding this comment.
It seems this patches is bringing in some other changes other than the RB Tree refactor.
Can you please move the other changes to a separate PR.
8afff35 to
765593a
Compare
Got it, only keep the license scan fix commit now. |
18ddeac to
0e0f851
Compare
0e0f851 to
fba8eea
Compare
cfreeamd
left a comment
There was a problem hiding this comment.
🤖 AI-assisted pre-review (for @cfreeamd)
[Required] PR title refactor the rbtree / interval tree in virtio thunk and fix issue for virtio driver does not follow the required type(component): summary format that becomes the permanent squash-merge commit. Suggested: refactor(hsakmt): replace custom augmented interval tree with plain rbtree scan in virtio thunk.
Other files reviewed: hsakmt_interval_tree.c, hsakmt_interval_tree.h, hsakmt_virtio_memory.c. The algorithm is correct — interval_tree_scan starting from the BST minimum and terminating when node->start > last is a valid O(n) scan on a tree ordered by start. The O(n) complexity is explicitly documented in the header comment.
dac749d to
d3849d7
Compare
|
🎉 All checks passed! This PR is ready for review. |
6b70d74 to
dac749d
Compare
…sed scan hsakmt_interval_tree.c/.h were a structural port of the Linux kernel's augmented rbtree (lib/rbtree.c, rbtree_augmented.h, interval_tree_generic.h), GPL-2.0 source carrying an MIT header (Palamida SWCSD-15612 finding). Keep the file names and public API (interval_tree_t, interval_tree_node_t, hsakmt_interval_tree_insert/remove/iter_first/iter_next) unchanged to avoid a wide-reaching rename and to keep the door open for a real augmented interval tree later; only the internal implementation changes. The new implementation is built on the existing BSD-2-Clause nginx-derived rbtree.c already used for bo_rbt. Ranges are ordered by start address and overlap queries do a bounded ascending scan instead of maintaining an augmented subtree-max invariant. This is O(n) worst case instead of O(log n), an acceptable trade-off given the small number of userptr/SVM ranges tracked per process. Signed-off-by: Honglei Huang <honghuan@amd.com>
dac749d to
980c0b9
Compare
rbtree-based scan hsakmt_interval_tree.c/.h were a structural port of the Linux kernel's augmented rbtree (lib/rbtree.c, rbtree_augmented.h, interval_tree_generic.h), GPL-2.0 source carrying an MIT header (Palamida SWCSD-15612 finding). Keep the file names and public API (interval_tree_t, interval_tree_node_t, hsakmt_interval_tree_insert/remove/iter_first/iter_next) unchanged to avoid a wide-reaching rename and to keep the door open for a real augmented interval tree later; only the internal implementation changes. The new implementation is built on the existing BSD-2-Clause nginx-derived rbtree.c already used for bo_rbt. Ranges are ordered by start address and overlap queries do a bounded ascending scan instead of maintaining an augmented subtree-max invariant. This is O(n) worst case instead of O(log n), an acceptable trade-off given the small number of userptr/SVM ranges tracked per process. Signed-off-by: Honglei Huang <honghuan@amd.com> [rocm-systems] ROCm/rocm-systems#12469 (commit 63802ea)
TheRock Submodule Bump ActivityNewest first
|
Motivation
Refactor rbtree/interval tree with internal implementation
Technical Details
refactor the rbtree in virtio thunkloader
Issue Tracking
JIRA ID : SWCSD-12742
Test Plan
rocr
hiptest
Test Result
all pass