aboutsummaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2021-06-29 10:54:19 +0200
committerMichał Górny <mgorny@gentoo.org>2021-08-18 18:52:30 +0200
commit875c8dbcc6e9c98d289ec1869c61fbcc4da5864c (patch)
treef39c533f7c6902a894429f2d65428dd72fe412cf /man
parentPrepare for 3.0.22 release (diff)
downloadportage-875c8dbcc6e9c98d289ec1869c61fbcc4da5864c.tar.gz
portage-875c8dbcc6e9c98d289ec1869c61fbcc4da5864c.tar.bz2
portage-875c8dbcc6e9c98d289ec1869c61fbcc4da5864c.zip
pid-ns-init: Consider autogroup scheduling
With Linux's autogroup scheduling feature (CONFIG_SCHED_AUTOGROUP) setting a nice value on a per-process base has only an effect for scheduling decisions relative to the other threads in the same session (typically: the same terminal window). See the section "The nice value and group scheduling" in the sched(7) man page. Basically this means that portage "just" setting the nice value, has no effect in presence of autogroup scheduling being active (which is probably true for most (desktop) user systems). This commit changes pid-ns-init to set the autogroup's nice value in case autogroups are present (detected by the existence of /proc/self/autogroup). My initial attempt to consider autogroup scheduling revolved around nice() in actions.py setting the autogroup nice value and restoring the original value with an atexit handler. See 055abe523c2c ("PORTAGE_NICENESS: Consider autogroup scheduling"). However this is fragile if the performing process is unprivileged (think of a user calling "ebuild foo-1.0.0.ebuild manifest") as Linux employs a rate limiting to autogroup changes by unprivileged processes [1]. Eventually this means portage can only reliable set the autogroup value within the pid-ns-init helper, where a new session is created. We only set the autogroup value within the new session, which relieves portage from restoring the original value, as the autogroup will cease to exist once the session exists, i.e. with the termination of the pid-ns-init helper. Note that the pid-ns-init helper is an optional portage feature 'pid-sandbox'. Only if this is enabled, portage will set the autogroup's nice value. 1: https://github.com/torvalds/linux/blob/fd0aa1a4567d0f09e1bfe367a950b004f99ac290/kernel/sched/autogroup.c#L226-L227 Bug: https://bugs.gentoo.org/777492 Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/728 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'man')
-rw-r--r--man/make.conf.55
1 files changed, 4 insertions, 1 deletions
diff --git a/man/make.conf.5 b/man/make.conf.5
index db742fdb5..0790933f7 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "May 2021" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Jun 2021" "Portage VERSION" "Portage"
.SH "NAME"
make.conf \- custom settings for Portage
.SH "SYNOPSIS"
@@ -993,6 +993,9 @@ string should contain a \\${PID} place-holder that will be substituted
with an integer pid. For example, a value of "ionice \-c 3 \-p \\${PID}"
will set idle io priority. For more information about ionice, see
\fBionice\fR(1). This variable is unset by default.
+.br
+Portage will also set the autogroup-nice value (see fBsched\fR(7))), if
+FEATURES="pid\-sandbox" is enabled.
.TP
.B PORTAGE_LOG_FILTER_FILE_CMD
This variable specifies a command that filters build log output to a