upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorc0pperlane <84517100+c0pperlane@users.noreply.github.com>2026-11-25 20:34:18 +0100
committerc0pperlane <84517100+c0pperlane@users.noreply.github.com>2026-11-25 20:53:43 +0100
commit6c6a8cd47d74e5dc94751f4efdaa603e893b20f9 (patch)
treea36cab7d5c5c026e913eb20b8ef3ef65ae15f3df /docs
parentdb1a22d290f5e86fff9282fce3d4e02e788b05b4 (diff)
vk_pipeline_check: a large module that must wait frees its worker (VK-PIPELINE-CHECK-LARGE-ADMISSION)
A worker took the next index and only then waited in the large-module gate, so with the memory budget full the modules behind a large one sat untaken while spare workers blocked, and the pool ran below --jobs. LargeModuleQueue (large_module_gate.h) now hands out the indices. A large module the gate can't admit yet is put back and the worker takes the next one. The oldest module put back goes first as soon as the gate admits it and no later large module passes it; once every index is out, a worker waits for it. Nothing is put back while the gate admits each large module as it comes, so with one worker or room under the budget the order is unchanged, and --large-parallel 1 and --large-module-bytes 0 never ask the queue to admit. large_module_gate_test: the waiting module frees its worker (fails with the old claim-then-admit order), oldest-first and no double entry, the unchanged order, and every module once under 8 threads. AI-assisted (Claude Code).
Diffstat (limited to 'docs')
-rw-r--r--docs/pipeline_check.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/pipeline_check.md b/docs/pipeline_check.md
index d5d76cb93..bf1295c95 100644
--- a/docs/pipeline_check.md
+++ b/docs/pipeline_check.md
@@ -259,7 +259,9 @@ showed why that matters: several compiles that each needed gigabytes of host RAM
259modules now share a memory budget (`runtime/test/large_module_gate.h`): each one reserves 512 bytes of RAM per 259modules now share a memory budget (`runtime/test/large_module_gate.h`): each one reserves 512 bytes of RAM per
260SPIR-V byte, and they enter the driver while their reservations fit three quarters of the memory available when 260SPIR-V byte, and they enter the driver while their reservations fit three quarters of the memory available when
261the run starts, up to `--jobs` of them. One large module always gets in when none is compiling, so a module 261the run starts, up to `--jobs` of them. One large module always gets in when none is compiling, so a module
262bigger than the whole budget still compiles, alone among the large ones. Small modules are never held back. On 262bigger than the whole budget still compiles, alone among the large ones. Small modules are never held back, and a
263large module that doesn't fit yet doesn't hold its thread: it goes back in the queue and the thread takes the next
264module. The oldest one put back gets in first once it fits, and no later large module passes it. On
263Linux the budget is the smaller of `MemAvailable` and the room under the cgroup v2 `memory.max` of the process and 265Linux the budget is the smaller of `MemAvailable` and the room under the cgroup v2 `memory.max` of the process and
264every cgroup above it (a container, or `systemd-run -p MemoryMax=...`); on Windows it is `ullAvailPhys`. Where 266every cgroup above it (a container, or `systemd-run -p MemoryMax=...`); on Windows it is `ullAvailPhys`. Where
265neither can be read, every large module compiles alone, as before. After each large module, glibc builds call 267neither can be read, every large module compiles alone, as before. After each large module, glibc builds call