Files
geramyloveless 077dd61aeb linuxu: page descriptors grow with use, up to the machine's RAM
The page pool was fixed at 131072 descriptors (2 GiB of 16 KiB pages),
sized for a 1.5 GiB DART budget test. Descriptors now come in chunks of
16384 pages as allocations need them, for at most hw.memsize in pages.
A chunk never moves, so struct page pointers stay valid; the chunk
array is sized once for the maximum, so lockless readers (page_address)
index it safely. In the dext the VA lookup is rebuilt as chunks are
added. A block lies within one chunk; orders above a chunk fail, as
Linux cannot give that much contiguous memory either.

What bounds pages now is the platform: in the dext each non-CPU page is
DMA-mapped, so the DART refuses first (logged by the seam); CPU-only
pages are bounded by RAM. test_page_alloc holds 2176 MiB of pages at
once. Host builds of DriverKit-mode sources get IOSysCtlByName from
linuxu/tests/iosysctl_host.c.
2026-10-04 09:29:20 -07:00

11 lines
368 B
C

/* DriverKit's IOSysCtlByName for host builds of DriverKit-mode sources:
* the host's sysctl answers, as the dext's does. */
#include <stddef.h>
#include <sys/sysctl.h>
int IOSysCtlByName(const char *name, void *value, size_t *length, void *replacement,
size_t replacement_length)
{
return sysctlbyname(name, value, length, replacement, replacement_length);
}