3 .\" Author: [see the "AUTHOR(S)" section]
4 .\" Generator: Asciidoctor 2.0.15
6 .\" Manual: User Commands
7 .\" Source: util-linux 2.38
10 .TH "CHRT" "1" "2022-02-17" "util\-linux 2.38" "User Commands"
28 . LINKSTYLE blue R < >
31 chrt \- manipulate the real\-time attributes of a process
34 \fBchrt\fP [options] \fIpriority command argument\fP ...
36 \fBchrt\fP [options] \fB\-p\fP [\fIpriority\fP] \fIPID\fP
39 \fBchrt\fP sets or retrieves the real\-time scheduling attributes of an existing \fIPID\fP, or runs \fIcommand\fP with the given attributes.
42 \fB\-o\fP, \fB\-\-other\fP
44 Set scheduling policy to \fBSCHED_OTHER\fP (time\-sharing scheduling). This is the default Linux scheduling policy.
47 \fB\-f\fP, \fB\-\-fifo\fP
49 Set scheduling policy to \fBSCHED_FIFO\fP (first in\-first out).
52 \fB\-r\fP, \fB\-\-rr\fP
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.
57 \fB\-b\fP, \fB\-\-batch\fP
59 Set scheduling policy to \fBSCHED_BATCH\fP (scheduling batch processes). Linux\-specific, supported since 2.6.16. The priority argument has to be set to zero.
62 \fB\-i\fP, \fB\-\-idle\fP
64 Set scheduling policy to \fBSCHED_IDLE\fP (scheduling very low priority jobs). Linux\-specific, supported since 2.6.23. The priority argument has to be set to zero.
67 \fB\-d\fP, \fB\-\-deadline\fP
69 Set scheduling policy to \fBSCHED_DEADLINE\fP (sporadic task model deadline scheduling). Linux\-specific, supported since 3.14. The priority argument has to 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.
71 .SH "SCHEDULING OPTIONS"
73 \fB\-T\fP, \fB\-\-sched\-runtime\fP \fInanoseconds\fP
75 Specifies runtime parameter for \fBSCHED_DEADLINE\fP policy (Linux\-specific).
78 \fB\-P\fP, \fB\-\-sched\-period\fP \fInanoseconds\fP
80 Specifies period parameter for \fBSCHED_DEADLINE\fP policy (Linux\-specific).
83 \fB\-D\fP, \fB\-\-sched\-deadline\fP \fInanoseconds\fP
85 Specifies deadline parameter for \fBSCHED_DEADLINE\fP policy (Linux\-specific).
88 \fB\-R\fP, \fB\-\-reset\-on\-fork\fP
90 Use \fBSCHED_RESET_ON_FORK\fP or \fBSCHED_FLAG_RESET_ON_FORK\fP flag. Linux\-specific, supported since 2.6.31.
93 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).
95 More precisely, if the \fIreset\-on\-fork\fP flag is set, the following rules apply for subsequently created children:
105 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.
116 If the calling process has a negative nice value, the nice value is reset to zero in child processes.
120 \fB\-a\fP, \fB\-\-all\-tasks\fP
122 Set or retrieve the scheduling attributes of all the tasks (threads) for a given PID.
125 \fB\-m\fP, \fB\-\-max\fP
127 Show minimum and maximum valid priorities, then exit.
130 \fB\-p\fP, \fB\-\-pid\fP
132 Operate on an existing PID and do not launch a new task.
135 \fB\-v\fP, \fB\-\-verbose\fP
137 Show status information.
140 \fB\-h\fP, \fB\-\-help\fP
142 Display help text and exit.
145 \fB\-V\fP, \fB\-\-version\fP
147 Print version and exit.
151 The default behavior is to run a new command:
153 \fBchrt\fP \fIpriority\fP \fIcommand\fP [\fIarguments\fP]
156 You can also retrieve the real\-time attributes of an existing task:
158 \fBchrt \-p\fP \fIPID\fP
163 \fBchrt \-r \-p\fP \fIpriority PID\fP
167 A user must possess \fBCAP_SYS_NICE\fP to change the scheduling attributes of a process. Any user can retrieve the scheduling information.
170 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.
172 Linux\(aq default scheduling policy is \fBSCHED_OTHER\fP.
175 .MTO "rml\(attech9.net" "Robert Love" ","
176 .MTO "kzak\(atredhat.com" "Karel Zak" ""
184 See \fBsched_setscheduler\fP(2) for a description of the Linux scheduling scheme.
187 For bug reports, use the issue tracker at \c
188 .URL "https://github.com/util\-linux/util\-linux/issues" "" "."
191 The \fBchrt\fP command is part of the util\-linux package which can be downloaded from \c
192 .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."