Pages are mapped side by side: eight threads stand in the host's queue instead of one
Mapping and unmapping a view wait for what every protection change of a view takes too (about 100,000 a second, the guards'): 0.2-4 ms a page, all on the one thread the title loads with. Scatter maps and the GPU's page-mapping copies go in groups of up to 64 pages, noted before and after on the caller's thread, the system calls on up to eight (VICTORY_MAP_THREADS=1: one after the other, as before). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
0aa2ab952b
commit
4c53da0a52
4 files changed
+458
-29
No files matched your search
@@ -919,6 +919,15 @@ extern "system" fn copy_page_mappings(
|
||||
unsafe { std::slice::from_raw_parts(batches, count as usize) }
|
||||
});
|
||||
let mut ok = true;
|
||||
let many = crate::resource::many_page_mapper();
|
||||
let mut gathered: Vec<(u64, u64, u64)> = Vec::new();
|
||||
let mut map = |to: u64, from: u64, len: u64| match many {
|
||||
Some(_) => {
|
||||
gathered.push((to, from, len));
|
||||
true
|
||||
}
|
||||
None => map(to, from, len),
|
||||
};
|
||||
for b in batches.into_iter().flatten() {
|
||||
if b.ranges.is_null() {
|
||||
continue;
|
||||
@@ -940,6 +949,9 @@ extern "system" fn copy_page_mappings(
|
||||
at += len;
|
||||
}
|
||||
}
|
||||
if let Some(many) = many {
|
||||
ok &= many(&gathered);
|
||||
}
|
||||
if !ok {
|
||||
static ONCE: std::sync::Once = std::sync::Once::new();
|
||||
ONCE.call_once(|| tracing::warn!(pool = format_args!("{pool:#x}"), "a page mapping failed"));
|
||||
|
||||
Reference in new issue
Block a user