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