uvm: avoid over-reserving tracker entries#1139
Open
LwhJesse wants to merge 1 commit into
Open
Conversation
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.
Avoid unnecessary tracker growth when merging duplicate tracker entries.
uvm_tracker_add_tracker()used to reservesrc->sizeentries before merging. That is only a conservative upper bound: if a source entry already has a matching channel in the destination tracker,uvm_tracker_add_entry()updates the existing value instead of appending a new entry.This can make a small tracker grow from its static entry storage to dynamic storage even when the merge adds no new entries.
Change the reserve path to compute the exact requirement only when the conservative upper bound would exceed the current capacity. The existing OOM fallback remains unchanged.
Also extend
test_tracker_add_tracker()to cover the duplicate single-entry merge case and verify that the destination tracker remains on static storage.Build-tested with:
Result:
I did not install or load the generated modules.