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