Files
reims-vgpu/guest/bundle/tests
Anees Iqbal b415f5b61b 🔥 Lay every slab in plain pages, asking for no superpage
A 2 MiB slab of a process's own pages was a superpage the slabs' thread
asked for ahead of its take. Asking still stalled the process: the kernel's
search for a contiguous 2 MiB runs in vm_map_enter with the task's map
interlock held and the new entry locked exclusive (public xnu-12377.101.15
vm_map.c), so any walk of the map past it waits. Tailspin on an 8 GiB
macOS 26.7.2 guest on the Radeon 780M host: WindowServer's slabs thread was
in cpm_allocate while its main thread, making a texture over a layer's image
in a live resize, waited in mach_vm_region behind it, and Safari's page drew
no frame for 179 ms. No thread placement avoids that, superpages run out
minutes after a boot anyway, and the held one cost up to 38 MiB across the
19 processes that map the bundle.

So every slab of the process's own pages is plain pages, taken by the take
that needs it, as it already was once superpages ran out. The superpage
call, its record in the kext and the VM-guard tool go.

What changes for the guest: the kext no longer answers selector 12
(Superpages) nor sets kext feature bit 8; both lived only between the kext
and the bundle, which ship together, and reims_graphics_wire.h never had
them. The host sees the same pages blocks as a guest out of superpages
does: HEAP_OVER_PAGES and BUFFER_OVER_PAGES over plain pages' runs.
2026-11-09 04:56:53 -08:00
..