Re: [PATCH] x86/mm: lower MAP_32BIT begin to reduce heap collisions

From: Simon Liebold
Date: Tue Aug 26 2025 - 08:32:27 EST


Dave Hansen <dave.hansen@xxxxxxxxx> writes:

> On 8/25/25 03:48, Simon Liebold wrote:
>> Commit 03475167fda5 ("x86: Increase brk randomness entropy for 64-bit
>> systems") increased the brk randomness from 32 MiB to 1 GiB. MAP_32BIT
>> looks between 1 GiB and 2 GiB for an unmapped area. Depending on the
>> randomization, a heap starting high enough and being big enough can use
>> up all the area that MAP_32BIT looks at, leading to allocation failures.
>
> Isn't that still a really unreasonably gigantic heap?
>
> Would you mind posting some actual /proc/$pid/maps output from one of
> the failure cases?

Hello Dave,

we are seeing heaps this large on real workloads. This is a Lua
application using LuaJit v2.0.

This is an excerpt from the output of one of the failure cases:

00400000-00566000 r-xp 00000000 103:01 4476567 [...]/bin/httpd.orig
00765000-0076b000 r--p 00165000 103:01 4476567 [...]/bin/httpd.orig
0076b000-00772000 rw-p 0016b000 103:01 4476567 [...]/bin/httpd.orig
00772000-00778000 rw-p 00000000 00:00 0
34a21000-35021000 rw-p 00000000 00:00 0 [heap]
35021000-82ea7000 rw-p 00000000 00:00 0 [heap]
7fee7c0ba000-7fee7c11f000 r-xp 00000000 103:01 3836609 [...]/lib/libluajit-5.1.so
7fee7c11f000-7fee7c31f000 ---p 00065000 103:01 3836609 [...]/lib/libluajit-5.1.so
7fee7c31f000-7fee7c321000 r--p 00065000 103:01 3836609 [...]/lib/libluajit-5.1.so
7fee7c321000-7fee7c322000 rw-p 00067000 103:01 3836609 [...]/lib/libluajit-5.1.so
[Other maps at high addresses...]

Regards,

Simon Liebold



Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597