Files
metal2vulkan/docs
Anees Iqbal 48ba1d9856 Guest RAM on a device that pays per listed import: few long chunks, none ahead, idle ones released
Where the device imports dma-bufs, the RAM has a source and the device's held imports add to the
cost of every submission (RADV), each listed import costs every submission: an 8 GiB RAM as 128
dma-bufs of 64 MiB raised a submission's median from 14 us to 60-88 us on the 780M (probe
submit_per_ram_dma_buf, job 3904), as 3 of 2730 MiB to 16 us.

There (Plan::listed) a chunk is as long as one dma-buf of the source holds
(HostRam::with_largest_dma_buf, new: udmabuf's size_limit_mb) and maxMemoryAllocationSize,
maxBufferSize and maxStorageBufferRange take, in whole 64 MiB (listed_chunk_bytes). No thread
imports ahead and no run is imported alone; the device's thread instead releases a chunk only its
slot holds once it stayed so for its window (2 s, doubled per release up to 64 s, as a no-copy
buffer's idle import), counted by the new WorkCounts::host_ram_chunks_released.

Tests: listed_chunk_bytes and long chunk_spans unit tests; a device test
(where_each_listed_import_costs_a_submission_...) of one long chunk, none ahead, kept while held,
released once idle and imported again; the probe submit_per_ram_chunk (8 GiB memfd RAM, an
object over each 64 MiB). Docs: host_ram.rs, with_runs, HOWTO section 6, FAST-PATHS idle-release
row, api_signatures.

Not built yet: the next commits fix forward what the build finds.

(cherry picked from commit e313ddd4201e87a76490a36eb394281d6961dbc9)
2026-11-07 10:32:40 -08:00
..