malloc: Enable huge page support on main arena
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 30 Aug 2021 17:01:00 +0000 (14:01 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 15 Dec 2021 20:35:39 +0000 (17:35 -0300)
commit0f982c182760bd7689769ee7590df592d0a132c0
treef538197b6d1f3d2bd4eda217fccb4c824d3b5929
parent0849eed45daabf30a02c153695041597d6d43b2d
malloc: Enable huge page support on main arena

This patch adds support huge page support on main arena allocation,
enable with tunable glibc.malloc.hugetlb=2.  The patch essentially
disable the __glibc_morecore() sbrk() call (similar when memory
tag does when sbrk() call does not support it) and fallback to
default page size if the memory allocation fails.

Checked on x86_64-linux-gnu.

Reviewed-by: DJ Delorie <dj@redhat.com>
malloc/arena.c
malloc/malloc.c
malloc/morecore.c