Skip to content

Commit 5714dad

Browse files
committed
fix(aspacem): raise amd64 managed address ceiling to 1 TiB
snmalloc-rs as a global allocator aborts under Callgrind because its startup mmap of a flat 256 GiB MAP_NORESERVE range returns EINVAL. On amd64-linux the address-space manager capped the managed range at 128 GiB, placing vStart (the client/Valgrind split) at ~64 GiB, so the largest floating client hole was ~62 GiB and any larger reservation was vetoed by VG_(am_get_advisory). Raise aspacem_maxAddr to 1 TiB (vStart ~512 GiB, ~512 GiB client hole), scoped to VGP_amd64_linux so other 64-bit ports keep 128 GiB (some arm64 kernels expose only a 39-bit user VA). No effect on Callgrind placement semantics; the fork ships only the 64-bit Callgrind tool. Refs COD-3073
1 parent ce9d871 commit 5714dad

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

coregrind/m_aspacemgr/aspacemgr-linux.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,17 @@ Addr VG_(am_startup) ( Addr sp_at_startup )
18621862
sp_at_startup );
18631863

18641864
# if VG_WORDSIZE == 8
1865+
# if defined(VGP_amd64_linux)
1866+
// Startup inserts a one-page reservation at vStart (the midpoint of
1867+
// [minAddr, maxAddr]), splitting the initial free space. A floating
1868+
// client mmap searches upward from cStart, so the largest contiguous
1869+
// hole it can get runs up to that split, i.e. ~half of maxAddr. 128G
1870+
// left only a ~64G client hole, rejecting multi-hundred-GB lazily-backed
1871+
// reservations. 1T gives a ~512G hole, well within amd64's 47-bit VA.
1872+
aspacem_maxAddr = (Addr)0x10000000000ULL - 1; // 1T
1873+
# else
18651874
aspacem_maxAddr = (Addr)0x2000000000ULL - 1; // 128G
1875+
# endif
18661876
# ifdef ENABLE_INNER
18671877
{ Addr cse = VG_PGROUNDDN( sp_at_startup ) - 1;
18681878
if (aspacem_maxAddr > cse)

0 commit comments

Comments
 (0)