mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-22 23:57:31 -10:00
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.
16 lines
691 B
Bash
16 lines
691 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
test_dir=$(mktemp -d)
|
|
trap 'rm -rf "$test_dir"' EXIT
|
|
clang -w -std=gnu11 -g -O1 -fsanitize=address,undefined -fno-sanitize-recover=all \
|
|
-DLINUXU_DEXT_DK=1 \
|
|
-ffunction-sections -fdata-sections -Ilinuxu/headers \
|
|
linuxu/tests/test_page_alloc_dk.c linuxu/src/dart/dart.c linuxu/tests/iosysctl_host.c \
|
|
-Wl,-dead_strip -lpthread -o "$test_dir/test_page_alloc_dk"
|
|
"$test_dir/test_page_alloc_dk"
|
|
"$test_dir/test_page_alloc_dk" --stream-completion-failure
|
|
"$test_dir/test_page_alloc_dk" --unpublished-coherent
|
|
"$test_dir/test_page_alloc_dk" --unpublished-stream
|
|
"$test_dir/test_page_alloc_dk" --stream-mask-completion-failure
|