Files
reims-vgpu/crates
Anees Iqbal 24e61c1903 🐎 Lay staged copies in pieces of rt's unit, not one buffer
A staged copy took one Shared buffer of the surface's length. On rt a take
longer than the pool's unit (16 MiB) makes an allocation of its own length in
the call: the rp-diag walk measured 33.4 ms on a 780M and 26.3 ms on a 3090 for
one 144 MiB take, on the ring thread, and that allocation serves only takes of
its own length.

A copy now lays the bytes it moves back to back in pieces of at most rt's unit
(MemoryClass::Shared.block_len()), splitting a range at a piece's end, the last
piece rounded up to rt's 64 KiB granule. rt carves each piece from its pool's
free ranges, or makes one unit where none fits, so no take is longer than the
unit. A download's record-narrowed spans pack the same way, and its CPU copy
reads each span from where its bytes were packed. The spares keep two whole
pieces and give a take the shortest that holds it; nothing is made ahead.

The pieces taken, those spares served, and the makes with their nanoseconds,
split between a cache's first staged copy and the copies after it, are counted
on the counts line, for the walk that compares them with the 33.4 and 26.3 ms.

The bytes the guest sees are unchanged: each byte moves between its own place
in the cache and its own place in the pages, as before.
2026-11-19 13:42:45 -08:00
..