]> git.ipfire.org Git - thirdparty/util-linux.git/blame - schedutils/chrt.1.adoc
Merge branch 'logger-wrong-typo' of https://github.com/chentooerl/util-linux
[thirdparty/util-linux.git] / schedutils / chrt.1.adoc
CommitLineData
295b3979 1//po4a: entry man manual
e2db4d94
MB
2////
3chrt(1) manpage
4
5Copyright (C) 2004 Robert Love
6Copyright (C) 2015 Karel Zak <kzak@redhat.com>
7
8This is free documentation; you can redistribute it and/or
9modify it under the terms of the GNU General Public License,
10version 2, as published by the Free Software Foundation.
11
12The GNU General Public License's references to "object code"
13and "executables" are to be interpreted as the output of any
14document formatting or typesetting system, including
15intermediate and printed output.
16
17This manual is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License along
23with this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25////
26= chrt(1)
27:doctype: manpage
f42ed819 28:man manual: User Commands
e2db4d94
MB
29:man source: util-linux {release-version}
30:page-layout: base
31:command: chrt
5a52459e 32:colon: :
e2db4d94
MB
33
34== NAME
35
36chrt - manipulate the real-time attributes of a process
37
38== SYNOPSIS
39
4d297435 40*chrt* [options] _priority command argument_ ...
e2db4d94 41
4d297435 42*chrt* [options] *-p* [_priority_] _PID_
e2db4d94
MB
43
44== DESCRIPTION
45
46*chrt* sets or retrieves the real-time scheduling attributes of an existing _PID_, or runs _command_ with the given attributes.
47
48== POLICIES
49
50*-o*, *--other*::
5a52459e 51Set scheduling policy to *SCHED_OTHER* (time-sharing scheduling). This is the default Linux scheduling policy.
e2db4d94
MB
52
53*-f*, *--fifo*::
5a52459e 54Set scheduling policy to *SCHED_FIFO* (first in-first out).
e2db4d94
MB
55
56*-r*, *--rr*::
5a52459e 57Set scheduling policy to *SCHED_RR* (round-robin scheduling). When no policy is defined, the *SCHED_RR* is used as the default.
e2db4d94
MB
58
59*-b*, *--batch*::
5a52459e 60Set scheduling policy to *SCHED_BATCH* (scheduling batch processes). Linux-specific, supported since 2.6.16. The priority argument has to be set to zero.
e2db4d94
MB
61
62*-i*, *--idle*::
5a52459e 63Set scheduling policy to *SCHED_IDLE* (scheduling very low priority jobs). Linux-specific, supported since 2.6.23. The priority argument has to be set to zero.
e2db4d94
MB
64
65*-d*, *--deadline*::
5a52459e 66Set scheduling policy to *SCHED_DEADLINE* (sporadic task model deadline scheduling). Linux-specific, supported since 3.14. The priority argument has to be set to zero. See also *--sched-runtime*, *--sched-deadline* and *--sched-period*. The relation between the options required by the kernel is runtime <= deadline <= period. *chrt* copies _period_ to _deadline_ if *--sched-deadline* is not specified and _deadline_ to _runtime_ if *--sched-runtime* is not specified. It means that at least *--sched-period* has to be specified. See *sched*(7) for more details.
e2db4d94 67
e2db4d94
MB
68== SCHEDULING OPTIONS
69
70*-T*, *--sched-runtime* _nanoseconds_::
5a52459e 71Specifies runtime parameter for *SCHED_DEADLINE* policy (Linux-specific).
e2db4d94
MB
72
73*-P*, *--sched-period* _nanoseconds_::
989f8ea2 74Specifies period parameter for *SCHED_DEADLINE* policy (Linux-specific). Note that the kernel's lower limit is 100 milliseconds.
e2db4d94
MB
75
76*-D*, *--sched-deadline* _nanoseconds_::
5a52459e 77Specifies deadline parameter for *SCHED_DEADLINE* policy (Linux-specific).
e2db4d94
MB
78
79*-R*, *--reset-on-fork*::
5a52459e 80Use *SCHED_RESET_ON_FORK* or *SCHED_FLAG_RESET_ON_FORK* flag. Linux-specific, supported since 2.6.31.
fa41dcf0 81+
e2db4d94 82Each thread has a _reset-on-fork_ scheduling flag. When this flag is set, children created by *fork*(2) do not inherit privileged scheduling policies. After the _reset-on-fork_ flag has been enabled, it can be reset only if the thread has the *CAP_SYS_NICE* capability. This flag is disabled in child processes created by *fork*(2).
fa41dcf0 83+
e2db4d94 84More precisely, if the _reset-on-fork_ flag is set, the following rules apply for subsequently created children:
fa41dcf0 85+
5a52459e 86* If the calling thread has a scheduling policy of *SCHED_FIFO* or *SCHED_RR*, the policy is reset to *SCHED_OTHER* in child processes.
fa41dcf0 87+
5a52459e 88* If the calling process has a negative nice value, the nice value is reset to zero in child processes.
e2db4d94
MB
89
90== OPTIONS
91
92*-a*, *--all-tasks*::
5a52459e 93Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID.
e2db4d94
MB
94
95*-m*, *--max*::
5a52459e 96Show minimum and maximum valid priorities, then exit.
e2db4d94
MB
97
98*-p*, *--pid*::
5a52459e 99Operate on an existing PID and do not launch a new task.
e2db4d94
MB
100
101*-v*, *--verbose*::
5a52459e 102Show status information.
e2db4d94 103
2b2d3172 104include::man-common/help-version.adoc[]
e2db4d94 105
84b6b6ac 106== EXAMPLES
e2db4d94 107
5a52459e
MB
108//TRANSLATORS: Keep {colon} untranslated
109The default behavior is to run a new command{colon}::
fa41dcf0 110____
e2db4d94 111*chrt* _priority_ _command_ [_arguments_]
fa41dcf0 112____
5a52459e
MB
113//TRANSLATORS: Keep {colon} untranslated
114You can also retrieve the real-time attributes of an existing task{colon}::
fa41dcf0 115____
e2db4d94 116*chrt -p* _PID_
fa41dcf0 117____
5a52459e
MB
118//TRANSLATORS: Keep {colon} untranslated
119Or set them{colon}::
fa41dcf0 120____
e2db4d94 121*chrt -r -p* _priority PID_
fa41dcf0
KZ
122____
123This, for example, sets real-time scheduling to priority _30_ for the process _PID_ with the *SCHED_RR* (round-robin) class{colon}::
124____
125*chrt -r -p 30* _PID_
126____
127Reset priorities to default for a process{colon}::
128____
129*chrt -o -p 0* _PID_
130____
131See *sched*(7) for a detailed discussion of the different scheduler classes and how they interact.
84b6b6ac 132
e2db4d94
MB
133== PERMISSIONS
134
135A user must possess *CAP_SYS_NICE* to change the scheduling attributes of a process. Any user can retrieve the scheduling information.
136
137== NOTES
138
139Only *SCHED_FIFO*, *SCHED_OTHER* and *SCHED_RR* are part of POSIX 1003.1b Process Scheduling. The other scheduling attributes may be ignored on some systems.
140
141Linux' default scheduling policy is *SCHED_OTHER*.
142
143== AUTHORS
144
5a52459e 145mailto:rml@tech9.net[Robert Love],
4d297435 146mailto:kzak@redhat.com[Karel Zak]
e2db4d94 147
e2db4d94
MB
148== SEE ALSO
149
150*nice*(1),
151*renice*(1),
152*taskset*(1),
153*sched*(7)
154
155See *sched_setscheduler*(2) for a description of the Linux scheduling scheme.
156
625e9c61 157include::man-common/bugreports.adoc[]
e2db4d94 158
625e9c61 159include::man-common/footer.adoc[]
e2db4d94
MB
160
161ifdef::translation[]
625e9c61 162include::man-common/translation.adoc[]
e2db4d94 163endif::[]