aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorCupertino Miranda <cupertino.miranda@oracle.com>2023-04-14 16:12:20 +0100
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2023-04-20 13:54:24 -0300
commitb630be0922dbaaa50eb174a7740f0d3fb88602da (patch)
treefa0e6bd1ef8115117c6a2090b2dd5248269609fb /manual
parent0f61cd4b9c5175c128311769df932c8d7694d6b6 (diff)
downloadglibc-b630be0922dbaaa50eb174a7740f0d3fb88602da.zip
glibc-b630be0922dbaaa50eb174a7740f0d3fb88602da.tar.gz
glibc-b630be0922dbaaa50eb174a7740f0d3fb88602da.tar.bz2
Created tunable to force small pages on stack allocation.
Created tunable glibc.pthread.stack_hugetlb to control when hugepages can be used for stack allocation. In case THP are enabled and glibc.pthread.stack_hugetlb is set to 0, glibc will madvise the kernel not to use allow hugepages for stack allocations. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'manual')
-rw-r--r--manual/tunables.texi15
1 files changed, 15 insertions, 0 deletions
diff --git a/manual/tunables.texi b/manual/tunables.texi
index 70dd226..130f94b 100644
--- a/manual/tunables.texi
+++ b/manual/tunables.texi
@@ -459,6 +459,21 @@ registration on behalf of the application.
Restartable sequences are a Linux-specific extension.
@end deftp
+@deftp Tunable glibc.pthread.stack_hugetlb
+This tunable controls whether to use Huge Pages in the stacks created by
+@code{pthread_create}. This tunable only affects the stacks created by
+@theglibc{}, it has no effect on stack assigned with
+@code{pthread_attr_setstack}.
+
+The default is @samp{1} where the system default value is used. Setting
+its value to @code{0} enables the use of @code{madvise} with
+@code{MADV_NOHUGEPAGE} after stack creation with @code{mmap}.
+
+This is a memory utilization optimization, since internal glibc setup of either
+the thread descriptor and the guard page might force the kernel to move the
+thread stack originally backup by Huge Pages to default pages.
+@end deftp
+
@node Hardware Capability Tunables
@section Hardware Capability Tunables
@cindex hardware capability tunables