]> git.ipfire.org Git - thirdparty/glibc.git/commit
malloc: Enable THP always support on hugetlb tunable
authorWilliam Hunt <william.hunt@arm.com>
Tue, 29 Jul 2025 15:04:58 +0000 (15:04 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Tue, 29 Jul 2025 15:05:51 +0000 (15:05 +0000)
commit9097cbf5d834990d54dc50585e986dfb7ee34093
treefd16732baa436514d9d113b1af4400feff1a8910
parent089b4fb90fac8ed53039bc4c465c4d333c6b4048
malloc: Enable THP always support on hugetlb tunable

Enable support for THP always when glibc.malloc.hugetlb=1, as the tunable
currently only gives explicit support in malloc for the THP madvise mode
by aligning to a huge page size. Add a thp_mode parameter to mp_ and check
in madvise_thp whether the system is using madvise mode, otherwise the
`__madvise` call is useless. Set the thp_mode to be unsupported by default,
but if the hugetlb tunable is set this updates thp_mode. Performance of
xalancbmk improves by 4.9% on Neoverse V2 when THP always mode is set on the
system and glibc.malloc.hugetlb=1.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
malloc/malloc.c