[PATCH v5 0/4] Add system-wide tunables
DJ Delorie
dj@redhat.com
Wed Feb 11 05:02:49 GMT 2026
This patch series is the initial implementation of system-wide
tunables, which I mentioned a while ago.
The first part has ldconfig read tunable information from
/etc/tunables.conf and store it to /etc/ld.so.cache. Reusing ldconfig
means no new documentation or training would be required of sysadmins,
or reprogramming of distro packaging.
The second part optimizes the loading of /etc/ld.so.cache and allows
for it to be loaded independently of searching for libraries, so that
tunables information can be loaded as needed.
The third part applies the stored tunable information to the running
application.
The fourth part adds simple filtering, allowing the admin to override
or augment tunables on a per-process basis, like this:
glibc.malloc.whatever=10
[proc:/usr/bin/qemu]
glibc.malloc.whatever=20
Note that such filters only last until EOF or the beginning of the
next included config file.
Changes since v1: fixed format bug in error() and rebased. No other
changes.
Changes since v2: Added per-process filter. Rebased. Probably various
tweaks and minor changes.
Changes since v3/v4: printf cleanups, remove custom dl_str*()
functions, off-by-one error, new [proc:*] syntax.
DJ Delorie (4):
Add system-wide tunables: ldconfig part
Add system-wide tunables: cache ld.so.cache
Add system-wide tunables: Apply tunables part
Add system-wide tunables: Filters
csu/libc-start.c | 2 +-
elf/Makefile | 6 +
elf/cache.c | 66 +++-
elf/dl-cache.c | 279 +++++++++----
elf/dl-tunables.c | 125 +++++-
elf/dl-tunables.h | 2 +-
elf/ldconfig.c | 21 +-
elf/tst-tunconf1.c | 36 ++
elf/tst-tunconf1.root/etc/tunables.conf | 6 +
elf/tst-tunconf1.root/ldconfig.run | 0
elf/tst-tunconf1.root/postclean.req | 0
elf/tunconf.c | 494 ++++++++++++++++++++++++
elf/tunconf.h | 43 +++
sysdeps/generic/dl-cache.h | 6 +
sysdeps/generic/ldconfig.h | 2 +
sysdeps/mach/hurd/dl-sysdep.c | 2 +-
sysdeps/unix/sysv/linux/dl-sysdep.c | 2 +-
17 files changed, 998 insertions(+), 94 deletions(-)
create mode 100644 elf/tst-tunconf1.c
create mode 100644 elf/tst-tunconf1.root/etc/tunables.conf
create mode 100644 elf/tst-tunconf1.root/ldconfig.run
create mode 100644 elf/tst-tunconf1.root/postclean.req
create mode 100644 elf/tunconf.c
create mode 100644 elf/tunconf.h
--
2.47.3
More information about the Libc-alpha
mailing list