Deleted Added
full compact
rtprio.1 (3091) rtprio.1 (3291)
1.\"
2.\" Copyright (c) 1994, Henrik Vestergaard Draboel
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29.\" SUCH DAMAGE.
30.\"
31.\" $Id: rtprio.1,v 1.1 1994/09/01 12:05:13 davidg Exp $
32.\"
33.Dd July 23, 1994
34.Dt RTPRIO 1
35.Os
36.Sh NAME
1.\"
2.\" Copyright (c) 1994, Henrik Vestergaard Draboel
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright

--- 20 unchanged lines hidden (view full) ---

29.\" SUCH DAMAGE.
30.\"
31.\" $Id: rtprio.1,v 1.1 1994/09/01 12:05:13 davidg Exp $
32.\"
33.Dd July 23, 1994
34.Dt RTPRIO 1
35.Os
36.Sh NAME
37.Nm rtprio
38.Nd execute, examine or modify a process's realtime scheduling priority
37.Nm rtprio ,
38.Nm idprio
39.Nd execute, examine or modify a utilitys or process realtime
40or idletime scheduling priority
39.Sh SYNOPSIS
40
41.Sh SYNOPSIS
42
41.Nm rtprio
42.Nm rtprio
43.Nm [id|rt]prio
44.Nm [id|rt]prio
43.Ar pid
45.Ar pid
44.Nm rtprio
46.Nm [id|rt]prio
45.Ar priority
46.Ar command
47.Op args
47.Ar priority
48.Ar command
49.Op args
48.Nm rtprio
50.Nm [id|rt]prio
49.Ar priority
50.Ar -pid
51.Ar priority
52.Ar -pid
51.Nm rtprio
53.Nm [id|rt]prio
52.Ar -t
53.Ar command
54.Op args
54.Ar -t
55.Ar command
56.Op args
55.Nm rtprio
57.Nm [id|rt]prio
56.Ar -t
57.Ar -pid
58.Sh DESCRIPTION
59.Nm Rtprio
58.Ar -t
59.Ar -pid
60.Sh DESCRIPTION
61.Nm Rtprio
60is used for controlling realtime process scheduling. A process with a
61realtime priority is not subject to priority degradation, and will only
62be preempted by another process of equal or higher realtime priority.
62is used for controlling realtime process scheduling.
63
63
64.Nm Rtprio
65called without arguments, will return the realtime priority
64.Nm Idprio
65is used for controlling idletime process scheduling, and can be called
66with the same options as
67.Nm Rtprio .
68
69A process with a realtime priority is not subject to priority
70degradation, and will only be preempted by another process of equal or
71higher realtime priority.
72
73A process with an idle priority will run only when no other
74process is runnable and then only if it's idle priority is equal or
75greater than all other runnable idle priority processes.
76
77.Nm Rtprio
78or
79.Nm Idprio
80when called without arguments will return the realtime priority
66of the current process.
67
68If
69.Nm rtprio
70is called with 1 argument, it will return the realtime priority
71of the process with the specified
72.Ar pid .
73
74If
75.Ar priority
76is specified, the process or program is run at that realtime priority.
77If
78.Ar -t
79is specified, the process or program is run as a normal (non-realtime)
80process.
81
82If
83.Ar -pid
81of the current process.
82
83If
84.Nm rtprio
85is called with 1 argument, it will return the realtime priority
86of the process with the specified
87.Ar pid .
88
89If
90.Ar priority
91is specified, the process or program is run at that realtime priority.
92If
93.Ar -t
94is specified, the process or program is run as a normal (non-realtime)
95process.
96
97If
98.Ar -pid
84is specified, the process with that pid will be modified, else
85if
99is specified, the process with the process identifier "pid" will be
100modified, else if
86.Ar command
87is specified, that program is run with its arguments.
88
89.Ar Priority
101.Ar command
102is specified, that program is run with its arguments.
103
104.Ar Priority
90is an integer between 0 (RTPRIO_MIN) and 31 (RTPRIO_MAX). 0 is the
105is an integer between 0 and RTP_PRIO_MAX (usually 31). 0 is the
91highest priority
92
93.Ar Pid
94of 0 means "the current process".
95
106highest priority
107
108.Ar Pid
109of 0 means "the current process".
110
96Only root is allowed to set realtime priorities.
111Only root is allowed to set realtime priorities. Non-root processes may
112set idle priority levels for the current process only.
97.Sh RETURN VALUE
113.Sh RETURN VALUE
114If
98.Nm rtprio
115.Nm rtprio
99returns the (new) realtime priority of the process (see rtprio(2)), or
100-1 for all usage errors.
116execute a command, the exit value is that of the command executed.
117In all other cases,
118.Nm
119exits with 0 for success and 1 for all other errors.
101.Sh EXAMPLES
102.\LP
103
104To see which realtime priority the current process is at:
105.Bd -literal -offset indent -compact
106\fBrtprio\fP
107.Ed
108

--- 17 unchanged lines hidden (view full) ---

126
127.\.LP
128To run \fItcpdump\fP without realtime priority:
129.Bd -literal -offset indent -compact
130\fBrtprio -t tcpdump\fP
131.Ed
132
133.\.LP
120.Sh EXAMPLES
121.\LP
122
123To see which realtime priority the current process is at:
124.Bd -literal -offset indent -compact
125\fBrtprio\fP
126.Ed
127

--- 17 unchanged lines hidden (view full) ---

145
146.\.LP
147To run \fItcpdump\fP without realtime priority:
148.Bd -literal -offset indent -compact
149\fBrtprio -t tcpdump\fP
150.Ed
151
152.\.LP
134To change the realtime priority of process \fI1423\fP to RTRIO_RTOFF
135(no realtime):
153To change the realtime priority of process \fI1423\fP to RTP_PRIO_NORMAL
154(non-realtime/"normal" priority):
136.Bd -literal -offset indent -compact
137\fBrtprio -t -1423\fP
138.Ed
155.Bd -literal -offset indent -compact
156\fBrtprio -t -1423\fP
157.Ed
139.Sh DIAGNOSTICS
140The
141.Nm rtprio
142utility shall exit with value of the (new) realtime priority of the
143program.
158
159.\.LP
160To make depend while not disturbing other machine usage:
161.Bd -literal -offset indent -compact
162\fBidprio 31 make depend\fP
163.Ed
144.Sh SEE ALSO
145.Xr rtprio 2 ,
146.Xr nice 1 ,
147.Xr ps 1 ,
148.Xr nice 2 ,
149.Xr renice 8
150.Sh HISTORY
151The
152.Nm rtprio
153utility appeared in
154FreeBSD 2.0,
155but is similar to the HP-UX version.
164.Sh SEE ALSO
165.Xr rtprio 2 ,
166.Xr nice 1 ,
167.Xr ps 1 ,
168.Xr nice 2 ,
169.Xr renice 8
170.Sh HISTORY
171The
172.Nm rtprio
173utility appeared in
174FreeBSD 2.0,
175but is similar to the HP-UX version.
176.Sh CAVEATS
177You can lock yourself out of the system by placing a cpu-heavy
178process in a realtime priority.
156.Sh BUGS
179.Sh BUGS
157You can lock yourself out of the system by placing a cpu-intensive
158process into realtime priority.
159
160There is no way to set/view the realtime priority of process 0
161(swapper) (see ps(1)).
162
180There is no way to set/view the realtime priority of process 0
181(swapper) (see ps(1)).
182
183There is in
184FreeBSD
185no way to ensure that a process page is present in memory therefore
186the process may be stopped for pagein. (See mprotect(2), madvise(2)).
187
188Under
189FreeBSD
190system calls are currently never preempted, therefore non-realtime
191processes can starve realtime procesess, or idletime processes can
192starve normal priority processes.
193
163Others ...
164.Sh AUTHOR
194Others ...
195.Sh AUTHOR
165Henrik Vestergaard Draboel - hvd@terry.ping.dk
196Henrik Vestergaard Draboel - hvd@terry.ping.dk is the original author. This
197implementation in FreeBSD was substantially rewritten by David Greenman.