]>
Commit | Line | Data |
---|---|---|
295b3979 | 1 | //po4a: entry man manual |
e2db4d94 MB |
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 | |
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 | ||
36 | chrt - 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 | 51 | Set scheduling policy to *SCHED_OTHER* (time-sharing scheduling). This is the default Linux scheduling policy. |
e2db4d94 MB |
52 | |
53 | *-f*, *--fifo*:: | |
5a52459e | 54 | Set scheduling policy to *SCHED_FIFO* (first in-first out). |
e2db4d94 MB |
55 | |
56 | *-r*, *--rr*:: | |
5a52459e | 57 | Set 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 | 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. |
e2db4d94 MB |
61 | |
62 | *-i*, *--idle*:: | |
5a52459e | 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. |
e2db4d94 MB |
64 | |
65 | *-d*, *--deadline*:: | |
5a52459e | 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. |
e2db4d94 | 67 | |
e2db4d94 MB |
68 | == SCHEDULING OPTIONS |
69 | ||
70 | *-T*, *--sched-runtime* _nanoseconds_:: | |
5a52459e | 71 | Specifies runtime parameter for *SCHED_DEADLINE* policy (Linux-specific). |
e2db4d94 MB |
72 | |
73 | *-P*, *--sched-period* _nanoseconds_:: | |
989f8ea2 | 74 | Specifies 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 | 77 | Specifies deadline parameter for *SCHED_DEADLINE* policy (Linux-specific). |
e2db4d94 MB |
78 | |
79 | *-R*, *--reset-on-fork*:: | |
5a52459e | 80 | Use *SCHED_RESET_ON_FORK* or *SCHED_FLAG_RESET_ON_FORK* flag. Linux-specific, supported since 2.6.31. |
fa41dcf0 | 81 | + |
e2db4d94 | 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). |
fa41dcf0 | 83 | + |
e2db4d94 | 84 | More 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 | 93 | Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID. |
e2db4d94 MB |
94 | |
95 | *-m*, *--max*:: | |
5a52459e | 96 | Show minimum and maximum valid priorities, then exit. |
e2db4d94 MB |
97 | |
98 | *-p*, *--pid*:: | |
5a52459e | 99 | Operate on an existing PID and do not launch a new task. |
e2db4d94 MB |
100 | |
101 | *-v*, *--verbose*:: | |
5a52459e | 102 | Show status information. |
e2db4d94 | 103 | |
2b2d3172 | 104 | include::man-common/help-version.adoc[] |
e2db4d94 | 105 | |
84b6b6ac | 106 | == EXAMPLES |
e2db4d94 | 107 | |
5a52459e MB |
108 | //TRANSLATORS: Keep {colon} untranslated |
109 | The 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 |
114 | You 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 |
119 | Or set them{colon}:: | |
fa41dcf0 | 120 | ____ |
e2db4d94 | 121 | *chrt -r -p* _priority PID_ |
fa41dcf0 KZ |
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. | |
84b6b6ac | 132 | |
e2db4d94 MB |
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 | ||
5a52459e | 145 | mailto:rml@tech9.net[Robert Love], |
4d297435 | 146 | mailto: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 | ||
155 | See *sched_setscheduler*(2) for a description of the Linux scheduling scheme. | |
156 | ||
625e9c61 | 157 | include::man-common/bugreports.adoc[] |
e2db4d94 | 158 | |
625e9c61 | 159 | include::man-common/footer.adoc[] |
e2db4d94 MB |
160 | |
161 | ifdef::translation[] | |
625e9c61 | 162 | include::man-common/translation.adoc[] |
e2db4d94 | 163 | endif::[] |