Skip to content

arena: the huge-page gate also counts compaction stalls (fragmented host: no more sys-time regression) - #99

Closed
vic wants to merge 1 commit into
mainfrom
stall-gate2
Closed

vic wants to merge 1 commit into
mainfrom
stall-gate2

Conversation

@vic

@vic vic commented Nov 13, 2026

Copy link
Copy Markdown
Owner

Follow-up of #95. On a fragmented host (order-9 free pages near 0) a huge-page fault stalls in direct compaction even when it succeeds, so thp_fault_fallback alone does not close the gate while the program pays ~2 ms per 2 MiB. snx measured this on a NixOS evaluation after #95: faults -5% only, system time +2..+6 s, compact_stall +16k over 9 runs. I measured the same shape on a 60 MB test program: 0.24-0.30 s sys, compact_stall +138..162, thp_fault_fallback +46..54.

Change: Srs.Pages.scan reads both compact_stall and thp_fault_fallback from /proc/vmstat and sums them into seen; the existing limit (64 since arming) now shuts the gate on stalls too. A kernel without compact_stall shuts the gate (no advice), as an unreadable count did before.

Control (no regression where huge pages are free): s2c compiling the frozen 2.4 GB snx gate program, interleaved twice, main vs this: 20,215-20,221 faults, 0.35-0.38 s sys, compact_stall +0, identical. Fixpoint OK, seed updated. Gate: the pages_gate / pages_off / alloc_chunks advice checks are unchanged (first reservation after arming is always advised). CI is the full gate.

… + thp_fault_fallback since arming, limit 64): on a fragmented host a huge fault that succeeds still stalls in direct compaction, costing more system time than the 4 KiB faults it replaces; a healthy host sees no change (2.4 GB compile: 20,220 faults, 0.36 s sys, 0 stalls both ways)
@vic vic closed this Nov 17, 2026
@vic
vic deleted the stall-gate2 branch November 17, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant