Files
reims-vgpu/docs
Anees Iqbal 4ba367291f 🐎 Keep a released pages block's view with its import unknown
6c43e73eac let go of a pages block's view and its import at the block's
release, so that no pin resolved in the import once the kext gave the pages
back. A pages block made again over the same runs then imported its view anew,
and every such import was freed again: on ms01's Iris Xe (job m3-max-87443),
22 more views of 4 to 16 MiB a boot were imported again, and the pages' p99
frame time rose from 21 to 26.75 ms (scroll) and from 23 to 29 ms
(autoscroll), at the same frame rate. An import's free is a vkFreeMemory that
the driver may hold a vkQueueSubmit beside for its length (11.4 ms on an RTX
3090; metal2vulkan-runtime's submit_calls docs).

The cache keeps a released pages block's view of at most 32 MiB with its
import again, within the cache's bounds as they were (32 views, 1 GiB, 10 s
unheld plus two looks). The platform that knows the import as a block now
forgets it for now at the release, before the answer, and at its context's
close, unless another live block holds the view: the view import answers a
KnownSwitch, which on rt takes the block's handle out of the device's known
blocks and keeps it. A block over the same runs that takes the view knows the
import again, at the same address.

What changes for the guest: a pages block made again over the runs of a
released one takes the released view again, so the address IMPORT_ADDRESSES
answers and the gpuAddress of the no-copy buffers over it are the released
block's import's, as before 6c43e73eac. A buffer the guest pins at an address
in a cached view's import is still made apart. What the host keeps: the import
maps the pages the guest reuses until the cache lets the view go, so a GPU
address the guest kept of a buffer it destroyed reaches them from a shader for
at most about 12 s, where a Mac's GPU faults. The views' line counts the pages
views taken from the cache again.

Tests: released_pages_views_are_kept_at_most_32_none_of_their_imports_known
(33 views, and one of 32 MiB plus a page),
on_vulkan_released_pages_views_past_1_gib_leave_at_most_1_gib_cached_none_known
and on_vulkan_a_pin_in_a_cached_pages_view_lies_outside_its_pages_until_a_block_takes_it
are red where the cache keeps the import known and where it keeps no view;
a_pages_block_s_address_is_its_view_s_known_import_s_where_the_platform_knows_one
checks the import unknown while cached and known again as it is taken. The
tests that held views made anew are back to the cached forms.
2026-12-04 19:10:50 -08:00
..