glibc/sysdeps/unix
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
..
alpha linux: Implement pipe in terms of __NR_pipe2 2021-11-30 13:13:03 -03:00
arm
bsd Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
i386
inet
mips linux: Implement pipe in terms of __NR_pipe2 2021-11-30 13:13:03 -03:00
powerpc
sh
sysv/linux malloc: Add madvise support for Transparent Huge Pages 2021-12-15 17:35:14 -03:00
x86_64
confstr.h
get_child_max.c
getlogin_r.c
getlogin.c
getpagesize.c
grantpt.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
ifreq.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
Implies
make-syscalls.sh
Makefile Remove the unused +mkdep/+make-deps/s-proto.S/s-proto-cancel.S 2021-11-10 04:54:18 -08:00
setxid.h
sockatmark.c
syscall-template.S
syscall.S
syscalls.list misc: Add time64 alias for ioctl 2021-07-21 11:58:09 +02:00
sysdep.h linux: Add generic syscall implementation 2021-12-06 08:03:11 -03:00