'\"macro stdmacro
.if n .pH g4.rt_dptbl @(#)rt_dptbl	40.11 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} rt_dptbl 4 "" "\&"
.if \nX=1 .ds x} rt_dptbl 4 ""
.if \nX=2 .ds x} rt_dptbl 4 "" "\&"
.if \nX=3 .ds x} rt_dptbl "" "" "\&"
.TH \*(x}
.SH NAME
\f4rt_dptbl\f1 \- real-time dispatcher parameter table
.SH DESCRIPTION
The process scheduler (or dispatcher) is the portion of the kernel that
controls allocation of the
.SM CPU
to processes.
The scheduler supports the notion of scheduling classes where each
class defines a scheduling policy, used to schedule processes within
that class.
Associated with each scheduling class is a set of priority queues on
which ready to run processes are linked.
These priority queues are mapped by the system configuration into a set
of global scheduling priorities which are available to processes within the
class.
(The dispatcher always selects for execution the process with the highest
global scheduling priority in the system.)
The priority queues associated with a given class are viewed by that class
as a contiguous set of priority levels
numbered from 0 (lowest priority) to \f2n\f1 (highest priority\(ema
configuration dependent value).
The set of global scheduling priorities that the queues for a given class
are mapped into might not start at zero and might not be contiguous
(depending on the configuration).
.P
The real-time class maintains an in-core table, with an entry for each
priority level, giving the properties of that level.
This table is called the real-time dispatcher parameter table
(\f4rt_dptbl\f1).
The \f4rt_dptbl\fP consists of an array of parameter structures
(\f4struct rt_dpent\f1), one for each of the \f2n\f1 priority levels.
The properties of a given priority level \f2i\f1 are specified by
the \f2i\f1th parameter structure in this array (\f4rt_dptbl\f2i\f1).
.P
A parameter structure consists of the following members.
These are also described in the \f4/usr/include/sys/rt.h\f1
header file.
.TP 8m
\f4rt_globpri\f1
The global scheduling priority associated with this priority level.
The mapping between real-time priority levels and global
scheduling priorities is determined at boot time by the system
configuration.
The \f4rt_globpri\f1 values cannot be changed
with \f4dispadmin\fP(1M).
.TP
\f4rt_quantum\f1
The length of the time quantum allocated to processes at this
level in ticks (HZ).
The time quantum value is only a default or starting value for processes
at a particular level as the time quantum of a real-time process
can be changed by the user with the \f4priocntl\fP command or the
\f4priocntl\fP system call.
.PP
An administrator can affect the behavior of the real-time
portion of the scheduler by reconfiguring the \f4rt_dptbl\fP.
There are two methods available for doing this.
.SH MASTER FILE
The \f4rt_dptbl\fP can be reconfigured at boot time by specifying the
desired values in the \f4rt\f1 master file and reconfiguring the system
using the auto-configuration boot procedure; see \f4mkboot\fP(1M) and
\f4master\fP(4).
This is the only method that can be used to change the number of
real-time priority levels or the set of global scheduling priorities
used by the real-time class.
.SH DISPADMIN CONFIGURATION FILE
The \f4rt_quantum\f1 values in the \f4rt_dptbl\fP can be examined and
modified on a running system using the \f4dispadmin\fP(1M) command.
Invoking \f4dispadmin\fP for the real-time class allows the
administrator to retrieve the current \f4rt_dptbl\fP configuration from
the kernel's in-core table, or overwrite the in-core table with values
from a configuration file.
The configuration file used for input to \f4dispadmin\fP must conform
to the specific format described below.
.P
Blank lines are ignored and any part of a line to the right of a \f2#\f1
symbol is treated as a comment.
The first non-blank, non-comment line must indicate the resolution to be
used for interpreting the time quantum values.
The resolution is specified as
.P
.RS
\f4RES=\f2res\f1
.RE
.P
where \f2res\f1 is a positive integer between 1 and 1,000,000,000 inclusive
and the resolution used is the reciprocal of \f2res\f1 in seconds.
(For example, \f4RES=1000\f1 specifies millisecond resolution.)
Although very fine (nanosecond) resolution may be specified, the time quantum
lengths are rounded up to the next integral multiple of the system
clock's resolution.
For example, the finest resolution currently available on the 3B2 is
10 milliseconds (1 ``tick'').
If \f2res\f1 were 1000 a time quantum value of 34 would specify a
quantum of 34 milliseconds, which would be rounded up to 4 ticks
(40 milliseconds) on the 3B2.
.P
The remaining lines in the file are used to specify the \f4rt_quantum\f1
values for each of the real-time priority levels.
The first line specifies the quantum for real-time level 0, the
second line specifies the quantum for real-time level 1, etc.
There must be exactly one line for each configured real-time
priority level.
Each \f4rt_quantum\f1 entry must be either a positive integer
specifying the desired time quantum (in the resolution given by \f2res\f1),
or the symbol \f4RT_TQINF\f1 indicating an infinite time quantum for that
level.
.SH EXAMPLE
The following excerpt from a \f4dispadmin\fP configuration
file illustrates the format.
Note that for each line specifying a time quantum there is a comment
indicating the corresponding priority level.
These level numbers indicate
priority within the real-time class, and the mapping
between these real-time priorities and the corresponding global
scheduling priorities is determined by the configuration specified in
the \f4rt\f1 master file.
The level numbers are strictly for the convenience of the administrator reading
the file and, as with any comment, they are ignored by \f4dispadmin\fP
on input.
\f4dispadmin\fP assumes that the lines in the file are ordered
by consecutive, increasing priority level (from 0 to the maximum configured
real-time priority).
The level numbers in the comments should normally agree with this ordering;
if for some reason they don't, however, \f4dispadmin\fP is unaffected.
.bp
.P
.RS
.nf
.ft 4
# Real-Time Dispatcher Configuration File
RES=1000

#	TIME QUANTUM			   PRIORITY
#	(rt_quantum)			     LEVEL
		100				#	 0
		100				#	 1
		100				#	 2
		100				#	 3
		100				#	 4
		100				#	 5
		 90				#	 6
		 90				#	 7
		 .				.	 .
		 .				.	 .
		 .				.	 .
		 10				#	58
		 10				#	59
.fi
.ft 1
.RE
.SH FILES
.nf
\f4/usr/include/sys/rt.h\f1
.fi
.SH SEE ALSO
\f4dispadmin\f1(1M), \f4priocntl\f1(1), \f4priocntl\f1(2), \f4master\f1(4), \f4mkboot\f1(1M)
.P
``Scheduler'' chapter in the
.I "System Administrator's Guide"
.\"	@(#)rt_dptbl.4
.Ee
