glibc/sysdeps
Adhemerval Zanella 98d5fcb8d0 malloc: Add Huge Page support for mmap
With the morecore hook removed, there is not easy way to provide huge
pages support on with glibc allocator without resorting to transparent
huge pages.  And some users and programs do prefer to use the huge pages
directly instead of THP for multiple reasons: no splitting, re-merging
by the VM, no TLB shootdowns for running processes, fast allocation
from the reserve pool, no competition with the rest of the processes
unlike THP, no swapping all, etc.

This patch extends the 'glibc.malloc.hugetlb' tunable: the value
'2' means to use huge pages directly with the system default size,
while a positive value means and specific page size that is matched
against the supported ones by the system.

Currently only memory allocated on sysmalloc() is handled, the arenas
still uses the default system page size.

To test is a new rule is added tests-malloc-hugetlb2, which run the
addes tests with the required GLIBC_TUNABLE setting.  On systems without
a reserved huge pages pool, is just stress the mmap(MAP_HUGETLB)
allocation failure.  To improve test coverage it is required to create
a pool with some allocated pages.

Checked on x86_64-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
2021-12-15 17:35:38 -03:00
..
aarch64 aarch64: Add math-use-builtins-f{max,min}.h 2021-12-13 10:08:46 -03:00
alpha Support target specific ALIGN for variable alignment test [BZ #28676] 2021-12-14 14:50:33 -08:00
arc Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN 2021-12-09 23:47:49 +01:00
arm Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN 2021-12-09 23:47:49 +01:00
csky Replace --enable-static-pie with --disable-default-pie 2021-12-13 08:08:59 +05:30
generic malloc: Add Huge Page support for mmap 2021-12-15 17:35:38 -03:00
gnu Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
hppa Replace --enable-static-pie with --disable-default-pie 2021-12-13 08:08:59 +05:30
htl htl: Reimplement GSCOPE 2021-09-16 01:04:17 +02:00
hurd Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
i386 math: Remove the error handling wrapper from hypot and hypotf 2021-12-13 10:08:46 -03:00
ia64 Cleanup encoding in comments 2021-12-13 10:01:45 +05:30
ieee754 sysdeps: Simplify sin Taylor Series calculation 2021-12-13 15:31:05 +01:00
m68k Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN 2021-12-09 23:47:49 +01:00
mach hurd: Do not set PIE_UNSUPPORTED 2021-12-14 08:38:05 +01:00
microblaze Support target specific ALIGN for variable alignment test [BZ #28676] 2021-12-14 14:50:33 -08:00
mips Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN 2021-12-09 23:47:49 +01:00
nios2 Support target specific ALIGN for variable alignment test [BZ #28676] 2021-12-14 14:50:33 -08:00
nptl nptl: Add public rseq symbols and <sys/rseq.h> 2021-12-09 09:49:32 +01:00
posix posix: Remove spawni.c 2021-09-27 12:44:25 -03:00
powerpc powerpc: Use global register variable in <thread_pointer.h> 2021-12-15 16:06:25 +01:00
pthread nptl: Add one more barrier to nptl/tst-create1 2021-12-10 11:51:25 +01:00
riscv Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN 2021-12-09 23:47:49 +01:00
s390 Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN 2021-12-09 23:47:49 +01:00
sh Remove TLS_TCB_ALIGN and TLS_INIT_TCB_ALIGN 2021-12-09 23:47:49 +01:00
sparc Replace --enable-static-pie with --disable-default-pie 2021-12-13 08:08:59 +05:30
unix malloc: Add Huge Page support for mmap 2021-12-15 17:35:38 -03:00
wordsize-32 Disable symbol hack in libc_nonshared.a 2021-09-27 07:46:25 -07:00
wordsize-64 Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
x86 x86-64: Remove LD_PREFER_MAP_32BIT_EXEC support [BZ #28656] 2021-12-10 14:01:34 -08:00
x86_64 Cleanup encoding in comments 2021-12-13 10:01:45 +05:30