diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2012-11-01 18:48:11 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2012-11-15 16:16:45 +0100 |
commit | bb11271068ff34434f5b8cefd0c2c0bae5ed7fd1 (patch) | |
tree | 56195078c0c89146b7bf442d4569fe305ebc498f /man | |
parent | 71c015969233c21ea38b1e63993d02fe171df672 (diff) |
sched: Only setting CPUSchedulingPriority=rr doesn't work
A service that only sets the scheduling policy to round-robin
fails to be started. This is because the cpu_sched_priority is
initialized to 0 and is not adjusted when the policy is changed.
Clamp the cpu_sched_priority when the scheduler policy is set. Use
the current policy to validate the new priority.
Change the manual page to state that the given range only applies
to the real-time scheduling policies.
Add a testcase that verifies this change:
$ make test-sched-prio; ./test-sched-prio
[test/sched_idle_bad.service:6] CPU scheduling priority is out of range, ignoring: 1
[test/sched_rr_bad.service:7] CPU scheduling priority is out of range, ignoring: 0
[test/sched_rr_bad.service:8] CPU scheduling priority is out of range, ignoring: 100
Diffstat (limited to 'man')
-rw-r--r-- | man/systemd.exec.xml | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index 7b6514375d..b684bfbe5c 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -214,13 +214,15 @@ <listitem><para>Sets the CPU scheduling priority for executed - processes. Takes an integer between 1 - (lowest priority) and 99 (highest - priority). The available priority + processes. The available priority range depends on the selected CPU - scheduling policy (see above). See - <citerefentry><refentrytitle>sched_setscheduler</refentrytitle><manvolnum>2</manvolnum></citerefentry> - for details.</para></listitem> + scheduling policy (see above). For + real-time scheduling policies an + integer between 1 (lowest priority) + and 99 (highest priority) can be used. + See <citerefentry><refentrytitle>sched_setscheduler</refentrytitle><manvolnum>2</manvolnum></citerefentry> + for details. + </para></listitem> </varlistentry> <varlistentry> |