Regenerate configure.
[glibc.git] / manual / tunables.texi
blobffd50a3fe2bbd4cebfd2ccc4a984ffda0220179f
1 @node Tunables
2 @c @node Tunables, , Internal Probes, Top
3 @c %MENU% Tunable switches to alter libc internal behavior
4 @chapter Tunables
5 @cindex tunables
7 @dfn{Tunables} are a feature in @theglibc{} that allows application authors and
8 distribution maintainers to alter the runtime library behavior to match
9 their workload. These are implemented as a set of switches that may be
10 modified in different ways. The current default method to do this is via
11 the @env{GLIBC_TUNABLES} environment variable by setting it to a string
12 of colon-separated @var{name}=@var{value} pairs.  For example, the following
13 example enables @code{malloc} checking and sets the @code{malloc}
14 trim threshold to 128
15 bytes:
17 @example
18 GLIBC_TUNABLES=glibc.malloc.trim_threshold=128:glibc.malloc.check=3
19 export GLIBC_TUNABLES
20 @end example
22 Tunables are not part of the @glibcadj{} stable ABI, and they are
23 subject to change or removal across releases.  Additionally, the method to
24 modify tunable values may change between releases and across distributions.
25 It is possible to implement multiple `frontends' for the tunables allowing
26 distributions to choose their preferred method at build time.
28 Finally, the set of tunables available may vary between distributions as
29 the tunables feature allows distributions to add their own tunables under
30 their own namespace.
32 Passing @option{--list-tunables} to the dynamic loader to print all
33 tunables with minimum and maximum values:
35 @example
36 $ /lib64/ld-linux-x86-64.so.2 --list-tunables
37 glibc.rtld.nns: 0x4 (min: 0x1, max: 0x10)
38 glibc.elision.skip_lock_after_retries: 3 (min: -2147483648, max: 2147483647)
39 glibc.malloc.trim_threshold: 0x0 (min: 0x0, max: 0xffffffffffffffff)
40 glibc.malloc.perturb: 0 (min: 0, max: 255)
41 glibc.cpu.x86_shared_cache_size: 0x100000 (min: 0x0, max: 0xffffffffffffffff)
42 glibc.mem.tagging: 0 (min: 0, max: 255)
43 glibc.elision.tries: 3 (min: -2147483648, max: 2147483647)
44 glibc.elision.enable: 0 (min: 0, max: 1)
45 glibc.cpu.x86_rep_movsb_threshold: 0x1000 (min: 0x100, max: 0xffffffffffffffff)
46 glibc.malloc.mxfast: 0x0 (min: 0x0, max: 0xffffffffffffffff)
47 glibc.elision.skip_lock_busy: 3 (min: -2147483648, max: 2147483647)
48 glibc.malloc.top_pad: 0x0 (min: 0x0, max: 0xffffffffffffffff)
49 glibc.cpu.x86_rep_stosb_threshold: 0x800 (min: 0x1, max: 0xffffffffffffffff)
50 glibc.cpu.x86_non_temporal_threshold: 0xc0000 (min: 0x4040, max: 0x0fffffffffffffff)
51 glibc.cpu.x86_shstk:
52 glibc.cpu.hwcap_mask: 0x6 (min: 0x0, max: 0xffffffffffffffff)
53 glibc.malloc.mmap_max: 0 (min: -2147483648, max: 2147483647)
54 glibc.elision.skip_trylock_internal_abort: 3 (min: -2147483648, max: 2147483647)
55 glibc.malloc.tcache_unsorted_limit: 0x0 (min: 0x0, max: 0xffffffffffffffff)
56 glibc.cpu.x86_ibt:
57 glibc.cpu.hwcaps:
58 glibc.elision.skip_lock_internal_abort: 3 (min: -2147483648, max: 2147483647)
59 glibc.malloc.arena_max: 0x0 (min: 0x1, max: 0xffffffffffffffff)
60 glibc.malloc.mmap_threshold: 0x0 (min: 0x0, max: 0xffffffffffffffff)
61 glibc.cpu.x86_data_cache_size: 0x8000 (min: 0x0, max: 0xffffffffffffffff)
62 glibc.malloc.tcache_count: 0x0 (min: 0x0, max: 0xffffffffffffffff)
63 glibc.malloc.arena_test: 0x0 (min: 0x1, max: 0xffffffffffffffff)
64 glibc.pthread.mutex_spin_count: 100 (min: 0, max: 32767)
65 glibc.rtld.optional_static_tls: 0x200 (min: 0x0, max: 0xffffffffffffffff)
66 glibc.malloc.tcache_max: 0x0 (min: 0x0, max: 0xffffffffffffffff)
67 glibc.malloc.check: 0 (min: 0, max: 3)
68 @end example
70 @menu
71 * Tunable names::  The structure of a tunable name
72 * Memory Allocation Tunables::  Tunables in the memory allocation subsystem
73 * Dynamic Linking Tunables:: Tunables in the dynamic linking subsystem
74 * Elision Tunables::  Tunables in elision subsystem
75 * POSIX Thread Tunables:: Tunables in the POSIX thread subsystem
76 * Hardware Capability Tunables::  Tunables that modify the hardware
77                                   capabilities seen by @theglibc{}
78 * Memory Related Tunables::  Tunables that control the use of memory by
79                              @theglibc{}.
80 @end menu
82 @node Tunable names
83 @section Tunable names
84 @cindex Tunable names
85 @cindex Tunable namespaces
87 A tunable name is split into three components, a top namespace, a tunable
88 namespace and the tunable name. The top namespace for tunables implemented in
89 @theglibc{} is @code{glibc}. Distributions that choose to add custom tunables
90 in their maintained versions of @theglibc{} may choose to do so under their own
91 top namespace.
93 The tunable namespace is a logical grouping of tunables in a single
94 module. This currently holds no special significance, although that may
95 change in the future.
97 The tunable name is the actual name of the tunable. It is possible that
98 different tunable namespaces may have tunables within them that have the
99 same name, likewise for top namespaces. Hence, we only support
100 identification of tunables by their full name, i.e. with the top
101 namespace, tunable namespace and tunable name, separated by periods.
103 @node Memory Allocation Tunables
104 @section Memory Allocation Tunables
105 @cindex memory allocation tunables
106 @cindex malloc tunables
107 @cindex tunables, malloc
109 @deftp {Tunable namespace} glibc.malloc
110 Memory allocation behavior can be modified by setting any of the
111 following tunables in the @code{malloc} namespace:
112 @end deftp
114 @deftp Tunable glibc.malloc.check
115 This tunable supersedes the @env{MALLOC_CHECK_} environment variable and is
116 identical in features. This tunable has no effect by default and needs the
117 debug library @file{libc_malloc_debug} to be preloaded using the
118 @code{LD_PRELOAD} environment variable.
120 Setting this tunable to a non-zero value less than 4 enables a special (less
121 efficient) memory allocator for the @code{malloc} family of functions that is
122 designed to be tolerant against simple errors such as double calls of
123 free with the same argument, or overruns of a single byte (off-by-one
124 bugs). Not all such errors can be protected against, however, and memory
125 leaks can result.  Any detected heap corruption results in immediate
126 termination of the process.
128 Like @env{MALLOC_CHECK_}, @code{glibc.malloc.check} has a problem in that it
129 diverges from normal program behavior by writing to @code{stderr}, which could
130 by exploited in SUID and SGID binaries.  Therefore, @code{glibc.malloc.check}
131 is disabled by default for SUID and SGID binaries.  This can be enabled again
132 by the system administrator by adding a file @file{/etc/suid-debug}; the
133 content of the file could be anything or even empty.
134 @end deftp
136 @deftp Tunable glibc.malloc.top_pad
137 This tunable supersedes the @env{MALLOC_TOP_PAD_} environment variable and is
138 identical in features.
140 This tunable determines the amount of extra memory in bytes to obtain from the
141 system when any of the arenas need to be extended.  It also specifies the
142 number of bytes to retain when shrinking any of the arenas.  This provides the
143 necessary hysteresis in heap size such that excessive amounts of system calls
144 can be avoided.
146 The default value of this tunable is @samp{131072} (128 KB).
147 @end deftp
149 @deftp Tunable glibc.malloc.perturb
150 This tunable supersedes the @env{MALLOC_PERTURB_} environment variable and is
151 identical in features.
153 If set to a non-zero value, memory blocks are initialized with values depending
154 on some low order bits of this tunable when they are allocated (except when
155 allocated by @code{calloc}) and freed.  This can be used to debug the use of
156 uninitialized or freed heap memory. Note that this option does not guarantee
157 that the freed block will have any specific values. It only guarantees that the
158 content the block had before it was freed will be overwritten.
160 The default value of this tunable is @samp{0}.
161 @end deftp
163 @deftp Tunable glibc.malloc.mmap_threshold
164 This tunable supersedes the @env{MALLOC_MMAP_THRESHOLD_} environment variable
165 and is identical in features.
167 When this tunable is set, all chunks larger than this value in bytes are
168 allocated outside the normal heap, using the @code{mmap} system call. This way
169 it is guaranteed that the memory for these chunks can be returned to the system
170 on @code{free}. Note that requests smaller than this threshold might still be
171 allocated via @code{mmap}.
173 If this tunable is not set, the default value is set to @samp{131072} bytes and
174 the threshold is adjusted dynamically to suit the allocation patterns of the
175 program.  If the tunable is set, the dynamic adjustment is disabled and the
176 value is set as static.
177 @end deftp
179 @deftp Tunable glibc.malloc.trim_threshold
180 This tunable supersedes the @env{MALLOC_TRIM_THRESHOLD_} environment variable
181 and is identical in features.
183 The value of this tunable is the minimum size (in bytes) of the top-most,
184 releasable chunk in an arena that will trigger a system call in order to return
185 memory to the system from that arena.
187 If this tunable is not set, the default value is set as 128 KB and the
188 threshold is adjusted dynamically to suit the allocation patterns of the
189 program.  If the tunable is set, the dynamic adjustment is disabled and the
190 value is set as static.
191 @end deftp
193 @deftp Tunable glibc.malloc.mmap_max
194 This tunable supersedes the @env{MALLOC_MMAP_MAX_} environment variable and is
195 identical in features.
197 The value of this tunable is maximum number of chunks to allocate with
198 @code{mmap}.  Setting this to zero disables all use of @code{mmap}.
200 The default value of this tunable is @samp{65536}.
201 @end deftp
203 @deftp Tunable glibc.malloc.arena_test
204 This tunable supersedes the @env{MALLOC_ARENA_TEST} environment variable and is
205 identical in features.
207 The @code{glibc.malloc.arena_test} tunable specifies the number of arenas that
208 can be created before the test on the limit to the number of arenas is
209 conducted.  The value is ignored if @code{glibc.malloc.arena_max} is set.
211 The default value of this tunable is 2 for 32-bit systems and 8 for 64-bit
212 systems.
213 @end deftp
215 @deftp Tunable glibc.malloc.arena_max
216 This tunable supersedes the @env{MALLOC_ARENA_MAX} environment variable and is
217 identical in features.
219 This tunable sets the number of arenas to use in a process regardless of the
220 number of cores in the system.
222 The default value of this tunable is @code{0}, meaning that the limit on the
223 number of arenas is determined by the number of CPU cores online.  For 32-bit
224 systems the limit is twice the number of cores online and on 64-bit systems, it
225 is 8 times the number of cores online.
226 @end deftp
228 @deftp Tunable glibc.malloc.tcache_max
229 The maximum size of a request (in bytes) which may be met via the
230 per-thread cache.  The default (and maximum) value is 1032 bytes on
231 64-bit systems and 516 bytes on 32-bit systems.
232 @end deftp
234 @deftp Tunable glibc.malloc.tcache_count
235 The maximum number of chunks of each size to cache. The default is 7.
236 The upper limit is 65535.  If set to zero, the per-thread cache is effectively
237 disabled.
239 The approximate maximum overhead of the per-thread cache is thus equal
240 to the number of bins times the chunk count in each bin times the size
241 of each chunk.  With defaults, the approximate maximum overhead of the
242 per-thread cache is approximately 236 KB on 64-bit systems and 118 KB
243 on 32-bit systems.
244 @end deftp
246 @deftp Tunable glibc.malloc.tcache_unsorted_limit
247 When the user requests memory and the request cannot be met via the
248 per-thread cache, the arenas are used to meet the request.  At this
249 time, additional chunks will be moved from existing arena lists to
250 pre-fill the corresponding cache.  While copies from the fastbins,
251 smallbins, and regular bins are bounded and predictable due to the bin
252 sizes, copies from the unsorted bin are not bounded, and incur
253 additional time penalties as they need to be sorted as they're
254 scanned.  To make scanning the unsorted list more predictable and
255 bounded, the user may set this tunable to limit the number of chunks
256 that are scanned from the unsorted list while searching for chunks to
257 pre-fill the per-thread cache with.  The default, or when set to zero,
258 is no limit.
259 @end deftp
261 @deftp Tunable glibc.malloc.mxfast
262 One of the optimizations @code{malloc} uses is to maintain a series of ``fast
263 bins'' that hold chunks up to a specific size.  The default and
264 maximum size which may be held this way is 80 bytes on 32-bit systems
265 or 160 bytes on 64-bit systems.  Applications which value size over
266 speed may choose to reduce the size of requests which are serviced
267 from fast bins with this tunable.  Note that the value specified
268 includes @code{malloc}'s internal overhead, which is normally the size of one
269 pointer, so add 4 on 32-bit systems or 8 on 64-bit systems to the size
270 passed to @code{malloc} for the largest bin size to enable.
271 @end deftp
273 @deftp Tunable glibc.malloc.hugetlb
274 This tunable controls the usage of Huge Pages on @code{malloc} calls.  The
275 default value is @code{0}, which disables any additional support on
276 @code{malloc}.
278 Setting its value to @code{1} enables the use of @code{madvise} with
279 @code{MADV_HUGEPAGE} after memory allocation with @code{mmap}.  It is enabled
280 only if the system supports Transparent Huge Page (currently only on Linux).
282 Setting its value to @code{2} enables the use of Huge Page directly with
283 @code{mmap} with the use of @code{MAP_HUGETLB} flag.  The huge page size
284 to use will be the default one provided by the system.  A value larger than
285 @code{2} specifies huge page size, which will be matched against the system
286 supported ones.  If provided value is invalid, @code{MAP_HUGETLB} will not
287 be used.
288 @end deftp
290 @node Dynamic Linking Tunables
291 @section Dynamic Linking Tunables
292 @cindex dynamic linking tunables
293 @cindex rtld tunables
295 @deftp {Tunable namespace} glibc.rtld
296 Dynamic linker behavior can be modified by setting the
297 following tunables in the @code{rtld} namespace:
298 @end deftp
300 @deftp Tunable glibc.rtld.nns
301 Sets the number of supported dynamic link namespaces (see @code{dlmopen}).
302 Currently this limit can be set between 1 and 16 inclusive, the default is 4.
303 Each link namespace consumes some memory in all thread, and thus raising the
304 limit will increase the amount of memory each thread uses. Raising the limit
305 is useful when your application uses more than 4 dynamic link namespaces as
306 created by @code{dlmopen} with an lmid argument of @code{LM_ID_NEWLM}.
307 Dynamic linker audit modules are loaded in their own dynamic link namespaces,
308 but they are not accounted for in @code{glibc.rtld.nns}.  They implicitly
309 increase the per-thread memory usage as necessary, so this tunable does
310 not need to be changed to allow many audit modules e.g. via @env{LD_AUDIT}.
311 @end deftp
313 @deftp Tunable glibc.rtld.optional_static_tls
314 Sets the amount of surplus static TLS in bytes to allocate at program
315 startup.  Every thread created allocates this amount of specified surplus
316 static TLS. This is a minimum value and additional space may be allocated
317 for internal purposes including alignment.  Optional static TLS is used for
318 optimizing dynamic TLS access for platforms that support such optimizations
319 e.g. TLS descriptors or optimized TLS access for POWER (@code{DT_PPC64_OPT}
320 and @code{DT_PPC_OPT}).  In order to make the best use of such optimizations
321 the value should be as many bytes as would be required to hold all TLS
322 variables in all dynamic loaded shared libraries.  The value cannot be known
323 by the dynamic loader because it doesn't know the expected set of shared
324 libraries which will be loaded.  The existing static TLS space cannot be
325 changed once allocated at process startup.  The default allocation of
326 optional static TLS is 512 bytes and is allocated in every thread.
327 @end deftp
329 @deftp Tunable glibc.rtld.dynamic_sort
330 Sets the algorithm to use for DSO sorting, valid values are @samp{1} and
331 @samp{2}.  For value of @samp{1}, an older O(n^3) algorithm is used, which is
332 long time tested, but may have performance issues when dependencies between
333 shared objects contain cycles due to circular dependencies.  When set to the
334 value of @samp{2}, a different algorithm is used, which implements a
335 topological sort through depth-first search, and does not exhibit the
336 performance issues of @samp{1}.
338 The default value of this tunable is @samp{2}.
339 @end deftp
341 @node Elision Tunables
342 @section Elision Tunables
343 @cindex elision tunables
344 @cindex tunables, elision
346 @deftp {Tunable namespace} glibc.elision
347 Contended locks are usually slow and can lead to performance and scalability
348 issues in multithread code. Lock elision will use memory transactions to under
349 certain conditions, to elide locks and improve performance.
350 Elision behavior can be modified by setting the following tunables in
351 the @code{elision} namespace:
352 @end deftp
354 @deftp Tunable glibc.elision.enable
355 The @code{glibc.elision.enable} tunable enables lock elision if the feature is
356 supported by the hardware.  If elision is not supported by the hardware this
357 tunable has no effect.
359 Elision tunables are supported for 64-bit Intel, IBM POWER, and z System
360 architectures.
361 @end deftp
363 @deftp Tunable glibc.elision.skip_lock_busy
364 The @code{glibc.elision.skip_lock_busy} tunable sets how many times to use a
365 non-transactional lock after a transactional failure has occurred because the
366 lock is already acquired.  Expressed in number of lock acquisition attempts.
368 The default value of this tunable is @samp{3}.
369 @end deftp
371 @deftp Tunable glibc.elision.skip_lock_internal_abort
372 The @code{glibc.elision.skip_lock_internal_abort} tunable sets how many times
373 the thread should avoid using elision if a transaction aborted for any reason
374 other than a different thread's memory accesses.  Expressed in number of lock
375 acquisition attempts.
377 The default value of this tunable is @samp{3}.
378 @end deftp
380 @deftp Tunable glibc.elision.skip_lock_after_retries
381 The @code{glibc.elision.skip_lock_after_retries} tunable sets how many times
382 to try to elide a lock with transactions, that only failed due to a different
383 thread's memory accesses, before falling back to regular lock.
384 Expressed in number of lock elision attempts.
386 This tunable is supported only on IBM POWER, and z System architectures.
388 The default value of this tunable is @samp{3}.
389 @end deftp
391 @deftp Tunable glibc.elision.tries
392 The @code{glibc.elision.tries} sets how many times to retry elision if there is
393 chance for the transaction to finish execution e.g., it wasn't
394 aborted due to the lock being already acquired.  If elision is not supported
395 by the hardware this tunable is set to @samp{0} to avoid retries.
397 The default value of this tunable is @samp{3}.
398 @end deftp
400 @deftp Tunable glibc.elision.skip_trylock_internal_abort
401 The @code{glibc.elision.skip_trylock_internal_abort} tunable sets how many
402 times the thread should avoid trying the lock if a transaction aborted due to
403 reasons other than a different thread's memory accesses.  Expressed in number
404 of try lock attempts.
406 The default value of this tunable is @samp{3}.
407 @end deftp
409 @node POSIX Thread Tunables
410 @section POSIX Thread Tunables
411 @cindex pthread mutex tunables
412 @cindex thread mutex tunables
413 @cindex mutex tunables
414 @cindex tunables thread mutex
416 @deftp {Tunable namespace} glibc.pthread
417 The behavior of POSIX threads can be tuned to gain performance improvements
418 according to specific hardware capabilities and workload characteristics by
419 setting the following tunables in the @code{pthread} namespace:
420 @end deftp
422 @deftp Tunable glibc.pthread.mutex_spin_count
423 The @code{glibc.pthread.mutex_spin_count} tunable sets the maximum number of times
424 a thread should spin on the lock before calling into the kernel to block.
425 Adaptive spin is used for mutexes initialized with the
426 @code{PTHREAD_MUTEX_ADAPTIVE_NP} GNU extension.  It affects both
427 @code{pthread_mutex_lock} and @code{pthread_mutex_timedlock}.
429 The thread spins until either the maximum spin count is reached or the lock
430 is acquired.
432 The default value of this tunable is @samp{100}.
433 @end deftp
435 @deftp Tunable glibc.pthread.stack_cache_size
436 This tunable configures the maximum size of the stack cache.  Once the
437 stack cache exceeds this size, unused thread stacks are returned to
438 the kernel, to bring the cache size below this limit.
440 The value is measured in bytes.  The default is @samp{41943040}
441 (fourty mibibytes).
442 @end deftp
444 @deftp Tunable glibc.pthread.rseq
445 The @code{glibc.pthread.rseq} tunable can be set to @samp{0}, to disable
446 restartable sequences support in @theglibc{}.  This enables applications
447 to perform direct restartable sequence registration with the kernel.
448 The default is @samp{1}, which means that @theglibc{} performs
449 registration on behalf of the application.
451 Restartable sequences are a Linux-specific extension.
452 @end deftp
454 @node Hardware Capability Tunables
455 @section Hardware Capability Tunables
456 @cindex hardware capability tunables
457 @cindex hwcap tunables
458 @cindex tunables, hwcap
459 @cindex hwcaps tunables
460 @cindex tunables, hwcaps
461 @cindex data_cache_size tunables
462 @cindex tunables, data_cache_size
463 @cindex shared_cache_size tunables
464 @cindex tunables, shared_cache_size
465 @cindex non_temporal_threshold tunables
466 @cindex tunables, non_temporal_threshold
468 @deftp {Tunable namespace} glibc.cpu
469 Behavior of @theglibc{} can be tuned to assume specific hardware capabilities
470 by setting the following tunables in the @code{cpu} namespace:
471 @end deftp
473 @deftp Tunable glibc.cpu.hwcap_mask
474 This tunable supersedes the @env{LD_HWCAP_MASK} environment variable and is
475 identical in features.
477 The @code{AT_HWCAP} key in the Auxiliary Vector specifies instruction set
478 extensions available in the processor at runtime for some architectures.  The
479 @code{glibc.cpu.hwcap_mask} tunable allows the user to mask out those
480 capabilities at runtime, thus disabling use of those extensions.
481 @end deftp
483 @deftp Tunable glibc.cpu.hwcaps
484 The @code{glibc.cpu.hwcaps=-xxx,yyy,-zzz...} tunable allows the user to
485 enable CPU/ARCH feature @code{yyy}, disable CPU/ARCH feature @code{xxx}
486 and @code{zzz} where the feature name is case-sensitive and has to match
487 the ones in @code{sysdeps/x86/include/cpu-features.h}.
489 This tunable is specific to i386 and x86-64.
490 @end deftp
492 @deftp Tunable glibc.cpu.cached_memopt
493 The @code{glibc.cpu.cached_memopt=[0|1]} tunable allows the user to
494 enable optimizations recommended for cacheable memory.  If set to
495 @code{1}, @theglibc{} assumes that the process memory image consists
496 of cacheable (non-device) memory only.  The default, @code{0},
497 indicates that the process may use device memory.
499 This tunable is specific to powerpc, powerpc64 and powerpc64le.
500 @end deftp
502 @deftp Tunable glibc.cpu.name
503 The @code{glibc.cpu.name=xxx} tunable allows the user to tell @theglibc{} to
504 assume that the CPU is @code{xxx} where xxx may have one of these values:
505 @code{generic}, @code{falkor}, @code{thunderxt88}, @code{thunderx2t99},
506 @code{thunderx2t99p1}, @code{ares}, @code{emag}, @code{kunpeng},
507 @code{a64fx}.
509 This tunable is specific to aarch64.
510 @end deftp
512 @deftp Tunable glibc.cpu.x86_data_cache_size
513 The @code{glibc.cpu.x86_data_cache_size} tunable allows the user to set
514 data cache size in bytes for use in memory and string routines.
516 This tunable is specific to i386 and x86-64.
517 @end deftp
519 @deftp Tunable glibc.cpu.x86_shared_cache_size
520 The @code{glibc.cpu.x86_shared_cache_size} tunable allows the user to
521 set shared cache size in bytes for use in memory and string routines.
522 @end deftp
524 @deftp Tunable glibc.cpu.x86_non_temporal_threshold
525 The @code{glibc.cpu.x86_non_temporal_threshold} tunable allows the user
526 to set threshold in bytes for non temporal store. Non temporal stores
527 give a hint to the hardware to move data directly to memory without
528 displacing other data from the cache. This tunable is used by some
529 platforms to determine when to use non temporal stores in operations
530 like memmove and memcpy.
532 This tunable is specific to i386 and x86-64.
533 @end deftp
535 @deftp Tunable glibc.cpu.x86_rep_movsb_threshold
536 The @code{glibc.cpu.x86_rep_movsb_threshold} tunable allows the user to
537 set threshold in bytes to start using "rep movsb".  The value must be
538 greater than zero, and currently defaults to 2048 bytes.
540 This tunable is specific to i386 and x86-64.
541 @end deftp
543 @deftp Tunable glibc.cpu.x86_rep_stosb_threshold
544 The @code{glibc.cpu.x86_rep_stosb_threshold} tunable allows the user to
545 set threshold in bytes to start using "rep stosb".  The value must be
546 greater than zero, and currently defaults to 2048 bytes.
548 This tunable is specific to i386 and x86-64.
549 @end deftp
551 @deftp Tunable glibc.cpu.x86_ibt
552 The @code{glibc.cpu.x86_ibt} tunable allows the user to control how
553 indirect branch tracking (IBT) should be enabled.  Accepted values are
554 @code{on}, @code{off}, and @code{permissive}.  @code{on} always turns
555 on IBT regardless of whether IBT is enabled in the executable and its
556 dependent shared libraries.  @code{off} always turns off IBT regardless
557 of whether IBT is enabled in the executable and its dependent shared
558 libraries.  @code{permissive} is the same as the default which disables
559 IBT on non-CET executables and shared libraries.
561 This tunable is specific to i386 and x86-64.
562 @end deftp
564 @deftp Tunable glibc.cpu.x86_shstk
565 The @code{glibc.cpu.x86_shstk} tunable allows the user to control how
566 the shadow stack (SHSTK) should be enabled.  Accepted values are
567 @code{on}, @code{off}, and @code{permissive}.  @code{on} always turns on
568 SHSTK regardless of whether SHSTK is enabled in the executable and its
569 dependent shared libraries.  @code{off} always turns off SHSTK regardless
570 of whether SHSTK is enabled in the executable and its dependent shared
571 libraries.  @code{permissive} changes how dlopen works on non-CET shared
572 libraries.  By default, when SHSTK is enabled, dlopening a non-CET shared
573 library returns an error.  With @code{permissive}, it turns off SHSTK
574 instead.
576 This tunable is specific to i386 and x86-64.
577 @end deftp
579 @node Memory Related Tunables
580 @section Memory Related Tunables
581 @cindex memory related tunables
583 @deftp {Tunable namespace} glibc.mem
584 This tunable namespace supports operations that affect the way @theglibc{}
585 and the process manage memory.
586 @end deftp
588 @deftp Tunable glibc.mem.tagging
589 If the hardware supports memory tagging, this tunable can be used to
590 control the way @theglibc{} uses this feature.  At present this is only
591 supported on AArch64 systems with the MTE extention; it is ignored for
592 all other systems.
594 This tunable takes a value between 0 and 255 and acts as a bitmask
595 that enables various capabilities.
597 Bit 0 (the least significant bit) causes the @code{malloc}
598 subsystem to allocate
599 tagged memory, with each allocation being assigned a random tag.
601 Bit 1 enables precise faulting mode for tag violations on systems that
602 support deferred tag violation reporting.  This may cause programs
603 to run more slowly.
605 Bit 2 enables either precise or deferred faulting mode for tag violations
606 whichever is preferred by the system.
608 Other bits are currently reserved.
610 @Theglibc{} startup code will automatically enable memory tagging
611 support in the kernel if this tunable has any non-zero value.
613 The default value is @samp{0}, which disables all memory tagging.
614 @end deftp