2022-01-02 02:54:23 +08:00
|
|
|
# Copyright (C) 2016-2022 Free Software Foundation, Inc.
|
2017-01-01 02:02:17 +08:00
|
|
|
# This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
# The GNU C Library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
# The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with the GNU C Library; if not, see
|
Prefer https to http for gnu.org and fsf.org URLs
Also, change sources.redhat.com to sourceware.org.
This patch was automatically generated by running the following shell
script, which uses GNU sed, and which avoids modifying files imported
from upstream:
sed -ri '
s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g
s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g
' \
$(find $(git ls-files) -prune -type f \
! -name '*.po' \
! -name 'ChangeLog*' \
! -path COPYING ! -path COPYING.LIB \
! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \
! -path manual/texinfo.tex ! -path scripts/config.guess \
! -path scripts/config.sub ! -path scripts/install-sh \
! -path scripts/mkinstalldirs ! -path scripts/move-if-change \
! -path INSTALL ! -path locale/programs/charmap-kw.h \
! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \
! '(' -name configure \
-execdir test -f configure.ac -o -f configure.in ';' ')' \
! '(' -name preconfigure \
-execdir test -f preconfigure.ac ';' ')' \
-print)
and then by running 'make dist-prepare' to regenerate files built
from the altered files, and then executing the following to cleanup:
chmod a+x sysdeps/unix/sysv/linux/riscv/configure
# Omit irrelevant whitespace and comment-only changes,
# perhaps from a slightly-different Autoconf version.
git checkout -f \
sysdeps/csky/configure \
sysdeps/hppa/configure \
sysdeps/riscv/configure \
sysdeps/unix/sysv/linux/csky/configure
# Omit changes that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines
git checkout -f \
sysdeps/powerpc/powerpc64/ppc-mcount.S \
sysdeps/unix/sysv/linux/s390/s390-64/syscall.S
# Omit change that caused a pre-commit check to fail like this:
# remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline
git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
2019-09-07 13:40:42 +08:00
|
|
|
# <https://www.gnu.org/licenses/>.
|
2017-01-01 02:02:17 +08:00
|
|
|
|
|
|
|
# Allowed attributes for tunables:
|
|
|
|
#
|
|
|
|
# type: Defaults to STRING
|
|
|
|
# minval: Optional minimum acceptable value
|
|
|
|
# maxval: Optional maximum acceptable value
|
|
|
|
# env_alias: An alias environment variable
|
2020-10-22 14:09:00 +08:00
|
|
|
# security_level: Specify security level of the tunable for AT_SECURE binaries.
|
|
|
|
# Valid values are:
|
2017-02-02 18:16:01 +08:00
|
|
|
#
|
2020-10-22 14:09:00 +08:00
|
|
|
# SXID_ERASE: (default) Do not read and do not pass on to
|
|
|
|
# child processes.
|
|
|
|
# SXID_IGNORE: Do not read, but retain for non-AT_SECURE
|
|
|
|
# subprocesses.
|
2017-03-24 13:38:28 +08:00
|
|
|
# NONE: Read all the time.
|
2017-01-01 02:02:17 +08:00
|
|
|
|
|
|
|
glibc {
|
|
|
|
malloc {
|
|
|
|
check {
|
|
|
|
type: INT_32
|
|
|
|
minval: 0
|
|
|
|
maxval: 3
|
|
|
|
env_alias: MALLOC_CHECK_
|
|
|
|
}
|
|
|
|
top_pad {
|
|
|
|
type: SIZE_T
|
|
|
|
env_alias: MALLOC_TOP_PAD_
|
2017-02-02 18:16:01 +08:00
|
|
|
security_level: SXID_IGNORE
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|
|
|
|
perturb {
|
|
|
|
type: INT_32
|
|
|
|
minval: 0
|
|
|
|
maxval: 0xff
|
|
|
|
env_alias: MALLOC_PERTURB_
|
2017-02-02 18:16:01 +08:00
|
|
|
security_level: SXID_IGNORE
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|
|
|
|
mmap_threshold {
|
|
|
|
type: SIZE_T
|
|
|
|
env_alias: MALLOC_MMAP_THRESHOLD_
|
2017-02-02 18:16:01 +08:00
|
|
|
security_level: SXID_IGNORE
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|
|
|
|
trim_threshold {
|
|
|
|
type: SIZE_T
|
|
|
|
env_alias: MALLOC_TRIM_THRESHOLD_
|
2017-02-02 18:16:01 +08:00
|
|
|
security_level: SXID_IGNORE
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|
|
|
|
mmap_max {
|
|
|
|
type: INT_32
|
|
|
|
env_alias: MALLOC_MMAP_MAX_
|
2017-02-02 18:16:01 +08:00
|
|
|
security_level: SXID_IGNORE
|
2021-02-05 16:39:24 +08:00
|
|
|
minval: 0
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|
|
|
|
arena_max {
|
|
|
|
type: SIZE_T
|
|
|
|
env_alias: MALLOC_ARENA_MAX
|
|
|
|
minval: 1
|
2017-02-02 18:16:01 +08:00
|
|
|
security_level: SXID_IGNORE
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|
|
|
|
arena_test {
|
|
|
|
type: SIZE_T
|
|
|
|
env_alias: MALLOC_ARENA_TEST
|
|
|
|
minval: 1
|
2017-02-02 18:16:01 +08:00
|
|
|
security_level: SXID_IGNORE
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|
2017-07-07 01:37:30 +08:00
|
|
|
tcache_max {
|
|
|
|
type: SIZE_T
|
|
|
|
}
|
|
|
|
tcache_count {
|
|
|
|
type: SIZE_T
|
|
|
|
}
|
|
|
|
tcache_unsorted_limit {
|
|
|
|
type: SIZE_T
|
|
|
|
}
|
2019-08-09 07:09:43 +08:00
|
|
|
mxfast {
|
|
|
|
type: SIZE_T
|
|
|
|
minval: 0
|
|
|
|
security_level: SXID_IGNORE
|
|
|
|
}
|
2021-08-13 19:36:29 +08:00
|
|
|
hugetlb {
|
malloc: Add Huge Page support for mmap
With the morecore hook removed, there is not easy way to provide huge
pages support on with glibc allocator without resorting to transparent
huge pages. And some users and programs do prefer to use the huge pages
directly instead of THP for multiple reasons: no splitting, re-merging
by the VM, no TLB shootdowns for running processes, fast allocation
from the reserve pool, no competition with the rest of the processes
unlike THP, no swapping all, etc.
This patch extends the 'glibc.malloc.hugetlb' tunable: the value
'2' means to use huge pages directly with the system default size,
while a positive value means and specific page size that is matched
against the supported ones by the system.
Currently only memory allocated on sysmalloc() is handled, the arenas
still uses the default system page size.
To test is a new rule is added tests-malloc-hugetlb2, which run the
addes tests with the required GLIBC_TUNABLE setting. On systems without
a reserved huge pages pool, is just stress the mmap(MAP_HUGETLB)
allocation failure. To improve test coverage it is required to create
a pool with some allocated pages.
Checked on x86_64-linux-gnu.
Reviewed-by: DJ Delorie <dj@redhat.com>
2021-08-17 02:08:27 +08:00
|
|
|
type: SIZE_T
|
2021-08-13 19:36:29 +08:00
|
|
|
minval: 0
|
|
|
|
}
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|
2018-08-03 02:19:19 +08:00
|
|
|
cpu {
|
2017-04-17 12:30:35 +08:00
|
|
|
hwcap_mask {
|
|
|
|
type: UINT_64
|
|
|
|
env_alias: LD_HWCAP_MASK
|
|
|
|
default: HWCAP_IMPORTANT
|
2017-12-15 03:18:12 +08:00
|
|
|
}
|
2017-04-17 12:30:35 +08:00
|
|
|
}
|
2017-12-06 00:24:14 +08:00
|
|
|
|
|
|
|
elision {
|
|
|
|
enable {
|
|
|
|
type: INT_32
|
|
|
|
minval: 0
|
|
|
|
maxval: 1
|
|
|
|
}
|
|
|
|
skip_lock_busy {
|
|
|
|
type: INT_32
|
|
|
|
default: 3
|
2021-02-05 16:39:24 +08:00
|
|
|
minval: 0
|
2017-12-06 00:24:14 +08:00
|
|
|
}
|
|
|
|
skip_lock_internal_abort {
|
|
|
|
type: INT_32
|
|
|
|
default: 3
|
2021-02-05 16:39:24 +08:00
|
|
|
minval: 0
|
2017-12-06 00:24:14 +08:00
|
|
|
}
|
|
|
|
skip_lock_after_retries {
|
|
|
|
type: INT_32
|
|
|
|
default: 3
|
2021-02-05 16:39:24 +08:00
|
|
|
minval: 0
|
2017-12-06 00:24:14 +08:00
|
|
|
}
|
|
|
|
tries {
|
|
|
|
type: INT_32
|
|
|
|
default: 3
|
2021-02-05 16:39:24 +08:00
|
|
|
minval: 0
|
2017-12-06 00:24:14 +08:00
|
|
|
}
|
|
|
|
skip_trylock_internal_abort {
|
|
|
|
type: INT_32
|
|
|
|
default: 3
|
2021-02-05 16:39:24 +08:00
|
|
|
minval: 0
|
2017-12-06 00:24:14 +08:00
|
|
|
}
|
|
|
|
}
|
2020-06-09 16:57:28 +08:00
|
|
|
|
|
|
|
rtld {
|
|
|
|
nns {
|
|
|
|
type: SIZE_T
|
|
|
|
minval: 1
|
|
|
|
maxval: 16
|
|
|
|
default: 4
|
|
|
|
}
|
2020-06-10 20:40:40 +08:00
|
|
|
optional_static_tls {
|
|
|
|
type: SIZE_T
|
|
|
|
minval: 0
|
|
|
|
default: 512
|
|
|
|
}
|
2020-06-09 16:57:28 +08:00
|
|
|
}
|
2020-12-21 23:03:03 +08:00
|
|
|
|
|
|
|
mem {
|
|
|
|
tagging {
|
|
|
|
type: INT_32
|
|
|
|
minval: 0
|
|
|
|
maxval: 255
|
|
|
|
security_level: SXID_IGNORE
|
|
|
|
}
|
|
|
|
}
|
2021-10-21 21:41:22 +08:00
|
|
|
|
|
|
|
rtld {
|
|
|
|
dynamic_sort {
|
|
|
|
type: INT_32
|
|
|
|
minval: 1
|
|
|
|
maxval: 2
|
2021-12-14 19:37:44 +08:00
|
|
|
default: 2
|
2021-10-21 21:41:22 +08:00
|
|
|
}
|
|
|
|
}
|
2017-01-01 02:02:17 +08:00
|
|
|
}
|