glibc/sysdeps/unix
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
..
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 Huge Page support for mmap 2021-12-15 17:35:38 -03:00
x86_64
Implies
Makefile Remove the unused +mkdep/+make-deps/s-proto.S/s-proto-cancel.S 2021-11-10 04:54:18 -08:00
confstr.h
get_child_max.c
getlogin.c
getlogin_r.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
make-syscalls.sh
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