-
Notifications
You must be signed in to change notification settings - Fork 7
Update budget by OS budget change events. #471
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
Conversation
b495183 to
a3143b1
Compare
|
@bjjones can you PTAL? |
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.
LGTM. Did you plan to add functionality for paging based off of budget changes? Seems like it would make this feature more useful.
Could you elaborate on this more? If I call Evict on a background thread, wouldn't that be nearly equivelent to checking then calling Evict upon ExecuteCommandLists? In both cases, Evict is called the same number of times. But I do see an opprotunity to unblock the main thread, when Evict is called, but only if nothing else uses the device (or it will block again). In contrast, QueryVideoMemoryInfo gets called per ExecuteCommandLists, not per paging, so moving it away from the main thread holds more beneifit since it saves CPU cycles when under budget. However, it does seem like a good idea to have async Evict since real world apps may keep busy enough to hide this latency. |
I was thinking in the case that you had maxed out the budget and a significant budget change occurred (which can happen when changing focus to a different window) your memory residency would not be in the optimal state and wouldn't be fixed until the next ExecuteCommandLists call. Maybe this isn't impactful in reality - since ExecuteCommandLists is usually called at a granularity that would hide dropped frames - but could there be an ML/AI scenario that doesn't call so frequently? Note that it could not just be for page out, but could be for page in too if you were switching your residency-managed app back to the foreground causing a big budget increase. I know Evict is very fast already so I don't know that there's really much value offloading it. |
Instead of polling for latest residency usage, OS event based updates are used. Closes Update budget using OS events or non-polling based. #319
|
@bjjones We can't page-in heaps outside of |
Instead of polling for latest usage, OS event based updates are used by default. #319