]> git.ipfire.org Git - thirdparty/util-linux.git/blob - schedutils/chrt.1
libmount: fix comment referring to passno field
[thirdparty/util-linux.git] / schedutils / chrt.1
1 .\" chrt(1) manpage
2 .\"
3 .\" Copyright (C) 2004 Robert Love
4 .\" Copyright (C) 2015 Karel Zak <kzak@redhat.com>
5 .\"
6 .\" This is free documentation; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License,
8 .\" version 2, as published by the Free Software Foundation.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public License along
21 .\" with this program; if not, write to the Free Software Foundation, Inc.,
22 .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 .\"
24 .TH CHRT 1 "January 2016" "util-linux" "User Commands"
25 .SH NAME
26 chrt \- manipulate the real-time attributes of a process
27 .SH SYNOPSIS
28 .B chrt
29 [options]
30 .IR priority\ command\ [ argument ...]
31 .br
32 .B chrt
33 [options]
34 .B \-p
35 .RI [ priority ]\ pid
36 .SH DESCRIPTION
37 .PP
38 .B chrt
39 sets or retrieves the real-time scheduling attributes of an existing \fIpid\fR,
40 or runs \fIcommand\fR with the given attributes.
41
42 .SH POLICIES
43 .TP
44 \fB\-o\fR, \fB\-\-other\fR
45 Set scheduling policy to
46 .BR SCHED_OTHER .
47 This is the default Linux scheduling policy.
48 .TP
49 \fB\-f\fR, \fB\-\-fifo\fR
50 Set scheduling policy to \fBSCHED_FIFO\fR.
51 .TP
52 \fB\-r\fR, \fB\-\-rr\fR
53 Set scheduling policy to
54 .BR SCHED_RR .
55 When no policy is defined, the
56 .B SCHED_RR
57 is used as the default.
58 .TP
59 \fB\-b\fR, \fB\-\-batch\fR
60 Set scheduling policy to
61 .B SCHED_BATCH
62 (Linux-specific, supported since 2.6.16). The priority argument has to be set to zero.
63 .TP
64 \fB\-i\fR, \fB\-\-idle\fR
65 Set scheduling policy to
66 .B SCHED_IDLE
67 (Linux-specific, supported since 2.6.23). The priority argument has to be set to zero.
68 .TP
69 .BR -d ,\ --deadline
70 Set scheduling policy to
71 .B SCHED_DEADLINE
72 (Linux-specific, supported since 3.14). The priority argument has to be set to zero.
73 See also \fB\-\-sched\-runtime\fR, \fB\-\-sched\-deadline\fR and
74 \fB\-\-sched\-period\fR. The relation between the options required by the kernel is
75 runtime <= deadline <= period.
76 .B chrt
77 copies \fIperiod\fR to \fIdeadline\fR if \fB\-\-sched\-deadline\fR is not specified and
78 \fIdeadline\fR to \fIruntime\fR if \fB\-\-sched\-runtime\fR is not specified.
79 It means that at least \fB\-\-sched\-period\fR has to be specified. See
80 .BR sched (7)
81 for more details.
82
83 .SH "SCHEDULING OPTIONS"
84 .TP
85 \fB\-T\fR, \fB\-\-sched\-runtime\fR \fInanoseconds\fR
86 Specifies runtime parameter for SCHED_DEADLINE policy (Linux-specific).
87 .TP
88 \fB\-P\fR, \fB\-\-sched\-period\fR \fInanoseconds\fR
89 Specifies period parameter for SCHED_DEADLINE policy (Linux-specific).
90 .TP
91 \fB\-D\fR, \fB\-\-sched\-deadline\fR \fInanoseconds\fR
92 Specifies deadline parameter for SCHED_DEADLINE policy (Linux-specific).
93 .TP
94 \fB\-R\fR, \fB\-\-reset-on-fork\fR
95 Add
96 .B SCHED_RESET_ON_FORK
97 flag to the
98 .B SCHED_FIFO
99 or
100 .B SCHED_RR
101 scheduling policy (Linux-specific, supported since 2.6.31).
102
103 .SH OPTIONS
104 .TP
105 .BR -a ,\ --all-tasks
106 Set or retrieve the scheduling attributes of all the tasks (threads) for a
107 given PID.
108 .TP
109 .BR -m ,\ --max
110 Show minimum and maximum valid priorities, then exit.
111 .TP
112 .BR -p ,\ --pid
113 Operate on an existing PID and do not launch a new task.
114 .TP
115 .BR -v ,\ --verbose
116 Show status information.
117 .TP
118 .BR -V ,\ --version
119 Display version information and exit.
120 .TP
121 .BR -h ,\ --help
122 Display help text and exit.
123 .SH USAGE
124 .TP
125 The default behavior is to run a new command:
126 .B chrt
127 .I priority
128 .IR command\ [ arguments ]
129 .TP
130 You can also retrieve the real-time attributes of an existing task:
131 .B chrt \-p
132 .I pid
133 .TP
134 Or set them:
135 .B chrt \-r \-p
136 .I priority pid
137 .SH PERMISSIONS
138 A user must possess
139 .B CAP_SYS_NICE
140 to change the scheduling attributes of a process. Any user can retrieve the
141 scheduling information.
142
143 .SH NOTES
144 Only
145 .BR SCHED_FIFO ,
146 .B SCHED_OTHER
147 and
148 .B SCHED_RR
149 are part of POSIX 1003.1b Process Scheduling. The other scheduling attributes
150 may be ignored on some systems.
151 .P
152 Linux' default scheduling policy is
153 .BR SCHED_OTHER .
154 .SH SEE ALSO
155 .BR nice (1),
156 .BR renice (1),
157 .BR taskset (1),
158 .BR sched (7)
159 .sp
160 See
161 .BR sched_setscheduler (2)
162 for a description of the Linux scheduling scheme.
163 .SH AUTHORS
164 .UR rml@tech9.net
165 Robert Love
166 .UE
167 .br
168 .UR kzak@redhat.com
169 Karel Zak
170 .UE
171 .SH AVAILABILITY
172 The chrt command is part of the util-linux package and is available from
173 https://www.kernel.org/pub/linux/utils/util-linux/.