🐎 Bind several runs of guest RAM through one dma-buf a view

A no-copy buffer's or heap's pages in several runs of guest RAM took a piece
of each 64 MiB region's dma-buf, bound in a sparse buffer. RADV maps each
chunk of a sparse buffer as a GPU VA operation of its own, and amdgpu updates
its page tables for each, at the bind and again at the release. Since the
kext's slabs became runs of 64 KiB chunks (f5b6cd95a), slab buffers took that
route: on the RX 7900 XTX, Geekbench 7.1.0's Metal compute pass ran 181,391
of the kernel's SDMA jobs (3.62 s), 137,742 of them page-table updates,
against 45,115 (1.21 s) before the regions, and Video Filter took 1.17 times
its native time against 1.10.

A region piece now answers one run inside one region alone. Pages in the
runs of one of the library's views take a piece of one dma-buf of the
view's runs (UDMABUF_CREATE_LIST), made at the first such request while none
is alive and shared by its Arc, so the view's buffers and heaps are bound
plainly in one import of it. The backing table numbers each record of runs,
so a run recorded over part of a view, another record's, is never answered
with the view's pages. A view past one dma-buf (udmabuf's limits, at most
64 MiB) leaves its requests to dma-bufs of their own. A dma-buf of each
request's own was tried first: it ended the page-table jobs, but the device
held about three times the imports, each in every submission's list, and
Super Resolution and Face Tracking ran slower (1.40 and 1.21 times native
against 1.36 and 1.17).

Measured on 2026-11-16 (RADV of Mesa 26.2.6, Linux 7.3.3, a 26.7.2 guest):
- RX 7900 XTX, the traced warm pass, two runs (m3-max-36273, -36274) against
  one on development (m3-max-36097): the kernel's SDMA jobs 12,583 to 15,030
  (0.46 to 0.56 s), 2,172 to 2,386 of them page-table updates, against
  181,391 (137,742); 3 sparse buffers against 453, and 466 to 467 imports
  made against 901 (1,258 with a dma-buf each); the pass's geometric mean
  1.236 to 1.242 times native against 1.258 (1.256 before the regions);
  Video Filter 1.06 against 1.17, Feature Matching 1.51 to 1.54 against
  1.58, Face Tracking 1.16 against 1.17, Super Resolution 1.37 to 1.38
  against 1.36, none outside the spread of the runs before the regions but
  for those that improved. MANAGED_BUFFER_CREATE's ring-0 time came back
  with the kernel's jobs: Path Tracer 0.014 s, Photo Filter 0.020 to 0.024,
  Feature Matching 0.016 to 0.026, Video Filter 0.028 to 0.029, against
  0.095, 0.085, 0.132 and 0.102 (0.026, 0.031, 0.031 and 0.141 before the
  regions).
- Radeon 780M, the desktop walk (Finder, Launchpad three times), two walks
  each (m3-max-36227, -36228 against -36128, -36129): Launchpad's last steps
  ended with 234 to 242 imports against 225 to 234, at 54.2 to 54.4 presents
  a second against 54.2 to 54.5 and 6.0 to 6.6 ms of submissions a present
  against 5.9 to 6.9. Geekbench's pass, one run (m3-max-36229): 1.033 times
  native against 1.062 before the regions, no workload slower.

Nothing changes for the guest: each buffer and heap lies at the same address
over the same pages, and the host only imports them otherwise.

Tests: a region piece is one run inside one region; pages in one view's runs
share its dma-buf, made again once none lives, a run recorded over the view
splitting it; a view past one dma-buf gives none; pages in several runs take
one dma-buf of their own, and past the list limit chunks; the table's runs of
one record keep its number through cuts and protects; and on the GPU two
buffers over one view of guest RAM in two runs are one import, the second
joining it, with no sparse buffer, reading the view's pages in order (it
fails on development: one sparse buffer over a region's piece).
This commit is contained in:
Anees Iqbal committed 2026-11-16 06:04:09 -08:00
1 parent 4b914ec4b9
commit bfeba3252b
4 files changed
+857 -379

No files matched your search

+167 -8
View File
@@ -60,13 +60,24 @@ pub(crate) struct Backing {
}
/// A run of the library's own mapping: its end, its file, the protection set on it (core's
/// `VmProt`), and the dma-buf it is mapped through, if it is (module docs).
/// `VmProt`), the dma-buf it is mapped through, if it is (module docs), and the view it is of.
#[derive(Clone, Debug)]
struct Run {
end: u64,
backing: Backing,
prot: VmProt,
through: Option<Through>,
/// The number of the record that made it ([`next_view`]): the runs of one view, recorded at
/// once, share it, and a run cut or protected keeps it. A run's file and offset never change
/// under its number, so bytes of runs of one number show the pages they showed as the view
/// was recorded ([`view_of`]).
view: u64,
}
/// A number for a new record of runs ([`Run::view`]), unique in the process.
fn next_view() -> u64 {
static NEXT: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);
NEXT.fetch_add(1, std::sync::atomic::Ordering::Relaxed)
}
/// Where a run mapped through a dma-buf lies in it: the dma-buf, by a number of the process's
@@ -304,6 +315,7 @@ impl Table {
offset: t.offset + (at - first),
..t.clone()
}),
view: run.view,
};
self.insert(first, Run { end: at, ..run });
self.insert(at, tail);
@@ -347,7 +359,7 @@ impl Table {
}
/// `first..end` shows `backing` with protection `prot` from now on, mapped through the
/// dma-buf `through` names where it does (`record`).
/// dma-buf `through` names where it does (`record`), a record of its own ([`Run::view`]).
fn record(
&mut self,
first: u64,
@@ -355,6 +367,19 @@ impl Table {
backing: Backing,
prot: VmProt,
through: Option<Through>,
) {
self.record_of(first, end, backing, prot, through, next_view());
}
/// [`Self::record`], as a run of the record numbered `view`.
fn record_of(
&mut self,
first: u64,
end: u64,
backing: Backing,
prot: VmProt,
through: Option<Through>,
view: u64,
) {
self.forget(first, end);
if first < end {
@@ -365,6 +390,7 @@ impl Table {
backing,
prot,
through,
view,
},
);
}
@@ -411,8 +437,8 @@ impl Table {
/// holds ([`Self::holds_none`]), in order: nothing of another run to cut or drop, and each
/// piece joins only the one before it, the first the run before the range and the last the
/// run after it, as [`Self::insert`] counts them, counted from the pieces themselves before
/// they go in.
fn record_fresh(&mut self, target: u64, pieces: Vec<Piece>) {
/// they go in. The runs are of the record numbered `view`.
fn record_fresh(&mut self, target: u64, pieces: Vec<Piece>, view: u64) {
let runs: Vec<(u64, Run)> = (pieces.into_iter())
.filter_map(|piece| {
let first = target.saturating_add(piece.at);
@@ -424,6 +450,7 @@ impl Table {
backing: piece.backing,
prot: piece.prot,
through: None,
view,
},
))
})
@@ -613,6 +640,8 @@ pub(crate) fn view_pieces(sources: &[(u64, u64)]) -> Result<Vec<Piece>, (usize,
/// Over bytes no run holds, as a view's over core's fresh reservation, the pieces in order are
/// added as they are, with no run to cut ([`Table::record_fresh`]).
pub(crate) fn record_pieces(target: u64, pieces: Vec<Piece>) {
// One view's runs, one record's number.
let view = next_view();
let mut table = TABLE.lock();
let end = (pieces.iter())
.map(|p| target.saturating_add(p.at).saturating_add(p.length))
@@ -622,13 +651,13 @@ pub(crate) fn record_pieces(target: u64, pieces: Vec<Piece>) {
&& in_order
&& table.holds_none(target, end)
{
table.record_fresh(target, pieces);
table.record_fresh(target, pieces, view);
return;
}
for piece in pieces {
let first = target.saturating_add(piece.at);
let end = first.saturating_add(piece.length);
table.record(first, end, piece.backing, piece.prot, None);
table.record_of(first, end, piece.backing, piece.prot, None, view);
}
let closing = table.closing();
drop(table);
@@ -639,11 +668,12 @@ pub(crate) fn record_pieces(target: u64, pieces: Vec<Piece>) {
/// (module docs).
#[cfg_attr(windows, allow(dead_code))]
pub(crate) fn record_through(target: u64, pieces: Vec<(Piece, Through)>) {
let view = next_view();
let mut table = TABLE.lock();
for (piece, through) in pieces {
let first = target.saturating_add(piece.at);
let end = first.saturating_add(piece.length);
table.record(first, end, piece.backing, piece.prot, Some(through));
table.record_of(first, end, piece.backing, piece.prot, Some(through), view);
}
let closing = table.closing();
drop(table);
@@ -673,6 +703,59 @@ pub(crate) fn through_pieces(first: u64, end: u64) -> Vec<Piece> {
.collect()
}
/// The view the `length` bytes from `first` lie in: the number of the record whose runs hold
/// every byte of them, one run after another ([`Run::view`]); `None` where a byte lies in no
/// run, or in a run of another record.
#[cfg_attr(not(any(test, target_os = "linux")), allow(dead_code))]
pub(crate) fn view_of(first: u64, length: u64) -> Option<u64> {
let end = first.checked_add(length)?;
let table = TABLE.lock();
let (start, run) = table.run_at(first)?;
let view = run.view;
let mut at = start;
for (&from, run) in table.runs.range(start..end) {
if from != at || run.view != view {
return None;
}
at = run.end;
}
(at >= end).then_some(view)
}
/// The runs of the record numbered `view` around the byte `at` that follow on from one another
/// with no byte between ([`Run::view`]), as pieces from the first of them ([`pieces`]): its
/// first byte, and the pieces. `None` where `at` lies in no run of that record, or where they
/// are more than `most` runs.
#[cfg_attr(not(any(test, target_os = "linux")), allow(dead_code))]
pub(crate) fn view_runs(view: u64, at: u64, most: usize) -> Option<(u64, Vec<Piece>)> {
let table = TABLE.lock();
let (start, run) = table.run_at(at)?;
if run.view != view {
return None;
}
let (mut first, mut end, mut runs) = (start, run.end, 1usize);
for (&from, run) in table.runs.range(..start).rev() {
if run.end != first || run.view != view {
break;
}
(first, runs) = (from, runs + 1);
if runs > most {
return None;
}
}
for (&from, run) in table.runs.range(end..) {
if from != end || run.view != view {
break;
}
(end, runs) = (run.end, runs + 1);
if runs > most {
return None;
}
}
let mut pieces = Vec::new();
(table.pieces_into(first, end - first, 0, &mut pieces)).then_some((first, pieces))
}
/// The dma-buf a view is mapped through whole ([`Kept`]) where the `length` bytes from `first`
/// are all of it, in order: each run there lies in that dma-buf at the offset of its first byte
/// from `first`. None where a byte of them lies elsewhere, or the dma-buf holds more.
@@ -1286,6 +1369,82 @@ pub(crate) mod tests {
assert_eq!((t.mappings(), t.joins, t.runs.len()), (0, 0, 0));
}
/// A view's runs, recorded at once, are one record's: a range in them answers its number,
/// and its runs around a byte resolve as its pieces, after a protect cut one; a range that
/// reaches a gap, another view or a run recorded over part of the view answers none, nor do
/// more runs than asked for
#[test]
fn a_views_runs_are_one_records() {
let (f, g) = (file(), file());
let base = 0x7d00_0000_0000;
let page = 0x1000;
let at = |i: u64| base + i * page;
let piece = |i: u64, fd: &Arc<HostFile>, offset| Piece {
at: i * page,
length: page,
backing: Backing {
file: Arc::clone(fd),
offset,
},
prot: READ_WRITE,
};
// A view of four pages, backwards in `f`, and another of two of `g` after a gap.
let view: Vec<Piece> = (0..4).map(|i| piece(i, &f, (9 - i) * page)).collect();
record_pieces(at(0), view);
record_pieces(at(5), vec![piece(0, &g, 0), piece(1, &g, 4 * page)]);
let one = view_of(at(0), 4 * page).expect("the first view's");
assert_eq!(view_of(at(1), 2 * page), Some(one));
let two = view_of(at(5), 2 * page).expect("the second's");
assert_ne!(one, two);
assert_eq!(view_of(at(3), 2 * page), None, "into the gap");
assert_eq!(view_of(at(4), page), None, "the gap");
let (first, pieces) = view_runs(one, at(2), 4).unwrap();
assert_eq!(first, at(0));
assert_eq!(
shape(&pieces),
[
(0, page, 9 * page),
(page, page, 8 * page),
(2 * page, page, 7 * page),
(3 * page, page, 6 * page)
]
);
assert!(
view_runs(one, at(2), 3).is_none(),
"four runs, three asked for"
);
assert!(view_runs(two, at(2), 4).is_none(), "not the second view's");
protect(at(1), page, VmProt::READ);
assert_eq!(
view_of(at(0), 4 * page),
Some(one),
"a protect keeps the number"
);
let (first, pieces) = view_runs(one, at(3), 4).unwrap();
assert_eq!((first, pieces.len()), (at(0), 4));
let over = Backing {
file: Arc::clone(&g),
offset: 8 * page,
};
record(at(2), page, over, READ_WRITE);
assert_eq!(
view_of(at(0), 4 * page),
None,
"a run recorded over the view"
);
assert_eq!(view_of(at(0), 2 * page), Some(one));
let (first, pieces) = view_runs(one, at(0), 4).unwrap();
assert_eq!(
(first, shape(&pieces).len()),
(at(0), 2),
"the runs before it"
);
let (first, pieces) = view_runs(one, at(3), 4).unwrap();
assert_eq!((first, shape(&pieces)), (at(3), vec![(0, page, 6 * page)]));
forget(at(0), 7 * page);
assert_eq!(view_of(at(0), page), None);
}
/// Runs that follow on in one file with one protection resolve as one piece, as the kernel
/// maps them as one; a protection or a file apart cuts it
#[test]
@@ -1565,7 +1724,7 @@ pub(crate) mod tests {
let start = at(2) + piece.at;
one.record(start, start + piece.length, piece.backing, piece.prot, None);
}
fresh.record_fresh(at(2), pieces);
fresh.record_fresh(at(2), pieces, next_view());
assert_eq!(shape(&fresh), shape(&one));
}
}
File diff suppressed because it is too large. Load diff
+174 -20
View File
@@ -17,10 +17,12 @@
//! import otherwise, so every device that imports host memory imports as it did. A buffer's or a
//! heap's request over a view in a group dma-buf is answered with the view's piece of the group's
//! file (`super::dma_buf`'s module docs, "Groups"), where that piece's offset is a multiple of the
//! alignment the request asks; one over the guest's RAM with pieces of the RAM's region dma-bufs,
//! where they fit the request ("Regions"), each region's import then kept on the device that made
//! the object ([`ImportMade::made`], "Kept imports"); a texture's and any other request with a
//! dma-buf of its own, as before.
//! alignment the request asks; one over the guest's RAM in one run inside one region with that
//! piece of the region's dma-buf ("Regions"), the region's import then kept on the device that
//! made the object ([`ImportMade::made`], "Kept imports"); one over pages in several runs of one
//! of the library's views with that piece of the view's dma-buf ("Views"), where the view's runs
//! fit one ("Several pieces"); a texture's and any other request with a dma-buf of its own, as
//! before.
//!
//! And every import carries the views' gate ([`import_gate`]), which the runtime asks before it
//! imports a no-copy buffer's or heap's pages, or a buffer's new pages, by their pointer: where
@@ -1178,6 +1180,9 @@ unsafe fn host_memory_noting(
// dma-buf of its own, and a region's file, which the table of regions holds weakly, would be
// that at its first piece from its first page.
let regions: Mutex<Vec<super::dma_buf::RegionUse>> = Mutex::new(Vec::new());
// Each view's dma-buf the source answered with, held as a region's is: the runtime takes a
// view's first piece from its first page as a dma-buf of its own where it alone holds it.
let views: Mutex<Vec<Arc<std::os::fd::OwnedFd>>> = Mutex::new(Vec::new());
// The source's number in the trace's `dmabufsrc` (below): a diagnostic.
static SOURCES: AtomicU64 = AtomicU64::new(0);
let number = SOURCES.fetch_add(1, Ordering::Relaxed);
@@ -1189,8 +1194,9 @@ unsafe fn host_memory_noting(
let first = addr_of(request.start);
let (length, granule) = (request.length, request.granule);
// A buffer's or a heap's import of a grouped view's pages: a piece of the group's file
// (`super::dma_buf`'s module docs, "Groups"); else, of the guest's RAM, pieces of its
// regions' files ("Regions").
// (`super::dma_buf`'s module docs, "Groups"); else, of the guest's RAM in one run inside
// one region, the piece of the region's file ("Regions"). Pages in several runs take a
// piece of their view's dma-buf, else one of their own, below.
if request.shared_files {
let alignment = request.alignment;
super::dma_buf::asked_alignment(alignment);
@@ -1205,26 +1211,21 @@ unsafe fn host_memory_noting(
}]);
}
let one_chunk = request.one_chunk_alignment;
if let Some(pieces) =
super::dma_buf::ram_pieces(first, length, granule, alignment, one_chunk)
{
if let Some(piece) = super::dma_buf::ram_piece(first, length, one_chunk) {
log::debug!(
"{length:#x} bytes at {first:#x} as {} pieces of the guest RAM's region \
dma-bufs",
pieces.chunks.len()
"{length:#x} bytes at {first:#x} as the piece at {:#x} of a guest RAM region's \
dma-buf",
piece.chunk.offset
);
ANSWERED_REGIONS.with_borrow_mut(|answered| {
answered.extend(pieces.uses.iter().map(super::dma_buf::RegionUse::region));
});
let used = piece.region;
ANSWERED_REGIONS.with_borrow_mut(|answered| answered.push(used.region()));
// One use of each region a source: one asked again (a recovery's) holds it once.
let mut held = regions.lock();
for used in pieces.uses {
if !held.iter().any(|h| h.same(&used)) {
held.push(used);
}
if !held.iter().any(|h| h.same(&used)) {
held.push(used);
}
drop(held);
return Ok(pieces.chunks);
return Ok(vec![piece.chunk]);
}
}
// A whole view's pages, where it is mapped through one dma-buf kept for its imports: a
@@ -1240,6 +1241,23 @@ unsafe fn host_memory_noting(
length,
}]);
}
// A buffer's or a heap's import of pages in one view's runs: the piece of the view's
// dma-buf (`super::dma_buf`'s module docs, "Views").
if request.shared_files
&& let Some(chunk) =
super::dma_buf::view_piece(first, length, request.one_chunk_alignment)
{
log::debug!(
"{length:#x} bytes at {first:#x} as the piece at {:#x} of their view's dma-buf",
chunk.offset
);
let mut held = views.lock();
if !held.iter().any(|h| Arc::ptr_eq(h, &chunk.file)) {
held.push(Arc::clone(&chunk.file));
}
drop(held);
return Ok(vec![chunk]);
}
let began = crate::core::trace::on().then(crate::core::trace::now);
// A texture's own pages asked for again: the answer kept ([`Kept`]).
let again = match request.shared_files {
@@ -3297,6 +3315,142 @@ mod tests {
assert_eq!(unsafe { libc::munmap(start, length.to_usize()) }, 0);
}
/// Where views are imported through their dma-bufs and udmabuf opens (RADV's), no-copy
/// buffers over a view of the guest's RAM in two runs inside one region, each 16 pages at an
/// offset in the file 64 KiB divides (a slab of the bundle's 64 KiB chunks), are bound plainly
/// in one import of the view's dma-buf: the first, over the whole view, imports it, and the
/// second, over 16 pages across both runs, joins it; no sparse buffer and no piece of the
/// region's file (`super::dma_buf`'s module docs, "Several pieces" and "Views"). The GPU reads
/// the view's pages in its order through each. Elsewhere, said on stderr, nothing is checked.
#[test]
fn buffers_over_one_view_of_guest_ram_in_several_runs_share_its_dma_buf() {
let d = crate::gpu::device::tests::dev();
crate::gpu::device::tests::settle_device_checks(&d);
probes_gone();
if !groups_views() {
eprintln!(
"skipped: {} takes no view through its dma-bufs here, or udmabuf does not open",
d.raw.properties().name
);
return;
}
let length: u64 = 8 << 20;
let file = vm::memfd(length).unwrap();
// SAFETY: a fresh shared mapping of the file, which the test unmaps after the lease and
// the buffer over it.
let start = unsafe {
libc::mmap(
std::ptr::null_mut(),
length.to_usize(),
libc::PROT_READ | libc::PROT_WRITE,
libc::MAP_SHARED,
std::os::fd::AsRawFd::as_raw_fd(&*file),
0,
)
};
assert_ne!(start, libc::MAP_FAILED);
let at = start.addr().to_u64();
let lease = super::super::lease_guest_memory([crate::os::GuestRamFile {
host: at,
guest: 0,
length,
file,
offset: 0,
}]);
let pages: u64 = 32;
// Each RAM page's bytes its number.
for i in 0..pages {
// SAFETY: a page of the RAM's mapping above.
unsafe {
std::ptr::write_bytes(
vm::ptr(at + i * PAGE).cast::<u8>(),
i as u8,
PAGE.to_usize(),
)
};
}
let vm = LinuxVm::new();
let view = vm.allocate_anywhere(pages * PAGE).unwrap();
let half = pages / 2 * PAGE;
let runs = [
(HostAddr::from_addr((at + half).to_usize()), half),
(HostAddr::from_addr(at.to_usize()), half),
];
vm.remap_runs_shared_overwrite(view, &runs).unwrap();
let counts = |from: &rt::WorkCounts, to: &rt::WorkCounts| {
(
to.dma_buf_imports - from.dma_buf_imports,
to.dma_buf_pieces_joined - from.dma_buf_pieces_joined,
to.dma_buf_sparse_buffers - from.dma_buf_sparse_buffers,
)
};
let before = d.raw.work_counts();
let (buffer, gone) = no_copy(&d, view, pages);
let after = d.raw.work_counts();
assert_eq!(
counts(&before, &after),
(1, 0, 0),
"the view's dma-buf imported, bound plainly"
);
let inside = HostAddr::from_addr(view.addr() + (8 * PAGE).to_usize());
let (part, part_gone) = no_copy(&d, inside, pages / 2);
assert_eq!(
counts(&after, &d.raw.work_counts()),
(0, 1, 0),
"a piece of it joined, bound plainly"
);
let part_check = FoldCheck {
own: at,
view: inside.addr().to_u64(),
pages: pages / 2,
round: 0,
};
let (_part_out, part_copied) = part_check.run(&d.raw, &part.raw, false).unwrap();
for j in 0..pages / 2 {
let source = (j + 8 + pages / 2) % pages;
assert_eq!(
FoldCheck::ends(part_copied, j),
[source as u8; 2],
"the second buffer's page {j}"
);
}
drop(part);
let wait = std::time::Duration::from_secs(10);
assert_eq!(part_gone.recv_timeout(wait), Ok(()), "its deallocator ran");
let check = FoldCheck {
own: at,
view: view.addr().to_u64(),
pages,
round: 0,
};
let (_out, copied) = check.run(&d.raw, &buffer.raw, false).unwrap();
for j in 0..pages {
let source = (j + pages / 2) % pages;
assert_eq!(
FoldCheck::ends(copied, j),
[source as u8; 2],
"the view's page {j}"
);
}
drop(buffer);
assert_eq!(gone.recv_timeout(wait), Ok(()), "the deallocator ran");
let live = || d.raw.work_counts().dma_buf_memories_live;
for _ in 0..wait.as_millis() {
if live() == before.dma_buf_memories_live {
break;
}
std::thread::sleep(std::time::Duration::from_millis(1));
}
assert_eq!(live(), before.dma_buf_memories_live, "its import freed");
assert!(vm.deallocate(view, pages * PAGE).is_success());
drop(lease);
let unmapped =
crate::remap::wait_unimported(NonNull::new(start.cast::<u8>()).unwrap(), length, wait);
assert!(unmapped, "the RAM's imports went");
// SAFETY: the mapping made above, which nothing imports any more.
assert_eq!(unsafe { libc::munmap(start, length.to_usize()) }, 0);
}
/// A `Managed` no-copy buffer over the guest's RAM made with the word that its bytes read
/// zero from an offset (`BufferDesc::zero_from`), in a region whose import the device keeps
/// with no buffer bound in it (`super::dma_buf`'s module docs, "Kept imports"), joins that
+7 -4
View File
@@ -4148,10 +4148,13 @@ the host's import, and the kext's block table holds one entry per slab:
(the physical mask `0x0000FFFFFFFF0000`), zero-filled, maps them into the
process in order and makes the pages block of their runs, so a 2 MiB slab is
32 runs of guest RAM at most, where plain pages are up to 512. Each run
starts and ends at a multiple of 64 KiB, the granule at which the host binds
a buffer over several pieces of its import of guest RAM (RADV's sparse
buffer alignment), so such a buffer lies in the guest RAM's import rather
than in an import of its own on every submission's list. The host maps each
starts and ends at a multiple of 64 KiB. On RADV the host binds a buffer
over a slab of several runs as a piece of one dma-buf of the runs of the
host's view of those pages, which the view's other buffers share, one import
on every submission's list: bound as pieces of the guest RAM's import in a
sparse buffer, it cost a GPU page-table update of each piece at its bind and
again at its release (`crates/reims-vgpu-vulkan/src/os/linux/dma_buf.rs`,
"Several pieces" and "Views"). The host maps each
run of a view apart, against a budget of mappings per process
(`vm.max_map_count` on Linux, 65530 by default): on NVIDIA, views of
scattered pages, slabs' among them, used it up, and the buffers made after