aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKARBOWSKI Piotr <slashbeast@gentoo.org>2023-01-14 21:13:40 +0100
committerMike Gilbert <floppym@gentoo.org>2023-01-14 16:02:21 -0500
commit7dfa05c4446d1d2290d4ba61520a8f6ee9e57332 (patch)
treed7b42b025cd4c547874cb3b113c46c8a83cf9f74
parentman/portage.5: document portage skips files that begin with '.' or end '~' (diff)
downloadportage-7dfa05c4.tar.gz
portage-7dfa05c4.tar.bz2
portage-7dfa05c4.zip
SCHEDULING_POLICY: switch to scheduler policy IDs rather than aliases.
The os.SCHED_* aliases are not reliable enough, the mainline Python lacks deadline, and the pypy lacks them all together. The IDs are not going to change, at most new would arrive, so it is safe to use it as is. By extension, the deadline policy was also added, since those originally were not present in aliases. Bug: https://bugs.gentoo.org/867031 Closes: https://github.com/gentoo/portage/pull/976 Signed-off-by: KARBOWSKI Piotr <slashbeast@gentoo.org> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r--cnf/make.conf.example12
-rw-r--r--lib/_emerge/actions.py12
-rw-r--r--man/make.conf.516
3 files changed, 21 insertions, 19 deletions
diff --git a/cnf/make.conf.example b/cnf/make.conf.example
index 2e33a6e50..4375665f4 100644
--- a/cnf/make.conf.example
+++ b/cnf/make.conf.example
@@ -292,12 +292,12 @@
#PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
#
# PORTAGE_SCHEDULING_POLICY allows changing the current scheduling policy. The
-# supported options are 'other', 'batch', 'idle', 'fifo' and 'round-robin'. When
-# unset, the scheduling policy remains unchanged, by default Linux uses 'other'
-# policy. Users that wish to minimize the Portage's impact on system
-# responsiveness should set scheduling policy to 'idle' which significantly
-# reduces the disruption to the rest of the system by scheduling Portage as
-# extremely low priority processes.
+# supported options are 'other', 'batch', 'idle', 'fifo', 'round-robin' and
+# 'deadline'. When unset, the scheduling policy remains unchanged, by default
+# Linux uses 'other' policy. Users that wish to minimize the Portage's impact
+# on system responsiveness should set scheduling policy to 'idle' which
+# significantly reduces the disruption to the rest of the system by scheduling
+# Portage as extremely low priority processes.
#
#PORTAGE_SCHEDULING_POLICY="idle"
#
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index 874c0312c..d8fd99d88 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -3117,12 +3117,14 @@ def set_scheduling_policy(settings):
if platform.system() != "Linux" or not scheduling_policy:
return os.EX_OK
+ # IDs sourced from linux/sched.h kernel's header.
policies = {
- "other": os.SCHED_OTHER,
- "batch": os.SCHED_BATCH,
- "idle": os.SCHED_IDLE,
- "fifo": os.SCHED_FIFO,
- "round-robin": os.SCHED_RR,
+ "other": 0,
+ "fifo": 1,
+ "round-robin": 2,
+ "batch": 3,
+ "idle": 5,
+ "deadline": 6,
}
out = portage.output.EOutput()
diff --git a/man/make.conf.5 b/man/make.conf.5
index ad8ece43f..34c3cd5b5 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1101,14 +1101,14 @@ will set idle io priority. For more information about ionice, see
Portage will also set the autogroup-nice value (see fBsched\fR(7))), if
FEATURES="pid\-sandbox" is enabled.
.TP
-\fBPORTAGE_SCHEDULING_POLICY\fR = \fI[policy name]\fR
-Allows changing the current scheduling policy. The supported options are
-\fBother\fR, \fBbatch\fR, \fBidle\fR, \fBfifo\fR, and \fBround-robin\fR. When
-unset, the scheduling policy remains unchanged, by default Linux uses 'other'
-policy. Users that wish to minimize the Portage's impact on system
-responsiveness should set scheduling policy to \fBidle\fR, which significantly
-reduces the disruption to the rest of the system by scheduling Portage as
-extremely low priority processes. see \fBsched\fR(7) for more information.
+\fBPORTAGE_SCHEDULING_POLICY\fR = \fI[policy name]\fR Allows changing the
+current scheduling policy. The supported options are \fBother\fR, \fBbatch\fR,
+\fBidle\fR, \fBfifo\fR, \fBround-robin\fR and \fBdeadline\fR. When unset, the
+scheduling policy remains unchanged, by default Linux uses 'other' policy.
+Users that wish to minimize the Portage's impact on system responsiveness
+should set scheduling policy to \fBidle\fR, which significantly reduces the
+disruption to the rest of the system by scheduling Portage as extremely low
+priority processes. see \fBsched\fR(7) for more information.
.TP
\fBPORTAGE_SCHEDULING_PRIORITY\fR = \fI[priority]\fR
Allows changing the priority (1-99) of the current scheduling policy, only