-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add provisions to unload a program from the cache #31036
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31036 +/- ##
========================================
Coverage 81.4% 81.5%
========================================
Files 728 728
Lines 206240 206379 +139
========================================
+ Hits 168079 168241 +162
+ Misses 38161 38138 -23 |
Do we have tests that the transitions loaded -> unloaded and vice versa retain the usage statistics? |
Added a new test in the latest commit. |
existing.usage_counter.load(Ordering::Relaxed), | ||
Ordering::Relaxed, | ||
); | ||
second_level.swap_remove(entry_index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the record: this newly-added instance of .swap_remove()
is fixed at #32973
Problem
The program usage counts reset when it gets evicted from the cache.
Summary of Changes
Unloaded
) for programs in the cache. When a program get evicted, it'll be replaced with this type. It'll keep track of program's usage count and other meta data.Fixes #