]> git.ipfire.org Git - thirdparty/util-linux.git/blame - schedutils/ionice.1
libmount: fix comment referring to passno field
[thirdparty/util-linux.git] / schedutils / ionice.1
CommitLineData
232dc924 1.TH IONICE 1 "July 2011" "util-linux" "User Commands"
48d7b13a 2.SH NAME
232dc924 3ionice \- set or get process I/O scheduling class and priority
48d7b13a 4.SH SYNOPSIS
7c7c2e5d 5.B ionice
530395f2 6.RB [ \-c
7c7c2e5d 7.IR class ]
530395f2 8.RB [ \-n
4033fbe3 9.IR level ]
530395f2
BS
10.RB [ \-t ]
11.B \-p
12.IR PID ...
7c7c2e5d
PB
13.br
14.B ionice
530395f2 15.RB [ \-c
7c7c2e5d 16.IR class ]
530395f2 17.RB [ \-n
4033fbe3 18.IR level ]
530395f2 19.RB [ \-t ]
bd2ff3d2
MY
20.B \-P
21.IR PGID ...
22.br
23.B ionice
24.RB [ \-c
25.IR class ]
26.RB [ \-n
27.IR level ]
28.RB [ \-t ]
29.B \-u
30.IR UID ...
31.br
32.B ionice
33.RB [ \-c
34.IR class ]
35.RB [ \-n
36.IR level ]
37.RB [ \-t ]
530395f2 38.IR "command " [ argument ...]
48d7b13a 39.SH DESCRIPTION
a92eea15 40This program sets or gets the I/O scheduling class and priority for a program.
7c7c2e5d 41If no arguments or just \fB\-p\fR is given, \fBionice\fR will query the current
a92eea15 42I/O scheduling class and priority for that process.
48d7b13a 43
530395f2
BS
44When \fIcommand\fR is given,
45.B ionice
46will run this command with the given arguments.
47If no \fIclass\fR is specified, then
48.I command
a92eea15 49will be executed with the "best-effort" scheduling class. The default
530395f2 50priority level is 4.
fcc2b2da 51
9bc0e246 52As of this writing, a process can be in one of three scheduling classes:
8eec9db2 53.IP "\fBIdle\fP"
a92eea15
BS
54A program running with idle I/O priority will only get disk time when no other
55program has asked for disk I/O for a defined grace period. The impact of an
56idle I/O process on normal system activity should be zero. This scheduling
57class does not take a priority argument. Presently, this scheduling class
776452cb 58is permitted for an ordinary user (since kernel 2.6.25).
fe040397 59.IP "\fBBest-effort\fP"
9bc0e246 60This is the effective scheduling class for any process that has not asked for
a92eea15
BS
61a specific I/O priority.
62This class takes a priority argument from \fI0-7\fR, with a lower
63number being higher priority. Programs running at the same best-effort
48d7b13a
KZ
64priority are served in a round-robin fashion.
65
a92eea15
BS
66Note that before kernel 2.6.26 a process that has not asked for an I/O priority
67formally uses "\fBnone\fP" as scheduling class, but the I/O scheduler will treat
68such processes as if it were in the best-effort class. The priority within the
69best-effort class will be dynamically derived from the CPU nice level of the
75c1d2ae
KZ
70process: io_priority = (cpu_nice + 20) / 5.
71
a92eea15
BS
72For kernels after 2.6.26 with the CFQ I/O scheduler, a process that has not asked
73for an I/O priority inherits its CPU scheduling class. The I/O priority is derived
74from the CPU nice level of the process (same as before kernel 2.6.26).
75c1d2ae 75
fe040397 76.IP "\fBRealtime\fP"
48d7b13a 77The RT scheduling class is given first access to the disk, regardless of
a92eea15
BS
78what else is going on in the system. Thus the RT class needs to be used with
79some care, as it can starve other processes. As with the best-effort class,
48d7b13a 808 priority levels are defined denoting how big a time slice a given process
a92eea15 81will receive on each scheduling window. This scheduling class is not
cd66291b 82permitted for an ordinary (i.e., non-root) user.
48d7b13a 83.SH OPTIONS
4033fbe3 84.TP
530395f2
BS
85.BR \-c , " \-\-class " \fIclass\fR
86Specify the name or number of the scheduling class to use; \fI0\fR for none,
87\fI1\fR for realtime, \fI2\fR for best-effort, \fI3\fR for idle.
4033fbe3 88.TP
530395f2
BS
89.BR \-n , " \-\-classdata " \fIlevel\fR
90Specify the scheduling class data. This only has an effect if the class
91accepts an argument. For realtime and best-effort, \fI0-7\fR are valid data
fe5a9bcf 92(priority levels), and \fI0\fR represents the highest priority level.
4033fbe3 93.TP
530395f2
BS
94.BR \-p , " \-\-pid " \fIPID\fR...
95Specify the process IDs of running processes for which to get or set the
96scheduling parameters.
4033fbe3 97.TP
bd2ff3d2
MY
98.BR \-P , " \-\-pgid " \fIPGID\fR...
99Specify the process group IDs of running processes for which to get or set the
100scheduling parameters.
101.TP
530395f2
BS
102.BR \-t , " \-\-ignore"
103Ignore failure to set the requested priority. If \fIcommand\fR was specified,
a92eea15
BS
104run it even in case it was not possible to set the desired scheduling priority,
105which can happen due to insufficient privileges or an old kernel version.
4033fbe3 106.TP
530395f2 107.BR \-h , " \-\-help"
b4362b6f 108Display help text and exit.
a92eea15 109.TP
bd2ff3d2
MY
110.BR \-u , " \-\-uid " \fIUID\fR...
111Specify the user IDs of running processes for which to get or set the
112scheduling parameters.
113.TP
530395f2 114.BR \-V , " \-\-version"
a92eea15 115Display version information and exit.
48d7b13a
KZ
116.SH EXAMPLES
117.LP
118.TP 7
8eec9db2 119# \fBionice\fP -c 3 -p 89
48d7b13a 120.TP 7
a92eea15 121Sets process with PID 89 as an idle I/O process.
48d7b13a 122.TP 7
8eec9db2 123# \fBionice\fP -c 2 -n 0 bash
48d7b13a
KZ
124.TP 7
125Runs 'bash' as a best-effort program with highest priority.
126.TP 7
ef0fe2e8 127# \fBionice\fP -p 89 91
48d7b13a 128.TP 7
ef0fe2e8 129Prints the class and priority of the processes with PID 89 and 91.
48d7b13a 130.SH NOTES
a92eea15
BS
131Linux supports I/O scheduling priorities and classes since 2.6.13 with the CFQ
132I/O scheduler.
48d7b13a 133.SH AUTHORS
fe040397 134.nf
357e7c3b 135Jens Axboe <jens@axboe.dk>
fe040397
KZ
136Karel Zak <kzak@redhat.com>
137.fi
82b3c4c2
MK
138.SH SEE ALSO
139.BR ioprio_set (2)
86d62711 140.SH AVAILABILITY
601d12fb 141The ionice command is part of the util-linux package and is available from
d673b74e 142https://www.kernel.org/pub/linux/utils/util-linux/.