]> git.ipfire.org Git - thirdparty/util-linux.git/blame - schedutils/chrt.1
libmount: fix comment referring to passno field
[thirdparty/util-linux.git] / schedutils / chrt.1
CommitLineData
48d7b13a
KZ
1.\" chrt(1) manpage
2.\"
3.\" Copyright (C) 2004 Robert Love
5b033bfd 4.\" Copyright (C) 2015 Karel Zak <kzak@redhat.com>
48d7b13a
KZ
5.\"
6.\" This is free documentation; you can redistribute it and/or
5aab9a1a
BS
7.\" modify it under the terms of the GNU General Public License,
8.\" version 2, as published by the Free Software Foundation.
48d7b13a
KZ
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.\"
7cebf0bb
SK
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.
48d7b13a 23.\"
5b033bfd 24.TH CHRT 1 "January 2016" "util-linux" "User Commands"
48d7b13a 25.SH NAME
232dc924 26chrt \- manipulate the real-time attributes of a process
48d7b13a
KZ
27.SH SYNOPSIS
28.B chrt
42f15e98
BS
29[options]
30.IR priority\ command\ [ argument ...]
5ebbcdf9
LJ
31.br
32.B chrt
42f15e98 33[options]
5ebbcdf9 34.B \-p
42f15e98 35.RI [ priority ]\ pid
48d7b13a
KZ
36.SH DESCRIPTION
37.PP
232dc924 38.B chrt
397a5114 39sets or retrieves the real-time scheduling attributes of an existing \fIpid\fR,
5b033bfd
KZ
40or runs \fIcommand\fR with the given attributes.
41
42.SH POLICIES
48d7b13a 43.TP
5b033bfd 44\fB\-o\fR, \fB\-\-other\fR
8722fc38 45Set scheduling policy to
5b033bfd
KZ
46.BR SCHED_OTHER .
47This is the default Linux scheduling policy.
48.TP
8722fc38
BS
49\fB\-f\fR, \fB\-\-fifo\fR
50Set scheduling policy to \fBSCHED_FIFO\fR.
5b033bfd
KZ
51.TP
52\fB\-r\fR, \fB\-\-rr\fR
53Set scheduling policy to
54.BR SCHED_RR .
8722fc38 55When no policy is defined, the
5b033bfd 56.B SCHED_RR
8722fc38 57is used as the default.
78904e76 58.TP
5b033bfd 59\fB\-b\fR, \fB\-\-batch\fR
397a5114 60Set scheduling policy to
42f15e98 61.B SCHED_BATCH
8722fc38 62(Linux-specific, supported since 2.6.16). The priority argument has to be set to zero.
5b033bfd
KZ
63.TP
64\fB\-i\fR, \fB\-\-idle\fR
65Set scheduling policy to
66.B SCHED_IDLE
8722fc38 67(Linux-specific, supported since 2.6.23). The priority argument has to be set to zero.
48d7b13a 68.TP
1a7e6395 69.BR -d ,\ --deadline
8722fc38 70Set scheduling policy to
0bb7e904 71.B SCHED_DEADLINE
8722fc38
BS
72(Linux-specific, supported since 3.14). The priority argument has to be set to zero.
73See 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
5b033bfd 75runtime <= deadline <= period.
1a7e6395 76.B chrt
8722fc38
BS
77copies \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.
79It means that at least \fB\-\-sched\-period\fR has to be specified. See
1a7e6395
KZ
80.BR sched (7)
81for more details.
5b033bfd
KZ
82
83.SH "SCHEDULING OPTIONS"
1a7e6395 84.TP
5b033bfd
KZ
85\fB\-T\fR, \fB\-\-sched\-runtime\fR \fInanoseconds\fR
86Specifies runtime parameter for SCHED_DEADLINE policy (Linux-specific).
48d7b13a 87.TP
5b033bfd
KZ
88\fB\-P\fR, \fB\-\-sched\-period\fR \fInanoseconds\fR
89Specifies period parameter for SCHED_DEADLINE policy (Linux-specific).
397a5114 90.TP
5b033bfd
KZ
91\fB\-D\fR, \fB\-\-sched\-deadline\fR \fInanoseconds\fR
92Specifies deadline parameter for SCHED_DEADLINE policy (Linux-specific).
48d7b13a 93.TP
5b033bfd 94\fB\-R\fR, \fB\-\-reset-on-fork\fR
397a5114 95Add
5f719971
BS
96.B SCHED_RESET_ON_FORK
97flag to the
98.B SCHED_FIFO
99or
100.B SCHED_RR
5b033bfd
KZ
101scheduling policy (Linux-specific, supported since 2.6.31).
102
103.SH OPTIONS
5f719971 104.TP
5b033bfd
KZ
105.BR -a ,\ --all-tasks
106Set or retrieve the scheduling attributes of all the tasks (threads) for a
107given PID.
1a7e6395 108.TP
5b033bfd
KZ
109.BR -m ,\ --max
110Show minimum and maximum valid priorities, then exit.
1a7e6395 111.TP
5b033bfd
KZ
112.BR -p ,\ --pid
113Operate on an existing PID and do not launch a new task.
1a7e6395 114.TP
42f15e98
BS
115.BR -v ,\ --verbose
116Show status information.
48d7b13a 117.TP
42f15e98 118.BR -V ,\ --version
397a5114 119Display version information and exit.
42f15e98
BS
120.TP
121.BR -h ,\ --help
122Display help text and exit.
48d7b13a
KZ
123.SH USAGE
124.TP
397a5114
BS
125The default behavior is to run a new command:
126.B chrt
42f15e98 127.I priority
397a5114 128.IR command\ [ arguments ]
48d7b13a
KZ
129.TP
130You can also retrieve the real-time attributes of an existing task:
397a5114
BS
131.B chrt \-p
132.I pid
48d7b13a
KZ
133.TP
134Or set them:
fdf8fb1c 135.B chrt \-r \-p
42f15e98 136.I priority pid
48d7b13a
KZ
137.SH PERMISSIONS
138A user must possess
0bb7e904 139.B CAP_SYS_NICE
48d7b13a
KZ
140to change the scheduling attributes of a process. Any user can retrieve the
141scheduling information.
5b033bfd 142
40bc2ab5
AJ
143.SH NOTES
144Only
145.BR SCHED_FIFO ,
0bb7e904 146.B SCHED_OTHER
40bc2ab5 147and
0bb7e904 148.B SCHED_RR
8722fc38 149are part of POSIX 1003.1b Process Scheduling. The other scheduling attributes
40bc2ab5 150may be ignored on some systems.
fdf8fb1c 151.P
8722fc38 152Linux' default scheduling policy is
fdf8fb1c 153.BR SCHED_OTHER .
42f15e98 154.SH SEE ALSO
48d7b13a 155.BR nice (1),
5b033bfd 156.BR renice (1),
f053ff1e 157.BR taskset (1),
1a7e6395 158.BR sched (7)
48d7b13a
KZ
159.sp
160See
161.BR sched_setscheduler (2)
162for a description of the Linux scheduling scheme.
5b033bfd
KZ
163.SH AUTHORS
164.UR rml@tech9.net
165Robert Love
166.UE
167.br
168.UR kzak@redhat.com
169Karel Zak
170.UE
86d62711 171.SH AVAILABILITY
601d12fb 172The chrt command is part of the util-linux package and is available from
d673b74e 173https://www.kernel.org/pub/linux/utils/util-linux/.