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