[llvm-branch-commits] [NFC][msan][test] Chunk memset in release_origin.c (PR #231058)
Vitaly Buka via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Oct 11 20:01:54 PDT 2026
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/231058
A single 100 MiB __msan_memset faults in all 100 MiB of user pages before
SetShadow unmaps the corresponding shadow and origin pages. Under heavy test
parallelism on 192-CPU ppc64le (64 KiB pages, 24 MiB per-CPU RSS counter
batch), this causes two problems:
1. BackgroundThread (polling every 100 ms) can sample GetRSS() mid-memset
during the temporary +100 MiB RSS spike before shadow/origin pages are
unmapped.
2. If the thread migrates across CPUs during the 100 MiB user page faults,
earlier CPUs retain partial positive per-CPU RSS batches while the single
MmapFixedSuperNoReserve syscall unmaps all 100 MiB of shadow on the final
CPU, causing global /proc/self/statm RSS to drop prematurely in non-origin
mode.
Splitting the memset into 1 MiB chunks bounds the transient RSS spike to 1 MiB
and pairs each chunk's user page faults with its shadow/origin unmap on the
same CPU.
Assisted-by: Gemini
More information about the llvm-branch-commits
mailing list