]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
fix: replace pmm_alloc_page_low with pmm_alloc_page — fix fork OOM
authorTulio A M Mendes <[email protected]>
Mon, 16 Feb 2026 17:47:10 +0000 (14:47 -0300)
committerTulio A M Mendes <[email protected]>
Mon, 16 Feb 2026 17:47:10 +0000 (14:47 -0300)
commitcbdef4a3aea5918900524c178d6a0c915b42ce9a
tree151f04a20f49d698ffe91bc810ef09f9558261e1
parent16b7099bdbdc6cd848e4a02ba55d4128a0756f39
fix: replace pmm_alloc_page_low with pmm_alloc_page — fix fork OOM

The below-16MB page allocator (pmm_alloc_page_low) randomly sampled
pages and discarded any above 16MB.  With 100 zombie children holding
CoW address spaces, the low-memory pool exhausted and fork() returned
-ENOMEM, killing init before the SIGSEGV/waitpid-100/echo.elf tests.

On 32-bit PAE all physical addresses are below 4GB, so the 16MB
restriction is unnecessary for PDPTs, page directories, page tables,
and user frames.

Changes:
- vmm.c: replace all pmm_alloc_page_low() with pmm_alloc_page(),
  remove the dead pmm_alloc_page_low function
- usermode.c: replace pmm_alloc_page_low_16mb() with pmm_alloc_page(),
  remove the dead function
- init.c: make SIGSEGV test failure non-fatal (goto instead of
  sys_exit) so subsequent tests still run

83/83 smoke tests pass (10s), cppcheck clean.
src/arch/x86/usermode.c
src/arch/x86/vmm.c
user/init.c