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
@@ -947,6 +947,20 @@ pub fn use_page_mapper(mapper: PageMapper) {
|
||||
let _ = PAGE_MAPPER.set(mapper);
|
||||
}
|
||||
|
||||
/// As a [`PageMapper`], many at once: `(to, from, len)` each, in order.
|
||||
pub type ManyPageMapper = fn(&[(u64, u64, u64)]) -> bool;
|
||||
|
||||
static MANY_PAGE_MAPPER: std::sync::OnceLock<ManyPageMapper> = std::sync::OnceLock::new();
|
||||
|
||||
/// The runtime's mapper of many pages at once.
|
||||
pub fn use_many_page_mapper(mapper: ManyPageMapper) {
|
||||
let _ = MANY_PAGE_MAPPER.set(mapper);
|
||||
}
|
||||
|
||||
pub(crate) fn many_page_mapper() -> Option<ManyPageMapper> {
|
||||
MANY_PAGE_MAPPER.get().copied()
|
||||
}
|
||||
|
||||
pub(crate) fn page_mapper() -> Option<PageMapper> {
|
||||
PAGE_MAPPER.get().copied()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user