Skip to content

uvm: avoid over-reserving tracker entries#1139

Open
LwhJesse wants to merge 1 commit into
NVIDIA:mainfrom
LwhJesse:uvm-avoid-tracker-overreserve
Open

uvm: avoid over-reserving tracker entries#1139
LwhJesse wants to merge 1 commit into
NVIDIA:mainfrom
LwhJesse:uvm-avoid-tracker-overreserve

Conversation

@LwhJesse
Copy link
Copy Markdown

Avoid unnecessary tracker growth when merging duplicate tracker entries.

uvm_tracker_add_tracker() used to reserve src->size entries 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:

make modules -j$(nproc)

Result:

build exit code: 0

I did not install or load the generated modules.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 10, 2026

CLA assistant check
All committers have signed the CLA.

@LwhJesse LwhJesse marked this pull request as ready for review May 10, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants