]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
malloc: Improve documentation of malloc tunables
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Tue, 10 Mar 2026 15:47:26 +0000 (15:47 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Wed, 3 Jun 2026 13:10:58 +0000 (13:10 +0000)
Update default for tcache_count tunable.  Remove existing documentation and
mention removal of fastbins in mxfast tunable.  Improve wording of hugetlb
tunable, including default for AArch64.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
manual/tunables.texi

index 95b7075ae78202d825d4ba28159f3db41b4f7b38..05f5e65a8901b67301a9d8b1da9369e2e5395e28 100644 (file)
@@ -239,31 +239,23 @@ disabled.
 
 The approximate maximum overhead of the per-thread cache is thus equal
 to the number of bins times the chunk count in each bin times the size
-of each chunk.  With defaults, the approximate maximum overhead of the
-per-thread cache is approximately 236 KB on 64-bit systems and 118 KB
-on 32-bit systems.
+of each chunk.
 @end deftp
 
 @deftp Tunable glibc.malloc.mxfast
-One of the optimizations @code{malloc} uses is to maintain a series of ``fast
-bins'' that hold chunks up to a specific size.  The default and
-maximum size which may be held this way is 80 bytes on 32-bit systems
-or 160 bytes on 64-bit systems.  Applications which value size over
-speed may choose to reduce the size of requests which are serviced
-from fast bins with this tunable.  Note that the value specified
-includes @code{malloc}'s internal overhead, which is normally the size of one
-pointer, so add 4 on 32-bit systems or 8 on 64-bit systems to the size
-passed to @code{malloc} for the largest bin size to enable.
+This tunable has no effect since the ``fastbins'' have been removed.
 @end deftp
 
 @deftp Tunable glibc.malloc.hugetlb
 This tunable controls the usage of Huge Pages on @code{malloc} calls.  The
-default value is @code{0}, which disables any additional support on
-@code{malloc}.
+default value is @code{0} on most targets.  Using @code{0} disables support
+that improves use of huge pages in @code{malloc}.  However huge pages may
+still be created depending on the OS settings.
 
 Setting its value to @code{1} enables the use of @code{madvise} with
 @code{MADV_HUGEPAGE} after memory allocation with @code{mmap}.  It is enabled
 only if the system supports Transparent Huge Page (currently only on Linux).
+This is the default used for AArch64.
 
 Setting its value to @code{2} enables the use of Huge Page directly with
 @code{mmap} with the use of @code{MAP_HUGETLB} flag.  The huge page size