|author||Florian Schmaus <email@example.com>||2021-03-21 12:07:38 +0100|
|committer||Zac Medico <firstname.lastname@example.org>||2021-06-13 14:45:32 -0700|
|parent||Use an explicit empty dir for pkg_* phases [WIP] (diff)|
PORTAGE_NICENESS: 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 emerge to set the autogroup's nice value, instead of the processes' nice value, in case autogroups are present (detected by the existence of /proc/self/autogroup). The tricky part about autogroup nice values is that we want restore the orignal nice value once we are finished. As otherwise, the session, e.g. your terminal, would continue using this value, and so would subsequently executed processes. For that we use Python's atexit functinaly, to register a function that will restore the orignal nice value of the autogroup. Bug: https://bugs.gentoo.org/777492 Signed-off-by: Florian Schmaus <email@example.com> Signed-off-by: Zac Medico <firstname.lastname@example.org>
Diffstat (limited to 'man')
1 files changed, 9 insertions, 1 deletions
diff --git a/man/make.conf.5 b/man/make.conf.5
index 1c72109ad..18573b5e2 100644
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "May 2021" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Jun 2021" "Portage VERSION" "Portage"
make.conf \- custom settings for Portage
@@ -1031,6 +1031,14 @@ The value of this variable will be added to the current nice level that
emerge is running at. In other words, this will not set the nice level,
it will increment it. For more information about nice levels and what
are acceptable ranges, see \fBnice\fR(1).
+If set and portage is run under Linux with autogroup scheduling (see
+\fBsched\fR(7)) enabled, then portage will set the nice value of its
+autogroup to PORTAGE_NICENESS. Upon exiting, portage will restore the
+original value. Note that if the function responsible for restoring the
+original value is not run, e.g., because portage's process was killed,
+then the autogroup will stay niced. In such a case, the value can be
+reset via corresponding autogroup pseudo\-file in /proc.
\fBPORTAGE_RO_DISTDIRS\fR = \fI[space delimited list of directories]\fR
When a given file does not exist in \fBDISTDIR\fR, search for the file