]> 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)
commit1860e2786ecdc08dc0d96b797d67d96fc99cc405
tree2c366c8fb374baafb865cc5c408d86d6cf042e7e
parentfbc038db1ed35835de6a51dd9b3da8cafc8a1835
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