Repository navigation
Conversation
A device that runs out of memory looks for a copy in its read LRU whose memory it can take. It passes over every copy whose reference count is above one, on the grounds that the extra reference belongs to a task completion that has yet to run and will drop it shortly. That is no longer the only thing such a reference can be. A copy handed to a successor is retained by the data repository that carries the dependency, and a reshape promise parked there retains both the copy it was given and the one it produced. Those references last as long as the dependency does, which can be until the end of the taskpool, and they are not waiting on anything this device can do. With little enough device memory, every copy in the LRU is referenced that way and the search comes back empty. The device has memory, all of it spoken for by copies nobody is reading, and the tasks waiting for a block wait for a release that is never coming. Let the search take those copies. The copy object has to survive, since the holders point at it, but its memory does not: emptied, it stays attached to its data, keeps the version its content had, and is marked invalid with nothing in flight. Anybody who needs the value again gives it memory back and stages it in from the host mirror, which is where the value went. Emptying a copy is only admissible when the value can be brought back, so examine the candidate first. A shared copy whose host mirror carries the same version can be emptied as it is. A copy holding no value at all is free to empty, which is what a reservation that had to be given up leaves behind. A copy the device owns, or one that is shared but ahead of the mirror, holds the only current value; move it to the owned list, where the write-back hands the value and the version to the host and returns it shared, which is precisely the state that makes it recoverable. Only start doing any of this once a full sweep has shown there is no copy left that this device owns outright. Three places assumed a copy always has memory behind it. A transfer looking for a source could pick an emptied peer, and hand the copy routine a source pointer of nil; it now passes those over, and a flow that also writes, which never looked for an alternate source at all, falls back on the host mirror. A source that is invalid was taken to mean a transfer is on its way in and is worth coming back for, which is not true of one that was emptied, so that now keys off the transfer being in flight. And the push completion skipped any flow whose input already sits on this device, on the grounds that no transfer was needed to bring it in; a copy being refilled is both the input and the output of its flow, so it was skipped and left under transfer for good, which is a state the eviction will never take memory back from.
bosilca
force-pushed
the
topic/host-mirror-reachable
branch
from
September 27, 2026 17:46
3ab5dd5 to
b3e3edb
Compare
bosilca
force-pushed
the
topic/device-copy-placeholder
branch
from
September 27, 2026 17:46
f2ac004 to
a1680a4
Compare
Owner
Author
|
Moved upstream as ICLDisco#813 so it is visible there. |
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.
When every copy on a device is still pointed at from outside it, the victim search used to find nothing and the task stayed starved. A device can now take the memory of such a copy and leave the copy object behind as a placeholder: it stays attached to its data, marked invalid, and whoever still holds it recovers the value from the host mirror on the next stage in.
Stacked on #5.