glibc/sysdeps
Adhemerval Zanella 5f6d8d97c6 malloc: Add madvise support for Transparent Huge Pages
Linux Transparent Huge Pages (THP) current supports three different
states: 'never', 'madvise', and 'always'.  The 'never' is
self-explanatory and 'always' will enable THP for all anonymous
pages.  However, 'madvise' is still the default for some system and
for such case THP will be only used if the memory range is explicity
advertise by the program through a madvise(MADV_HUGEPAGE) call.

To enable it a new tunable is provided, 'glibc.malloc.hugetlb',
where setting to a value diffent than 0 enables the madvise call.

This patch issues the madvise(MADV_HUGEPAGE) call after a successful
mmap() call at sysmalloc() with sizes larger than the default huge
page size.  The madvise() call is disable is system does not support
THP or if it has the mode set to "never" and on Linux only support
one page size for THP, even if the architecture supports multiple
sizes.

To test is a new rule is added tests-malloc-hugetlb1, which run the
addes tests with the required GLIBC_TUNABLE setting.

Checked on x86_64-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
2021-12-15 17:35:14 -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 madvise support for Transparent Huge Pages 2021-12-15 17:35:14 -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 madvise support for Transparent Huge Pages 2021-12-15 17:35:14 -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