Skip to contentSkip to conversation

Tunables-related updates

PATCH Superseded DJ Delorie 3 participants 9 messages Jul 15 – Jul 16 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

DJ Delorie

author
#0 lore raw

v2 cover Tunables-related updates

DJ Delorie (4):
man/man5/ld.so.conf.5: document include syntax man/man5/tunables.conf: Document system-wide tunables config man/man8/ld.so.8: Note that ld.so.cache includes tunables man/man8/ldconfig.8: Add tunables options

 man/man5/ld.so.conf.5    |  28 ++++++++++
 man/man5/tunables.conf.5 | 116 +++++++++++++++++++++++++++++++++++++++
 man/man8/ld.so.8         |   3 +-
 man/man8/ldconfig.8      |  25 ++++++++-
 4 files changed, 168 insertions(+), 4 deletions(-)
 create mode 100644 man/man5/tunables.conf.5
Signature · 1 line
2.47.3
author
#3 lore raw

PATCH v2 3/4 man/man8/ld.so.8: Note that ld.so.cache includes tunables

In reply to DJ Delorie
---
 man/man8/ld.so.8 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
man/man8/ld.so.8 +2 -1
index 5f3c22ef2..8916f2443 100644
@@ -792,7 +792,8 @@ .SH FILES
 .TP
 .I /etc/ld.so.cache
 File containing a compiled list of directories in which to search for
-shared objects and an ordered list of candidate shared objects.
+shared objects and an ordered list of candidate shared objects,
+and any tunables to be applied.
 See
 .BR ldconfig (8).
 .TP
Signature · 1 line
2.47.3
author
#4 lore raw

PATCH v2 4/4 man/man8/ldconfig.8: Add tunables options

---
 man/man8/ldconfig.8 | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
man/man8/ldconfig.8 +22 -1
index cb7d62ccc..e575fdec6 100644
@@ -17,6 +17,8 @@ .SH SYNOPSIS
 .IR conf ]
 .RB [ \-r\~\c
 .IR root ]
+.RB [ \-t\~\c
+.IR tunconf ]
 .IR directory \~.\|.\|.
 .YS
 .SY /sbin/ldconfig
@@ -85,6 +87,13 @@ .SH DESCRIPTION
 .P
 Failure to follow this pattern may result in compatibility issues
 after an upgrade.
+.P
+If the file
+.I /etc/tunables.conf
+exists,
+it contains tunables to be applied to all processes.
+These tunables are stored
+in the cache and applied to every process at its startup.
 .SH OPTIONS
 .TP
 .BI \-\-format= fmt
@@ -157,6 +166,12 @@ .SH OPTIONS
 .I root
 as the root directory.
 .TP
+.BI \-t\~ tunconf
+Use
+.I tunconf
+instead of
+.IR /etc/tunables.conf .
+.TP
 .B \-\-verbose
 .TQ
 .B \-v
@@ -188,11 +203,17 @@ .SH FILES
 See
 .BR ld.so.conf (5).
 .TP
+.I /etc/tunables.conf
+See
+.BR tunables.conf (5).
+.TP
 .I /etc/ld.so.cache
 contains an ordered list of libraries found in the directories
 specified in
 .IR /etc/ld.so.conf ,
-as well as those found in the trusted directories.
+as well as those found in the trusted directories,
+and any tunables listed in
+.IR /etc/tunables.conf .
 .PD
 .SH SEE ALSO
 .BR ldd (1),
Signature · 1 line
2.47.3
author
#2 lore raw

PATCH v2 2/4 man/man5/tunables.conf: Document system-wide tunables config

In reply to DJ Delorie
---
 man/man5/tunables.conf.5 | 116 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100644 man/man5/tunables.conf.5
man/man5/tunables.conf.5 new file +116 -0
new file mode 100644
index 000000000..e2b31e351
@@ -0,0 +1,116 @@
+.TH tunables.conf 5 (date) "Linux man-pages (unreleased)"
+.SH NAME
+tunables.conf \- tunables configuration file
+.SH SYNOPSIS
+.nf
+.B /etc/tunables.conf
+.fi
+.SH DESCRIPTION
+Each line in the file
+.I /etc/tunables.conf
+specifies a tunable,
+which is a name and value separated by an equals sign.
+.P
+For a list of valid tunables,
+please consult the glibc manual.
+.P
+The syntax allows lines to start with the word
+.I include
+followed by a path wildcard,
+and will include any files matching that wildcard.
+The wildcard is a path specification in the
+.BR \%glob (7)
+format.
+Files matching that wildcard will be processed
+as if their contents were included in the main config file.
+.P
+The file is parsed by
+.BR \%ldconfig (8)
+and the results stored in
+.IR /etc/ld.so.cache .
+The resulting data is read when a new process starts.
+.P
+Each line may include zero or more words or symbols at the beginning,
+which affect how each tunable affects each processes:
+.TP
+.B overridable
+.TQ
+.B +
+Allow the tunable to be overridden by the
+.B GLIBC_TUNABLES
+environment variable when the process runs
+(this is the default).
+.TP
+.B nonoverridable
+.TQ
+.B \-
+Do not allow the tunable to be overridden by the environment variable.
+.TP
+.B onlysecure
+.TQ
+.B @
+The tunable only applies to
+.B AT_SECURE
+processes,
+such as a set-user-ID process,
+or one with elevated capabilities.
+.TP
+.B nonsecure
+.TQ
+.B $
+The tunable only applies to
+.RB non- AT_SECURE
+processes (this is the default).
+.TP
+.B anysecure
+.TQ
+.B *
+The tunable only applies to both
+.B AT_SECURE
+and
+.RB non- AT_SECURE
+processes.
+.P
+The file may also contain
+.IR filters ,
+which limit the tunables following it,
+up to the end of the file
+(or end of the included file,
+or start of a new included file)
+or a line with only
+.B []
+on it.
+The syntax is:
+.IP
+.in +4n
+.EX
+.RI [ filter : pattern ]
+.EE
+.in
+.TP
+.B proc
+The
+.I proc
+filter limits the following tunables to processes
+whose name matches the pattern.
+The pattern may be an absolute path
+or just the base name.
+.P
+Example config file:
+.IP
+.in +4n
+.EX
+glibc.malloc.arenas_max=5
+onlysecure glibc.malloc.arenas_max=1
+\-glibc.pthread.rseq=1
+[proc:/bin/bad.program]
+\-glibc.pthread.rseq=0
+[proc:some.program]
+\-glibc.malloc.mmap_threshold=65536
+.EE
+.in
+.SH FILES
+.I /etc/ld.so.conf
+.SH SEE ALSO
+.BR ld.so (8),
+.BR ldconfig (8)
Signature · 1 line
2.47.3
author
#1 lore raw

PATCH v2 1/4 man/man5/ld.so.conf.5: document include syntax

In reply to DJ Delorie
---
 man/man5/ld.so.conf.5 | 28 ++++++++++++++++++++++++++++
 man/man8/ldconfig.8   |  2 --
 2 files changed, 28 insertions(+), 2 deletions(-)
man/man5/ld.so.conf.5 +28 -0
index 481cf9152..25f9adf90 100644
@@ -9,6 +9,34 @@ .SH DESCRIPTION
 This file contains a list of directories,
 one per line,
 in which to search for libraries.
+.P
+The file
+(and any other files included by it)
+is parsed by
+.B \%ldconfig
+and the results stored in
+.IR /etc/ld.so.cache .
+.P
+The syntax allows lines to start with the word
+.I include
+followed by a path wildcard,
+and will include any files matching that wildcard.
+The wildcard is a path specification in the
+.BR \%glob (7)
+format.
+Files matching that wildcard will be processed
+as if their contents were included in the main config file.
+.P
+Example config file:
+.IP
+.in +4n
+.EX
+/lib
+/usr/lib
+/usr/local/lib
+include /etc/ld.so.conf.d/*.conf
+.EE
+.in
 .SH FILES
 .I /etc/ld.so.conf
 .SH SEE ALSO
man/man8/ldconfig.8 +0 -2
index 9ac146b44..cb7d62ccc 100644
@@ -178,8 +178,6 @@ .SH OPTIONS
 is also specified,
 the cache is still rebuilt.
 .SH FILES
-.\" FIXME Since glibc-2.3.4, "include" directives are supported in ld.so.conf
-.\"
 .\" FIXME Since glibc-2.4, "hwcap" directives are supported in ld.so.conf
 .PD 0
 .TP
Signature · 1 line
2.47.3
#6 lore raw

Re: [PATCH v2 1/4] man/man5/ld.so.conf.5: document include syntax

Hi DJ,

Quoted 1 line

In-Reply-To: <ad382eef274a64bfa0724a31f09846948a84142b.1784084289.git.dj@redhat.com>

I suggest using the following git-config(1) configuration for git-format-patch(1), so that patches are in reply to the cover letter, instead of in reply to the preceding patch.

[format]
thread = true

Alternatively, --thread=shallow in the command line will have the same effects.

Quoted 10 lines · DJ Delorie
---
 man/man5/ld.so.conf.5 | 28 ++++++++++++++++++++++++++++
 man/man8/ldconfig.8   |  2 --
 2 files changed, 28 insertions(+), 2 deletions(-)
man/man5/ld.so.conf.5 +0 -0
index 481cf9152..25f9adf90 100644

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 14

Quoted 6 lines
man/man5/ld.so.conf.5 +3 -0
@@ -9,6 +9,34 @@ .SH DESCRIPTION
 This file contains a list of directories,
 one per line,
 in which to search for libraries.
+.P
+The file
+(and any other files included by it)

Since the contents are specified as being processed as if being included in the main configuration file, this is already implied. I'd remove the parenthetical.

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 16

Quoted 2 lines
man/man5/ld.so.conf.5 +2 -0
+is parsed by
+.B \%ldconfig
	.B \%ldconfig (8)

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 20

Quoted 4 lines
man/man5/ld.so.conf.5 +4 -0
+and the results stored in
+.IR /etc/ld.so.cache .
+.P
+The syntax allows lines to start with the word

s/word/keyword/

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 22

Quoted 2 lines
man/man5/ld.so.conf.5 +2 -0
+.I include
+followed by a path wildcard,
	followed by a
	.BR glob (7)
	pattern,

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 23

Quoted 1 line
man/man5/ld.so.conf.5 +1 -0
+and will include any files matching that wildcard.

I'd remove this line entirely. It's redundant with the text below.

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 26

Quoted 3 lines
man/man5/ld.so.conf.5 +3 -0
+The wildcard is a path specification in the
+.BR \%glob (7)
+format.

Also remove this sentence. By saying 'a glob(7) pattern' above, this is already specified.

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 27

Quoted 1 line
man/man5/ld.so.conf.5 +1 -0
+Files matching that wildcard will be processed

s/wildcard/pattern/

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 28

Quoted 1 line
man/man5/ld.so.conf.5 +1 -0
+as if their contents were included in the main config file.

I have concerns about talking about the *main* file. I'd say they are processed as if their contents were included at the point of the include directive. (I suspect nested includes are allowed, right?)

man/man5/ld.so.conf.5 .SH DESCRIPTION · line 39

Quoted 11 lines
man/man5/ld.so.conf.5 +11 -0
+.P
+Example config file:
+.IP
+.in +4n
+.EX
+/lib
+/usr/lib
+/usr/local/lib
+include /etc/ld.so.conf.d/*.conf
+.EE
+.in

This should be moved to EXAMPLES, right after FILES.

	.SH EXAMPLES
	Example config file:
	.P
	.in +4n
	.EX
	/lib
	/usr/lib
	/usr/local/lib
	include /etc/ld.so.conf.d/*.conf
	.EE
	.in

Have a lovely day!
Alex

Quoted 20 lines
man/man5/ld.so.conf.5 +0 -0
 .SH FILES
 .I /etc/ld.so.conf
 .SH SEE ALSO
man/man8/ldconfig.8 +0 -2
index 9ac146b44..cb7d62ccc 100644
@@ -178,8 +178,6 @@ .SH OPTIONS
 is also specified,
 the cache is still rebuilt.
 .SH FILES
-.\" FIXME Since glibc-2.3.4, "include" directives are supported in ld.so.conf
-.\"
 .\" FIXME Since glibc-2.4, "hwcap" directives are supported in ld.so.conf
 .PD 0
 .TP
Signature · 1 line
2.47.3
Signature · 1 line
<https://www.alejandro-colomar.es>
#5 lore raw

Re: [PATCH v2 2/4] man/man5/tunables.conf: Document system-wide tunables config

In reply to DJ Delorie

Hi DJ,

Quoted 13 lines · DJ Delorie
---
 man/man5/tunables.conf.5 | 116 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 116 insertions(+)
 create mode 100644 man/man5/tunables.conf.5
man/man5/tunables.conf.5 new file +2 -0
new file mode 100644
index 000000000..e2b31e351
@@ -0,0 +1,116 @@
+.TH tunables.conf 5 (date) "Linux man-pages (unreleased)"
+.SH NAME

man/man5/tunables.conf.5 line 12

Quoted 10 lines
man/man5/tunables.conf.5 new file +10 -0
+tunables.conf \- tunables configuration file
+.SH SYNOPSIS
+.nf
+.B /etc/tunables.conf
+.fi
+.SH DESCRIPTION
+Each line in the file
+.I /etc/tunables.conf
+specifies a tunable,
+which is a name and value separated by an equals sign.

I suspect a tunable _is_ _not_ a name=value. That's _how_ you specify a tunable, which is a different thing.

In fact, I think we'd have to document what a tunable actually is. From the glibc manual, I see:

Tunables are a feature in the GNU C Library that allows application authors and distribution maintainers to alter the runtime library behavior to match their workload. [...]

This seems more like a description of what a tunable is.
I'd put such a short description in the first paragraph, and move the specification of how a tunable is specified in /etc/tunables.conf to the second paragraph.

man/man5/tunables.conf.5 line 14

Quoted 2 lines
man/man5/tunables.conf.5 new file +2 -0
+.P
+For a list of valid tunables,

Maybe s/valid/supported/?

man/man5/tunables.conf.5 line 15

Quoted 1 line
man/man5/tunables.conf.5 new file +1 -0
+please consult the glibc manual.

s/please//

Also, a link to the specific point in the glibc manual would help:

	consult the
	.UR https://sourceware.org/glibc/manual/latest/html_node/Tunables.html
	glibc manual
	.UE .

However, I see that link documents the list of supported tunables by saying you should run ld.so --list-tunables, so maybe we should document that directly? It shouldn't take much space.

Also, I see --list-tunables is already documented in ld.so(8), so we only need to refer to that page.

	For a list of the supported tunables,
	see
	.B \-\-list\-tunables
	in
	.BR ld.so (8).
Quoted 8 lines
man/man5/tunables.conf.5 new file +8 -0
+.P
+The syntax allows lines to start with the word
+.I include
+followed by a path wildcard,
+and will include any files matching that wildcard.
+The wildcard is a path specification in the
+.BR \%glob (7)
+format.

man/man5/tunables.conf.5 line 33

Quoted 10 lines
man/man5/tunables.conf.5 new file +10 -0
+Files matching that wildcard will be processed
+as if their contents were included in the main config file.
+.P
+The file is parsed by
+.BR \%ldconfig (8)
+and the results stored in
+.IR /etc/ld.so.cache .
+The resulting data is read when a new process starts.
+.P
+Each line may include zero or more words or symbols at the beginning,

s/words/keywords/

Also, do symbols allow/require whitespace after them?

Quoted 50 lines
man/man5/tunables.conf.5 new file +50 -0
+which affect how each tunable affects each processes:
+.TP
+.B overridable
+.TQ
+.B +
+Allow the tunable to be overridden by the
+.B GLIBC_TUNABLES
+environment variable when the process runs
+(this is the default).
+.TP
+.B nonoverridable
+.TQ
+.B \-
+Do not allow the tunable to be overridden by the environment variable.
+.TP
+.B onlysecure
+.TQ
+.B @
+The tunable only applies to
+.B AT_SECURE
+processes,
+such as a set-user-ID process,
+or one with elevated capabilities.
+.TP
+.B nonsecure
+.TQ
+.B $
+The tunable only applies to
+.RB non- AT_SECURE
+processes (this is the default).
+.TP
+.B anysecure
+.TQ
+.B *
+The tunable only applies to both
+.B AT_SECURE
+and
+.RB non- AT_SECURE
+processes.
+.P
+The file may also contain
+.IR filters ,
+which limit the tunables following it,
+up to the end of the file
+(or end of the included file,
+or start of a new included file)
+or a line with only
+.B []
+on it.
+The syntax is:

man/man5/tunables.conf.5 line 93

Quoted 10 lines
man/man5/tunables.conf.5 new file +10 -0
+.IP
+.in +4n
+.EX
+.RI [ filter : pattern ]
+.EE
+.in
+.TP
+.B proc
+The
+.I proc

s/I/B/

(This and many other issues were reported in the previous patch set;
please revise that.)

Have a lovely day!
Alex

Quoted 27 lines
man/man5/tunables.conf.5 new file +23 -0
+filter limits the following tunables to processes
+whose name matches the pattern.
+The pattern may be an absolute path
+or just the base name.
+.P
+Example config file:
+.IP
+.in +4n
+.EX
+glibc.malloc.arenas_max=5
+onlysecure glibc.malloc.arenas_max=1
+\-glibc.pthread.rseq=1
+[proc:/bin/bad.program]
+\-glibc.pthread.rseq=0
+[proc:some.program]
+\-glibc.malloc.mmap_threshold=65536
+.EE
+.in
+.SH FILES
+.I /etc/ld.so.conf
+.SH SEE ALSO
+.BR ld.so (8),
+.BR ldconfig (8)
Signature · 1 line
2.47.3
Signature · 1 line
<https://www.alejandro-colomar.es>
#7 lore raw

Re: [PATCH v2 1/4] man/man5/ld.so.conf.5: document include syntax

In reply to Alejandro Colomar

Hi Alex,

Quoted 4 lines · Alejandro Colomar
Quoted 2 lines

+is parsed by
+.B \%ldconfig

	.B \%ldconfig (8)
	.BR \%ldconfig (8)

;-)

Regards,
Branden

#8 lore raw

Re: [PATCH v2 1/4] man/man5/ld.so.conf.5: document include syntax

Quoted 11 lines · G. Branden Robinson

Hi Alex,

Quoted 4 lines · Alejandro Colomar
Quoted 2 lines

+is parsed by
+.B \%ldconfig

	.B \%ldconfig (8)
	.BR \%ldconfig (8)

;-)

Oops! yup. :-)

Quoted 3 lines

Regards,
Branden

Signature · 1 line
<https://www.alejandro-colomar.es>