1994-09-01 12:05:14 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1994, Henrik Vestergaard Draboel
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by Henrik Vestergaard Draboel.
|
|
|
|
.\" 4. The name of the author may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
1997-01-14 07:20:47 +00:00
|
|
|
.\" $FreeBSD$
|
1994-09-01 12:05:14 +00:00
|
|
|
.\"
|
|
|
|
.Dd July 23, 1994
|
|
|
|
.Dt RTPRIO 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
1994-10-02 04:48:21 +00:00
|
|
|
.Nm rtprio ,
|
|
|
|
.Nm idprio
|
|
|
|
.Nd execute, examine or modify a utilitys or process realtime
|
|
|
|
or idletime scheduling priority
|
1994-09-01 12:05:14 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
|
1994-10-02 04:48:21 +00:00
|
|
|
.Nm [id|rt]prio
|
|
|
|
.Nm [id|rt]prio
|
1994-09-01 12:05:14 +00:00
|
|
|
.Ar pid
|
1994-10-02 04:48:21 +00:00
|
|
|
.Nm [id|rt]prio
|
1994-09-01 12:05:14 +00:00
|
|
|
.Ar priority
|
|
|
|
.Ar command
|
|
|
|
.Op args
|
1994-10-02 04:48:21 +00:00
|
|
|
.Nm [id|rt]prio
|
1994-09-01 12:05:14 +00:00
|
|
|
.Ar priority
|
|
|
|
.Ar -pid
|
1994-10-02 04:48:21 +00:00
|
|
|
.Nm [id|rt]prio
|
1994-09-01 12:05:14 +00:00
|
|
|
.Ar -t
|
|
|
|
.Ar command
|
|
|
|
.Op args
|
1994-10-02 04:48:21 +00:00
|
|
|
.Nm [id|rt]prio
|
1994-09-01 12:05:14 +00:00
|
|
|
.Ar -t
|
|
|
|
.Ar -pid
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm Rtprio
|
1994-10-02 04:48:21 +00:00
|
|
|
is used for controlling realtime process scheduling.
|
1994-09-01 12:05:14 +00:00
|
|
|
|
1994-10-02 04:48:21 +00:00
|
|
|
.Nm Idprio
|
|
|
|
is used for controlling idletime process scheduling, and can be called
|
|
|
|
with the same options as
|
|
|
|
.Nm Rtprio .
|
|
|
|
|
|
|
|
A process with a realtime priority is not subject to priority
|
|
|
|
degradation, and will only be preempted by another process of equal or
|
|
|
|
higher realtime priority.
|
|
|
|
|
|
|
|
A process with an idle priority will run only when no other
|
|
|
|
process is runnable and then only if it's idle priority is equal or
|
|
|
|
greater than all other runnable idle priority processes.
|
|
|
|
|
|
|
|
.Nm Rtprio
|
|
|
|
or
|
|
|
|
.Nm Idprio
|
|
|
|
when called without arguments will return the realtime priority
|
1994-09-01 12:05:14 +00:00
|
|
|
of the current process.
|
|
|
|
|
|
|
|
If
|
|
|
|
.Nm rtprio
|
|
|
|
is called with 1 argument, it will return the realtime priority
|
|
|
|
of the process with the specified
|
|
|
|
.Ar pid .
|
|
|
|
|
|
|
|
If
|
|
|
|
.Ar priority
|
|
|
|
is specified, the process or program is run at that realtime priority.
|
|
|
|
If
|
|
|
|
.Ar -t
|
|
|
|
is specified, the process or program is run as a normal (non-realtime)
|
|
|
|
process.
|
|
|
|
|
|
|
|
If
|
|
|
|
.Ar -pid
|
1994-10-02 04:48:21 +00:00
|
|
|
is specified, the process with the process identifier "pid" will be
|
|
|
|
modified, else if
|
1994-09-01 12:05:14 +00:00
|
|
|
.Ar command
|
|
|
|
is specified, that program is run with its arguments.
|
|
|
|
|
|
|
|
.Ar Priority
|
1994-10-02 04:48:21 +00:00
|
|
|
is an integer between 0 and RTP_PRIO_MAX (usually 31). 0 is the
|
1994-09-01 12:05:14 +00:00
|
|
|
highest priority
|
|
|
|
|
|
|
|
.Ar Pid
|
|
|
|
of 0 means "the current process".
|
|
|
|
|
1994-10-02 04:48:21 +00:00
|
|
|
Only root is allowed to set realtime priorities. Non-root processes may
|
|
|
|
set idle priority levels for the current process only.
|
1994-09-01 12:05:14 +00:00
|
|
|
.Sh RETURN VALUE
|
1994-10-02 04:48:21 +00:00
|
|
|
If
|
1994-09-01 12:05:14 +00:00
|
|
|
.Nm rtprio
|
1994-10-02 04:48:21 +00:00
|
|
|
execute a command, the exit value is that of the command executed.
|
|
|
|
In all other cases,
|
|
|
|
.Nm
|
|
|
|
exits with 0 for success and 1 for all other errors.
|
1994-09-01 12:05:14 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
.\LP
|
|
|
|
|
|
|
|
To see which realtime priority the current process is at:
|
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
\fBrtprio\fP
|
|
|
|
.Ed
|
|
|
|
|
|
|
|
.\.LP
|
|
|
|
To see which realtime priority of process \fI1423\fP:
|
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
\fBrtprio 1423\fP
|
|
|
|
.Ed
|
|
|
|
|
|
|
|
.\.LP
|
|
|
|
To run \fIcron\fP at the lowest realtime priority:
|
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
\fBrtprio 31 cron\fP
|
|
|
|
.Ed
|
|
|
|
|
|
|
|
.\.LP
|
|
|
|
To change the realtime priority of process \fI1423\fP to \fI16\fP:
|
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
\fBrtprio 16 -1423\fP
|
|
|
|
.Ed
|
|
|
|
|
|
|
|
.\.LP
|
|
|
|
To run \fItcpdump\fP without realtime priority:
|
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
\fBrtprio -t tcpdump\fP
|
|
|
|
.Ed
|
|
|
|
|
|
|
|
.\.LP
|
1994-10-02 04:48:21 +00:00
|
|
|
To change the realtime priority of process \fI1423\fP to RTP_PRIO_NORMAL
|
|
|
|
(non-realtime/"normal" priority):
|
1994-09-01 12:05:14 +00:00
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
\fBrtprio -t -1423\fP
|
|
|
|
.Ed
|
1994-10-02 04:48:21 +00:00
|
|
|
|
|
|
|
.\.LP
|
|
|
|
To make depend while not disturbing other machine usage:
|
|
|
|
.Bd -literal -offset indent -compact
|
|
|
|
\fBidprio 31 make depend\fP
|
|
|
|
.Ed
|
1994-09-01 12:05:14 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr rtprio 2 ,
|
|
|
|
.Xr nice 1 ,
|
|
|
|
.Xr ps 1 ,
|
1996-02-11 22:38:05 +00:00
|
|
|
.Xr setpriority 2 ,
|
|
|
|
.Xr nice 3 ,
|
1994-09-01 12:05:14 +00:00
|
|
|
.Xr renice 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm rtprio
|
|
|
|
utility appeared in
|
1996-08-23 00:57:08 +00:00
|
|
|
.Fx 2.0 ,
|
1994-09-01 12:05:14 +00:00
|
|
|
but is similar to the HP-UX version.
|
1994-10-02 04:48:21 +00:00
|
|
|
.Sh CAVEATS
|
|
|
|
You can lock yourself out of the system by placing a cpu-heavy
|
|
|
|
process in a realtime priority.
|
1994-09-01 12:05:14 +00:00
|
|
|
.Sh BUGS
|
|
|
|
There is no way to set/view the realtime priority of process 0
|
|
|
|
(swapper) (see ps(1)).
|
|
|
|
|
1994-10-02 04:48:21 +00:00
|
|
|
There is in
|
1996-08-23 00:57:08 +00:00
|
|
|
.Tn FreeBSD
|
1994-10-02 04:48:21 +00:00
|
|
|
no way to ensure that a process page is present in memory therefore
|
|
|
|
the process may be stopped for pagein. (See mprotect(2), madvise(2)).
|
|
|
|
|
|
|
|
Under
|
1996-08-23 00:57:08 +00:00
|
|
|
.Tn FreeBSD
|
1994-10-02 04:48:21 +00:00
|
|
|
system calls are currently never preempted, therefore non-realtime
|
1996-01-30 13:52:50 +00:00
|
|
|
processes can starve realtime processes, or idletime processes can
|
1994-10-02 04:48:21 +00:00
|
|
|
starve normal priority processes.
|
|
|
|
|
1994-09-01 12:05:14 +00:00
|
|
|
Others ...
|
|
|
|
.Sh AUTHOR
|
1994-10-02 04:48:21 +00:00
|
|
|
Henrik Vestergaard Draboel - hvd@terry.ping.dk is the original author. This
|
1996-08-23 00:57:08 +00:00
|
|
|
implementation in
|
|
|
|
.Tn FreeBSD
|
|
|
|
was substantially rewritten by David Greenman.
|