glibc/malloc
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
..
alloc_buffer_alloc_array.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
alloc_buffer_allocate.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
alloc_buffer_copy_bytes.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
alloc_buffer_copy_string.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
alloc_buffer_create_failure.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
arena.c malloc: Add madvise support for Transparent Huge Pages 2021-12-15 17:35:14 -03:00
Depend added rt to malloc/Depend [BZ #27132] 2021-02-23 10:04:45 +01:00
dynarray_at_failure.c malloc: Sync dynarray with gnulib 2021-02-09 16:57:54 -03:00
dynarray_emplace_enlarge.c malloc: Sync dynarray with gnulib 2021-02-09 16:57:54 -03:00
dynarray_finalize.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
dynarray_resize_clear.c malloc: Sync dynarray with gnulib 2021-02-09 16:57:54 -03:00
dynarray_resize.c malloc: Sync dynarray with gnulib 2021-02-09 16:57:54 -03:00
dynarray-skeleton.c malloc: Sync dynarray with gnulib 2021-02-09 16:57:54 -03:00
dynarray.h malloc: Sync dynarray with gnulib 2021-02-09 16:57:54 -03:00
hooks.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
Makefile malloc: Add madvise support for Transparent Huge Pages 2021-12-15 17:35:14 -03:00
malloc-check.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
malloc-debug.c malloc: Fix malloc debug for 2.35 onwards 2021-11-17 21:33:39 +09:00
malloc-internal.h malloc: Add madvise support for Transparent Huge Pages 2021-12-15 17:35:14 -03:00
malloc.c malloc: Add madvise support for Transparent Huge Pages 2021-12-15 17:35:14 -03:00
malloc.h Add alloc_align attribute to memalign et al 2021-10-21 00:19:20 +01:00
mallocbug.c Reformat malloc to gnu style. 2014-01-02 09:40:10 +01:00
mcheck-impl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
mcheck-init.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
mcheck.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
mcheck.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
memusage.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memusage.sh Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
memusagestat.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
morecore.c Remove __morecore and __default_morecore 2021-07-22 18:37:57 +05:30
mtrace-impl.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
mtrace.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
mtrace.pl Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
obstack.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
obstack.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
reallocarray.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
scratch_buffer_dupfree.c malloc: Add scratch_buffer_dupfree 2021-01-05 11:33:16 -03:00
scratch_buffer_grow_preserve.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
scratch_buffer_grow.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
scratch_buffer_set_array_size.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
set-freeres.c elf: Introduce GLRO (dl_libc_freeres), called from __libc_freeres 2021-11-17 12:20:29 +01:00
thread-freeres.c dlfcn: dlerror needs to call free from the base namespace [BZ #24773] 2021-04-21 19:49:51 +02:00
tst-alloc_buffer.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-calloc.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
tst-compathooks-off.c Move malloc hooks into a compat DSO 2021-07-22 18:37:59 +05:30
tst-compathooks-on.c Move malloc hooks into a compat DSO 2021-07-22 18:37:59 +05:30
tst-dynarray-at-fail.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-dynarray-fail.c malloc: Sync dynarray with gnulib 2021-02-09 16:57:54 -03:00
tst-dynarray-shared.h malloc: Sync dynarray with gnulib 2021-02-09 16:57:54 -03:00
tst-dynarray.c Disable -Waggressive-loop-optimizations warnings in tst-dynarray.c 2021-10-29 14:40:45 +00:00
tst-free-errno.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-aux-nothread.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-aux-thread.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-aux.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-aux.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-nothread.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-skeleton.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-static-nothread.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-static-thread.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-interpose-thread.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-mallinfo2.c tst-mallinfo2.c: Use correct multiple for total variable 2021-05-25 16:47:01 -04:00
tst-malloc_info.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-malloc-backtrace.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-malloc-check.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
tst-malloc-fork-deadlock.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-malloc-stats-cancellation.c malloc: Run tst-malloc-stats-cancellation via test-driver.c 2021-04-07 02:35:50 +02:00
tst-malloc-tcache-leak.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-malloc-thread-exit.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-malloc-thread-fail.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-malloc-too-large.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-malloc-usable-tunables.c Initialize tunable list with the GLIBC_TUNABLES environment variable 2016-12-31 23:49:24 +05:30
tst-malloc-usable.c Handle NULL input to malloc_usable_size [BZ #28506] 2021-10-29 14:53:55 +05:30
tst-malloc.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
tst-mallocalign1.c Add a generic malloc test for MALLOC_ALIGNMENT 2021-07-09 06:39:30 -07:00
tst-mallocfork2.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-mallocfork3.c posix: Add _Fork [BZ #4737] 2021-06-28 15:55:56 -03:00
tst-mallocfork.c Fix malloc tests build with GCC 10. 2019-06-10 22:12:08 +00:00
tst-mallocstate.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
tst-mallopt.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-memalign.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-mtrace.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-mtrace.sh Move malloc hooks into a compat DSO 2021-07-22 18:37:59 +05:30
tst-mxfast.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-obstack.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
tst-posix_memalign.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-pvalloc-fortify.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-pvalloc.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-realloc.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-reallocarray.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-safe-linking.c tst-safe-linking: make false positives even more improbable 2021-07-19 08:29:25 +05:30
tst-scratch_buffer.c malloc: Add scratch_buffer_dupfree 2021-01-05 11:33:16 -03:00
tst-tcfree1.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-tcfree2.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-tcfree3.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-trim1.c * malloc/tst-trim1.c: New file. 2007-12-16 22:57:57 +00:00
tst-valloc.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Versions Move malloc_{g,s}et_state to libc_malloc_debug 2021-07-22 18:38:10 +05:30