2011-08-18 15:18:34 -05:00
|
|
|
.TH IONICE 1 "July 2011" "util-linux" "User Commands"
|
2006-12-06 17:26:54 -06:00
|
|
|
.SH NAME
|
2011-08-18 15:18:34 -05:00
|
|
|
ionice \- set or get process I/O scheduling class and priority
|
2006-12-06 17:26:54 -06:00
|
|
|
.SH SYNOPSIS
|
2009-07-22 04:29:05 -05:00
|
|
|
.B ionice
|
2011-08-26 09:40:36 -05:00
|
|
|
.RB [ \-c
|
2009-07-22 04:29:05 -05:00
|
|
|
.IR class ]
|
2011-08-26 09:40:36 -05:00
|
|
|
.RB [ \-n
|
2011-07-21 10:28:32 -05:00
|
|
|
.IR level ]
|
2011-08-26 09:40:36 -05:00
|
|
|
.RB [ \-t ]
|
|
|
|
.B \-p
|
|
|
|
.IR PID ...
|
2009-07-22 04:29:05 -05:00
|
|
|
.br
|
|
|
|
.B ionice
|
2011-08-26 09:40:36 -05:00
|
|
|
.RB [ \-c
|
2009-07-22 04:29:05 -05:00
|
|
|
.IR class ]
|
2011-08-26 09:40:36 -05:00
|
|
|
.RB [ \-n
|
2011-07-21 10:28:32 -05:00
|
|
|
.IR level ]
|
2011-08-26 09:40:36 -05:00
|
|
|
.RB [ \-t ]
|
2014-01-30 08:52:38 -06:00
|
|
|
.B \-P
|
|
|
|
.IR PGID ...
|
|
|
|
.br
|
|
|
|
.B ionice
|
|
|
|
.RB [ \-c
|
|
|
|
.IR class ]
|
|
|
|
.RB [ \-n
|
|
|
|
.IR level ]
|
|
|
|
.RB [ \-t ]
|
|
|
|
.B \-u
|
|
|
|
.IR UID ...
|
|
|
|
.br
|
|
|
|
.B ionice
|
|
|
|
.RB [ \-c
|
|
|
|
.IR class ]
|
|
|
|
.RB [ \-n
|
|
|
|
.IR level ]
|
|
|
|
.RB [ \-t ]
|
2011-08-26 09:40:36 -05:00
|
|
|
.IR "command " [ argument ...]
|
2006-12-06 17:26:54 -06:00
|
|
|
.SH DESCRIPTION
|
2011-08-03 08:35:23 -05:00
|
|
|
This program sets or gets the I/O scheduling class and priority for a program.
|
2009-07-22 04:29:05 -05:00
|
|
|
If no arguments or just \fB\-p\fR is given, \fBionice\fR will query the current
|
2011-08-03 08:35:23 -05:00
|
|
|
I/O scheduling class and priority for that process.
|
2006-12-06 17:26:54 -06:00
|
|
|
|
2011-08-26 09:40:36 -05:00
|
|
|
When \fIcommand\fR is given,
|
|
|
|
.B ionice
|
|
|
|
will run this command with the given arguments.
|
|
|
|
If no \fIclass\fR is specified, then
|
|
|
|
.I command
|
2011-08-03 08:35:23 -05:00
|
|
|
will be executed with the "best-effort" scheduling class. The default
|
2011-08-26 09:40:36 -05:00
|
|
|
priority level is 4.
|
2011-07-22 04:15:28 -05:00
|
|
|
|
2009-01-22 05:54:06 -06:00
|
|
|
As of this writing, a process can be in one of three scheduling classes:
|
2008-08-14 04:19:07 -05:00
|
|
|
.IP "\fBIdle\fP"
|
2011-08-03 08:35:23 -05:00
|
|
|
A program running with idle I/O priority will only get disk time when no other
|
|
|
|
program has asked for disk I/O for a defined grace period. The impact of an
|
|
|
|
idle I/O process on normal system activity should be zero. This scheduling
|
|
|
|
class does not take a priority argument. Presently, this scheduling class
|
2008-04-28 05:23:40 -05:00
|
|
|
is permitted for an ordinary user (since kernel 2.6.25).
|
2011-07-22 04:39:06 -05:00
|
|
|
.IP "\fBBest-effort\fP"
|
2009-01-22 05:54:06 -06:00
|
|
|
This is the effective scheduling class for any process that has not asked for
|
2011-08-03 08:35:23 -05:00
|
|
|
a specific I/O priority.
|
|
|
|
This class takes a priority argument from \fI0-7\fR, with a lower
|
|
|
|
number being higher priority. Programs running at the same best-effort
|
2006-12-06 17:26:54 -06:00
|
|
|
priority are served in a round-robin fashion.
|
|
|
|
|
2011-08-03 08:35:23 -05:00
|
|
|
Note that before kernel 2.6.26 a process that has not asked for an I/O priority
|
|
|
|
formally uses "\fBnone\fP" as scheduling class, but the I/O scheduler will treat
|
|
|
|
such processes as if it were in the best-effort class. The priority within the
|
|
|
|
best-effort class will be dynamically derived from the CPU nice level of the
|
2009-11-18 10:13:35 -06:00
|
|
|
process: io_priority = (cpu_nice + 20) / 5.
|
|
|
|
|
2011-08-03 08:35:23 -05:00
|
|
|
For kernels after 2.6.26 with the CFQ I/O scheduler, a process that has not asked
|
|
|
|
for an I/O priority inherits its CPU scheduling class. The I/O priority is derived
|
|
|
|
from the CPU nice level of the process (same as before kernel 2.6.26).
|
2009-11-18 10:13:35 -06:00
|
|
|
|
2011-07-22 04:39:06 -05:00
|
|
|
.IP "\fBRealtime\fP"
|
2006-12-06 17:26:54 -06:00
|
|
|
The RT scheduling class is given first access to the disk, regardless of
|
2011-08-03 08:35:23 -05:00
|
|
|
what else is going on in the system. Thus the RT class needs to be used with
|
|
|
|
some care, as it can starve other processes. As with the best-effort class,
|
2006-12-06 17:26:54 -06:00
|
|
|
8 priority levels are defined denoting how big a time slice a given process
|
2011-08-03 08:35:23 -05:00
|
|
|
will receive on each scheduling window. This scheduling class is not
|
2007-09-20 07:33:31 -05:00
|
|
|
permitted for an ordinary (i.e., non-root) user.
|
2006-12-06 17:26:54 -06:00
|
|
|
.SH OPTIONS
|
2011-07-21 10:28:32 -05:00
|
|
|
.TP
|
2011-08-26 09:40:36 -05:00
|
|
|
.BR \-c , " \-\-class " \fIclass\fR
|
|
|
|
Specify the name or number of the scheduling class to use; \fI0\fR for none,
|
|
|
|
\fI1\fR for realtime, \fI2\fR for best-effort, \fI3\fR for idle.
|
2011-07-21 10:28:32 -05:00
|
|
|
.TP
|
2011-08-26 09:40:36 -05:00
|
|
|
.BR \-n , " \-\-classdata " \fIlevel\fR
|
|
|
|
Specify the scheduling class data. This only has an effect if the class
|
|
|
|
accepts an argument. For realtime and best-effort, \fI0-7\fR are valid data
|
2016-06-03 16:27:49 -05:00
|
|
|
(priority levels), and \fI0\fR represents the highest priority level.
|
2011-07-21 10:28:32 -05:00
|
|
|
.TP
|
2011-08-26 09:40:36 -05:00
|
|
|
.BR \-p , " \-\-pid " \fIPID\fR...
|
|
|
|
Specify the process IDs of running processes for which to get or set the
|
|
|
|
scheduling parameters.
|
2011-07-21 10:28:32 -05:00
|
|
|
.TP
|
2014-01-30 08:52:38 -06:00
|
|
|
.BR \-P , " \-\-pgid " \fIPGID\fR...
|
|
|
|
Specify the process group IDs of running processes for which to get or set the
|
|
|
|
scheduling parameters.
|
|
|
|
.TP
|
2011-08-26 09:40:36 -05:00
|
|
|
.BR \-t , " \-\-ignore"
|
|
|
|
Ignore failure to set the requested priority. If \fIcommand\fR was specified,
|
2011-08-03 08:35:23 -05:00
|
|
|
run it even in case it was not possible to set the desired scheduling priority,
|
|
|
|
which can happen due to insufficient privileges or an old kernel version.
|
2011-07-21 10:28:32 -05:00
|
|
|
.TP
|
2011-08-26 09:40:36 -05:00
|
|
|
.BR \-h , " \-\-help"
|
2013-10-14 14:34:39 -05:00
|
|
|
Display help text and exit.
|
2011-08-03 08:35:23 -05:00
|
|
|
.TP
|
2014-01-30 08:52:38 -06:00
|
|
|
.BR \-u , " \-\-uid " \fIUID\fR...
|
|
|
|
Specify the user IDs of running processes for which to get or set the
|
|
|
|
scheduling parameters.
|
|
|
|
.TP
|
2011-08-26 09:40:36 -05:00
|
|
|
.BR \-V , " \-\-version"
|
2011-08-03 08:35:23 -05:00
|
|
|
Display version information and exit.
|
Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.
In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.
One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.
Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
[Apply patch]
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
$ diff a b
$ echo $?
0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 02:28:32 -05:00
|
|
|
.SH NOTES
|
|
|
|
Linux supports I/O scheduling priorities and classes since 2.6.13 with the CFQ
|
|
|
|
I/O scheduler.
|
2020-05-25 07:59:12 -05:00
|
|
|
.SH EXAMPLES
|
2006-12-06 17:26:54 -06:00
|
|
|
.TP 7
|
2019-12-15 18:51:57 -06:00
|
|
|
# \fBionice\fP \-c 3 \-p 89
|
2006-12-06 17:26:54 -06:00
|
|
|
.TP 7
|
2011-08-03 08:35:23 -05:00
|
|
|
Sets process with PID 89 as an idle I/O process.
|
2006-12-06 17:26:54 -06:00
|
|
|
.TP 7
|
2019-12-15 18:51:57 -06:00
|
|
|
# \fBionice\fP \-c 2 \-n 0 bash
|
2006-12-06 17:26:54 -06:00
|
|
|
.TP 7
|
|
|
|
Runs 'bash' as a best-effort program with highest priority.
|
|
|
|
.TP 7
|
2019-12-15 18:51:57 -06:00
|
|
|
# \fBionice\fP \-p 89 91
|
2006-12-06 17:26:54 -06:00
|
|
|
.TP 7
|
2008-08-20 16:51:55 -05:00
|
|
|
Prints the class and priority of the processes with PID 89 and 91.
|
2006-12-06 17:26:54 -06:00
|
|
|
.SH AUTHORS
|
2011-07-22 04:39:06 -05:00
|
|
|
.nf
|
2009-04-23 06:22:27 -05:00
|
|
|
Jens Axboe <jens@axboe.dk>
|
2011-07-22 04:39:06 -05:00
|
|
|
Karel Zak <kzak@redhat.com>
|
|
|
|
.fi
|
2016-12-03 13:39:35 -06:00
|
|
|
.SH SEE ALSO
|
|
|
|
.BR ioprio_set (2)
|
2007-07-02 18:17:04 -05:00
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The ionice command is part of the util-linux package and is available from
|
2016-12-17 02:06:57 -06:00
|
|
|
https://www.kernel.org/pub/linux/utils/util-linux/.
|