| 1 |
'\" t |
| 2 |
.\" Title: chrt |
| 3 |
.\" Author: [see the "AUTHOR(S)" section] |
| 4 |
.\" Generator: Asciidoctor 2.0.20 |
| 5 |
.\" Date: 2026-05-18 |
| 6 |
.\" Manual: User Commands |
| 7 |
.\" Source: util-linux 2.42.1 |
| 8 |
.\" Language: English |
| 9 |
.\" |
| 10 |
.TH "CHRT" "1" "2026-05-18" "util\-linux 2.42.1" "User Commands" |
| 11 |
.ie \n(.g .ds Aq \(aq |
| 12 |
.el .ds Aq ' |
| 13 |
.ss \n[.ss] 0 |
| 14 |
.nh |
| 15 |
.ad l |
| 16 |
.de URL |
| 17 |
\fI\\$2\fP <\\$1>\\$3 |
| 18 |
.. |
| 19 |
.als MTO URL |
| 20 |
.if \n[.g] \{\ |
| 21 |
. mso www.tmac |
| 22 |
. am URL |
| 23 |
. ad l |
| 24 |
. . |
| 25 |
. am MTO |
| 26 |
. ad l |
| 27 |
. . |
| 28 |
. LINKSTYLE blue R < > |
| 29 |
.\} |
| 30 |
.SH "NAME" |
| 31 |
chrt \- manipulate the real\-time attributes of a process |
| 32 |
.SH "SYNOPSIS" |
| 33 |
.sp |
| 34 |
\fBchrt\fP [options] [\fIpriority\fP] \fIcommand\fP [\fIargument\fP...] |
| 35 |
.sp |
| 36 |
\fBchrt \-\-pid\fP [options] [\fIpriority\fP] \fIPID\fP |
| 37 |
.SH "DESCRIPTION" |
| 38 |
.sp |
| 39 |
\fBchrt\fP sets or retrieves the real\-time scheduling attributes of an existing \fIPID\fP, or runs \fIcommand\fP with the given attributes. |
| 40 |
.SH "POLICY OPTIONS" |
| 41 |
.sp |
| 42 |
\fB\-o\fP, \fB\-\-other\fP |
| 43 |
.RS 4 |
| 44 |
Set scheduling policy to \fBSCHED_OTHER\fP (time\-sharing scheduling). This is the default Linux scheduling policy. Since util\-linux v2.42, the priority argument is optional; if specified, it must be set to zero. |
| 45 |
.RE |
| 46 |
.sp |
| 47 |
\fB\-f\fP, \fB\-\-fifo\fP |
| 48 |
.RS 4 |
| 49 |
Set scheduling policy to \fBSCHED_FIFO\fP (first in\-first out). |
| 50 |
.RE |
| 51 |
.sp |
| 52 |
\fB\-r\fP, \fB\-\-rr\fP |
| 53 |
.RS 4 |
| 54 |
Set scheduling policy to \fBSCHED_RR\fP (round\-robin scheduling). When no policy is defined, the \fBSCHED_RR\fP is used as the default. |
| 55 |
.RE |
| 56 |
.sp |
| 57 |
\fB\-b\fP, \fB\-\-batch\fP |
| 58 |
.RS 4 |
| 59 |
Set scheduling policy to \fBSCHED_BATCH\fP (scheduling batch processes). Linux\-specific, supported since 2.6.16. Since util\-linux v2.42, the priority argument is optional; if specified, it must be set to zero. |
| 60 |
.RE |
| 61 |
.sp |
| 62 |
\fB\-i\fP, \fB\-\-idle\fP |
| 63 |
.RS 4 |
| 64 |
Set scheduling policy to \fBSCHED_IDLE\fP (scheduling very low priority jobs). Linux\-specific, supported since 2.6.23. Since util\-linux v2.42, the priority argument is optional; if specified, it must be set to zero. |
| 65 |
.RE |
| 66 |
.sp |
| 67 |
\fB\-d\fP, \fB\-\-deadline\fP |
| 68 |
.RS 4 |
| 69 |
Set scheduling policy to \fBSCHED_DEADLINE\fP (sporadic task model deadline scheduling). Linux\-specific, supported since 3.14. Since util\-linux v2.42, the priority argument is optional; if specified, it must be set to zero. See also \fB\-\-sched\-runtime\fP, \fB\-\-sched\-deadline\fP and \fB\-\-sched\-period\fP. The relation between the options required by the kernel is runtime \(lA deadline \(lA period. \fBchrt\fP copies \fIperiod\fP to \fIdeadline\fP if \fB\-\-sched\-deadline\fP is not specified and \fIdeadline\fP to \fIruntime\fP if \fB\-\-sched\-runtime\fP is not specified. It means that at least \fB\-\-sched\-period\fP has to be specified. See \fBsched\fP(7) for more details. |
| 70 |
.RE |
| 71 |
.sp |
| 72 |
\fB\-e\fP, \fB\-\-ext\fP |
| 73 |
.RS 4 |
| 74 |
Set scheduling policy to \fBSCHED_EXT\fP (BPF program\-defined scheduling). Linux\-specific, supported since 6.12. Since util\-linux v2.42, the priority argument is optional; if specified, it must be set to zero. |
| 75 |
Note that for the policy to be recognized, the following kernel configuration options need to be enabled: \fBCONFIG_BPF\fP, \fBCONFIG_SCHED_CLASS_EXT\fP, \fBCONFIG_BPF_SYSCALL\fP, \fBCONFIG_BPF_JIT\fP, \fBCONFIG_DEBUG_INFO_BTF\fP, \fBCONFIG_BPF_JIT_ALWAYS_ON\fP and \fBCONFIG_BPF_JIT_DEFAULT_ON\fP. |
| 76 |
.RE |
| 77 |
.SH "SCHEDULING OPTIONS" |
| 78 |
.sp |
| 79 |
\fB\-T\fP, \fB\-\-sched\-runtime\fP \fInanoseconds\fP |
| 80 |
.RS 4 |
| 81 |
Specifies runtime parameter for \fBSCHED_DEADLINE\fP and custom slice length for \fBSCHED_OTHER\fP and \fBSCHED_BATCH\fP policies (Linux\-specific). Note that custom slice length via the runtime parameter is supported since Linux 6.12. |
| 82 |
.RE |
| 83 |
.sp |
| 84 |
\fB\-P\fP, \fB\-\-sched\-period\fP \fInanoseconds\fP |
| 85 |
.RS 4 |
| 86 |
Specifies period parameter for \fBSCHED_DEADLINE\fP policy (Linux\-specific). Note that the kernel\(cqs lower limit is 100 microseconds. |
| 87 |
.RE |
| 88 |
.sp |
| 89 |
\fB\-D\fP, \fB\-\-sched\-deadline\fP \fInanoseconds\fP |
| 90 |
.RS 4 |
| 91 |
Specifies deadline parameter for \fBSCHED_DEADLINE\fP policy (Linux\-specific). |
| 92 |
.RE |
| 93 |
.sp |
| 94 |
\fB\-R\fP, \fB\-\-reset\-on\-fork\fP |
| 95 |
.RS 4 |
| 96 |
Use \fBSCHED_RESET_ON_FORK\fP or \fBSCHED_FLAG_RESET_ON_FORK\fP flag. Linux\-specific, supported since 2.6.31. |
| 97 |
.sp |
| 98 |
Each thread has a \fIreset\-on\-fork\fP scheduling flag. When this flag is set, children created by \fBfork\fP(2) do not inherit privileged scheduling policies. After the \fIreset\-on\-fork\fP flag has been enabled, it can be reset only if the thread has the \fBCAP_SYS_NICE\fP capability. This flag is disabled in child processes created by \fBfork\fP(2). |
| 99 |
.sp |
| 100 |
More precisely, if the \fIreset\-on\-fork\fP flag is set, the following rules apply for subsequently created children: |
| 101 |
.sp |
| 102 |
.RS 4 |
| 103 |
.ie n \{\ |
| 104 |
\h'-04'\(bu\h'+03'\c |
| 105 |
.\} |
| 106 |
.el \{\ |
| 107 |
. sp -1 |
| 108 |
. IP \(bu 2.3 |
| 109 |
.\} |
| 110 |
If the calling thread has a scheduling policy of \fBSCHED_FIFO\fP or \fBSCHED_RR\fP, the policy is reset to \fBSCHED_OTHER\fP in child processes. |
| 111 |
.RE |
| 112 |
.sp |
| 113 |
.RS 4 |
| 114 |
.ie n \{\ |
| 115 |
\h'-04'\(bu\h'+03'\c |
| 116 |
.\} |
| 117 |
.el \{\ |
| 118 |
. sp -1 |
| 119 |
. IP \(bu 2.3 |
| 120 |
.\} |
| 121 |
If the calling process has a negative nice value, the nice value is reset to zero in child processes. |
| 122 |
.RE |
| 123 |
.RE |
| 124 |
.SH "OPTIONS" |
| 125 |
.sp |
| 126 |
\fB\-a\fP, \fB\-\-all\-tasks\fP |
| 127 |
.RS 4 |
| 128 |
Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID. |
| 129 |
.RE |
| 130 |
.sp |
| 131 |
\fB\-m\fP, \fB\-\-max\fP |
| 132 |
.RS 4 |
| 133 |
Show minimum and maximum valid priorities, then exit. |
| 134 |
.RE |
| 135 |
.sp |
| 136 |
\fB\-p\fP, \fB\-\-pid\fP |
| 137 |
.RS 4 |
| 138 |
Operate on an existing PID and do not launch a new task. |
| 139 |
.RE |
| 140 |
.sp |
| 141 |
\fB\-v\fP, \fB\-\-verbose\fP |
| 142 |
.RS 4 |
| 143 |
Show status information. |
| 144 |
.RE |
| 145 |
.sp |
| 146 |
\fB\-h\fP, \fB\-\-help\fP |
| 147 |
.RS 4 |
| 148 |
Display help text and exit. |
| 149 |
.RE |
| 150 |
.sp |
| 151 |
\fB\-V\fP, \fB\-\-version\fP |
| 152 |
.RS 4 |
| 153 |
Display version and exit. |
| 154 |
.RE |
| 155 |
.SH "EXAMPLES" |
| 156 |
.sp |
| 157 |
The default behavior is to run a new command: |
| 158 |
.RS 4 |
| 159 |
.RE |
| 160 |
.RS 3 |
| 161 |
.ll -.6i |
| 162 |
.sp |
| 163 |
\fBchrt\fP \fIpriority\fP \fIcommand\fP [\fIarguments\fP] |
| 164 |
.br |
| 165 |
.RE |
| 166 |
.ll |
| 167 |
.sp |
| 168 |
You can also retrieve the real\-time attributes of an existing task: |
| 169 |
.RS 4 |
| 170 |
.RE |
| 171 |
.RS 3 |
| 172 |
.ll -.6i |
| 173 |
.sp |
| 174 |
\fBchrt \-\-pid\fP \fIPID\fP |
| 175 |
.br |
| 176 |
.RE |
| 177 |
.ll |
| 178 |
.sp |
| 179 |
Or set them: |
| 180 |
.RS 4 |
| 181 |
.RE |
| 182 |
.RS 3 |
| 183 |
.ll -.6i |
| 184 |
.sp |
| 185 |
\fBchrt \-\-pid\fP \fIpolicy\-option priority PID\fP |
| 186 |
.br |
| 187 |
.RE |
| 188 |
.ll |
| 189 |
.sp |
| 190 |
For example, to set the scheduling policy to \fBSCHED_RR\fP (round\-robin) and the priority to \fB30\fP for process \fB1234\fP: |
| 191 |
.RS 4 |
| 192 |
.RE |
| 193 |
.RS 3 |
| 194 |
.ll -.6i |
| 195 |
.sp |
| 196 |
\fBchrt \-\-pid \-r 30 1234\fP |
| 197 |
.br |
| 198 |
.RE |
| 199 |
.ll |
| 200 |
.sp |
| 201 |
Reset priorities to default for a process: |
| 202 |
.RS 4 |
| 203 |
.RE |
| 204 |
.RS 3 |
| 205 |
.ll -.6i |
| 206 |
.sp |
| 207 |
\fBchrt \-\-pid \-o 0\fP \fIPID\fP |
| 208 |
.br |
| 209 |
.RE |
| 210 |
.ll |
| 211 |
.sp |
| 212 |
Set a custom slice of 1 ms for a \fBSCHED_OTHER\fP task (priority is optional for policies other than \fBSCHED_FIFO\fP and \fBSCHED_RR\fP): |
| 213 |
.RS 4 |
| 214 |
.RE |
| 215 |
.RS 3 |
| 216 |
.ll -.6i |
| 217 |
.sp |
| 218 |
\fBchrt \-\-pid \-o \-T 1000000\fP \fIPID\fP |
| 219 |
.br |
| 220 |
.RE |
| 221 |
.ll |
| 222 |
.sp |
| 223 |
See \fBsched\fP(7) for a detailed discussion of the different scheduler classes and how they interact. |
| 224 |
.SH "PERMISSIONS" |
| 225 |
.sp |
| 226 |
A user must possess \fBCAP_SYS_NICE\fP to change the scheduling attributes of a process. Any user can retrieve the scheduling information. |
| 227 |
.SH "NOTES" |
| 228 |
.sp |
| 229 |
Only \fBSCHED_FIFO\fP, \fBSCHED_OTHER\fP and \fBSCHED_RR\fP are part of POSIX 1003.1b Process Scheduling. The other scheduling attributes may be ignored on some systems. |
| 230 |
.sp |
| 231 |
Linux\*(Aq default scheduling policy is \fBSCHED_OTHER\fP. |
| 232 |
.SH "AUTHORS" |
| 233 |
.sp |
| 234 |
.MTO "rml\(attech9.net" "Robert Love" "," |
| 235 |
.MTO "kzak\(atredhat.com" "Karel Zak" "" |
| 236 |
.SH "SEE ALSO" |
| 237 |
.sp |
| 238 |
\fBnice\fP(1), |
| 239 |
\fBrenice\fP(1), |
| 240 |
\fBtaskset\fP(1), |
| 241 |
\fBsched\fP(7) |
| 242 |
.sp |
| 243 |
See \fBsched_setscheduler\fP(2) for a description of the Linux scheduling scheme. |
| 244 |
.SH "REPORTING BUGS" |
| 245 |
.sp |
| 246 |
For bug reports, use the \c |
| 247 |
.URL "https://github.com/util\-linux/util\-linux/issues" "issue tracker" "." |
| 248 |
.SH "AVAILABILITY" |
| 249 |
.sp |
| 250 |
The \fBchrt\fP command is part of the util\-linux package which can be downloaded from \c |
| 251 |
.URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "." |