A recovery carries Private heaps with the buffers placed in them
What: a device's recovery now carries each live heap to the new VkDevice (Heap::carry,
called from Device::carry_to after the buffers, or by a heap's maker where the recovery
took the generation first). A Private heap's own buffer is made again in new memory placed
where the heap's textures can lie (place_heap_buffer), zeroed as a carried Private buffer
is, keeping its ObjectId, hazard key, Metal address and range, range token, label and
purgeable state; the heap is registered by its key there and kept in the new generation's
registry for a later recovery. Each live buffer placed in it gets a new link on the new
generation (Buffer::carry_placed) at the same offset of the carried bytes, with the same
ObjectId, address, label and a shared aliasable flag; its old link lets go of its live-list
entry and device handle at the lost generation's rest (LostPlaced). A placed buffer's drop
gives an automatic heap's range back only from the link carried to last, so a carried
buffer frees its range once. A buffer placed while the heap is being carried carries itself
under the heap's placed lock. The heap's textures made before stay the lost generation's
(no recovery carries a texture); the heap forgets them (keeping their numbering), so a
use_heap on the new generation never makes an old image resident. Shared heaps (their bytes
are pooled host-visible memory, never the runtime's own pages), no-copy heaps and sparse
heaps stay left, with their buffers.
The recovery notice now counts carried heaps ("N `Private` heaps (B bytes) with the M
buffers placed in them") and left heaps by kind, and splits the old "buffers over the
caller's or exportable memory" into "buffers over the caller's `VkBuffer`" and "buffers in
exportable memory" (Left::Caller / Left::Exported). Docs: carry.rs module docs, the
Buffer::carry docs, heap.rs, MadeBeforeRecovery, the device-recovered cost (degradation.rs
and docs/API.md), the runtime README. REFUSALS.md regenerated: unchanged.
Why: after a GPU recovery a guest's MTLHeap newBufferWithLength:options:offset: was refused
NotImplemented(MadeBeforeRecovery) and the guest got nil; Metal's heap goes on.
Verified: see the lane run reported with this sha (the test commit before it fails, this
one passes).
This commit is contained in:
1 parent
d82bb79981
commit
b10839e2b2
7 files changed
+400
-78
No files matched your search
+13
-8
@@ -3669,19 +3669,24 @@ bound.
|
||||
kind. Announced too, at most once each per recovery whatever an earlier
|
||||
recovery announced: where a call waited past 10 seconds for the recovery under way, where its
|
||||
command buffers in flight took past 10 seconds to fail, and where its new `VkDevice` could not
|
||||
be made, after which the device answers as a lost one. `Device::recover_for_test` runs the same recovery with no GPU fault. Cost: the events,
|
||||
uses of guest RAM, no-copy buffers, `Private` buffers and buffers in the runtime's own pages
|
||||
(fresh pages, and the blocks of pages the `Shared` and `Managed` buffers lie in where the
|
||||
device's checks found a held host-page import costs its submissions nothing and textures over
|
||||
such pages take what they take over its own memory) made before it go on, a `Private` buffer's
|
||||
contents lost (it reads zero); the other objects made before it are
|
||||
refused (`MadeBeforeRecovery`), where Metal's go on; the calls during it wait for it, and a
|
||||
be made, after which the device answers as a lost one. `Device::recover_for_test` runs the
|
||||
same recovery with no GPU fault. Cost: the events, uses of guest RAM, no-copy buffers,
|
||||
`Private` buffers, buffers in the runtime's own pages (fresh pages, and the blocks of pages the
|
||||
`Shared` and `Managed` buffers lie in where the device's checks found a held host-page import
|
||||
costs its submissions nothing and textures over such pages take what they take over its own
|
||||
memory) and `Private` heaps with the buffers placed in them made before it go on, a `Private`
|
||||
buffer's or heap's contents lost (it reads zero); the other objects made before it are refused
|
||||
(`MadeBeforeRecovery`), where Metal's go on; the calls during it wait for it, and a
|
||||
device call the loss met while it ran runs again after it. A no-copy buffer is made again over
|
||||
the same pages on the new `VkDevice`, as its making or last rebind made it, so the caller's
|
||||
import gate, resolver of guest RAM runs and dma-buf source are asked again, on the thread that
|
||||
recovers, before the new device serves; its deallocator runs at its release once no `VkDevice`'s
|
||||
import of its pages is left. A detached no-copy buffer, and a no-copy heap's buffers, are
|
||||
refused.
|
||||
refused. A `Private` heap is the same heap on the new `VkDevice` (its identity, address and
|
||||
label), its bytes new memory that reads zero, with the buffers placed in it; buffers and
|
||||
textures are made in it again, and the textures it made before are refused, as every texture
|
||||
made before the recovery is. A `Shared` heap, whose bytes are pooled host-visible memory the
|
||||
device allocated, is refused with its buffers, as a pooled buffer is.
|
||||
- `metal2vulkan-degrade-private-properties-unknown` (precision). `PrivatePropertiesUnknown`: Apple's
|
||||
private device properties the device has no answer for: no document describes them and nothing the
|
||||
device reports maps to them. Cost: the device gives no answer for them (`PrivateAnswer::value` is
|
||||
|
||||
Reference in new issue
Block a user