You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RLIMIT_AS and RLIMIT_DATA totals lose records once the region table is stale #488
After #485, RLIMIT_AS and RLIMIT_DATA are checked against totals summed from the region table on each call. Once regions_tracker_stale is set, the records the table dropped stay out of both totals for good, so a guest that fills the table to GUEST_MAX_REGIONS and then splits mappings can grow past either limit. Running vm_total and vm_data counters, updated wherever a mapping is added, removed or reprotected and kept even when the table has no free slot, would close that gap and also replace the full-table scan on every mmap under a finite limit.
From the review of #485: the scan also costs time. With any finite limit, every mmap, mremap growth and page-adding brk walks the whole region table, and MAP_FIXED walks it twice (mem_mapped_in, then mem_vm_totals). A guest under ulimit -v with thousands of mappings (a JVM, a browser) then pays O(n) per call. Running total and data counters kept in the region add, remove and prot-change paths would make this O(1), as mm->total_vm does, and the full sum could stay as a debug-build cross-check.
Activity
xalestar commentedon Nov 7, 2026
From the review of #485: the scan also costs time. With any finite limit, every
mmap,mremapgrowth and page-addingbrkwalks the whole region table, andMAP_FIXEDwalks it twice (mem_mapped_in, thenmem_vm_totals). A guest underulimit -vwith thousands of mappings (a JVM, a browser) then pays O(n) per call. Runningtotalanddatacounters kept in the region add, remove and prot-change paths would make this O(1), asmm->total_vmdoes, and the full sum could stay as a debug-build cross-check.