2 .\" Copyright (C) 2002, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH FX_DPTBL 4 "Oct 15, 2002"
8 fx_dptbl \- fixed priority dispatcher parameter table
18 The process scheduler or dispatcher is the portion of the kernel that controls
19 allocation of the CPU to processes. The scheduler supports the notion of
20 scheduling classes, where each class defines a scheduling policy used to
21 schedule processes within that class. Associated with each scheduling class is
22 a set of priority queues on which ready-to-run processes are linked. These
23 priority queues are mapped by the system configuration into a set of global
24 scheduling priorities, which are available to processes within the class. The
25 dispatcher always selects for execution the process with the highest global
26 scheduling priority in the system. The priority queues associated with a given
27 class are viewed by that class as a contiguous set of priority levels numbered
28 from 0 (lowest priority) to \fIn\fR (highest priority\(ema
29 configuration-dependent value). The set of global scheduling priorities that
30 the queues for a given class are mapped into might not start at zero and might
31 not be contiguous, depending on the configuration.
34 Processes in the fixed priority class are scheduled according to the parameters
35 in a fixed-priority dispatcher parameter table (\fBfx_dptbl\fR). The
36 \fBfx_dptbl\fR table consists of an array (\fBconfig_fx_dptbl[]\fR) of
37 parameter structures (\fBstruct fxdpent_t\fR), one for each of the \fIn\fR
38 priority levels used by fixed priority processes in user mode. The structures
39 are accessed by way of a pointer, (\fBfx_dptbl\fR), to the array. The
40 properties of a given priority level \fIi\fR are specified by the \fIi\fRth
41 parameter structure in this array (\fBfx_dptbl[\fIi\fR]\fR).
44 A parameter structure consists of the following members. These are also
45 described in the \fB/usr/include/sys/fx.h\fR header.
49 \fB\fBfx_globpri\fR\fR
52 The global scheduling priority associated with this priority level. The mapping
53 between fixed-priority priority levels and global scheduling priorities is
54 determined at boot time by the system configuration. \fBfx_globpri\fR can not
55 be changed with \fBdispadmin\fR(1M).
61 \fB\fBfx_quantum\fR\fR
64 The length of the time quantum allocated to processes at this level in ticks
65 (\fBhz\fR). The time quantum value is only a default or starting value for
66 processes at a particular level, as the time quantum of a fixed priority
67 process can be changed by the user with the \fBpriocntl\fR(1) command or the
68 \fBpriocntl\fR(2) system call.
70 In the high resolution clock mode (\fBhires_tick\fR set to \fB1\fR), the value
71 of \fBhz\fR is set to \fB1000\fR. Increase quantums to maintain the same
72 absolute time quantums.
74 An administrator can affect the behavior of the fixed priority portion of the
75 scheduler by reconfiguring the \fBfx_dptbl\fR. There are two methods available
76 for doing this: reconfigure with a loadable module at boot-time or by using
77 \fBdispadmin\fR(1M) at run-time.
80 .SS "fx_dptbl Loadable Module"
83 The \fBfx_dptbl\fR can be reconfigured with a loadable module that contains a
84 new fixed priority dispatch table. The module containing the dispatch table is
85 separate from the \fBFX\fR loadable module, which contains the rest of the
86 fixed priority software. This is the only method that can be used to change the
87 number of fixed priority priority levels or the set of global scheduling
88 priorities used by the fixed priority class. The relevant procedure and source
89 code is described in Replacing the fx_dptbl Loadable Module below.
90 .SS "dispadmin Configuration File"
93 The \fBfx_quantum\fR values in the \fBfx_dptbl\fR can be examined and modified
94 on a running system using the \fBdispadmin\fR(1M) command. Invoking
95 \fBdispadmin\fR for the fixed-priority class allows the administrator to
96 retrieve the current \fBfx_dptbl\fR configuration from the kernel's in-core
97 table or overwrite the in-core table with values from a configuration file. The
98 configuration file used for input to \fBdispadmin\fR must conform to the
99 specific format described as follows:
104 Blank lines are ignored and any part of a line to the right of a # symbol is
105 treated as a comment.
111 The first non-blank, non-comment line must indicate the resolution to be used
112 for interpreting the time quantum values. The resolution is specified as:
121 where \fIres\fR is a positive integer between 1 and 1,000,000,000 inclusive and
122 the resolution used is the reciprocal of \fIres\fR in seconds (for example,
123 \fBRES=1000\fR specifies millisecond resolution). Although you can specify very
124 fine (nanosecond) resolution, the time quantum lengths are rounded up to the
125 next integral multiple of the system clock's resolution.
131 The remaining lines in the file are used to specify the \fBfx_quantum\fR values
132 for each of the fixed-priority priority levels. The first line specifies the
133 quantum for fixed-priority level 0, the second line specifies the quantum for
134 fixed-priority level 1, and so forth. There must be exactly one line for each
135 configured fixed priority priority level. Each \fBfx_quantum\fR entry must be a
136 positive integer specifying the desired time quantum in the resolution given by
141 See Examples for an example of an excerpt of a \fBdispadmin\fR configuration
143 .SS "Replacing the fx_dptbl Loadable Module"
146 To change the size of the fixed priority dispatch table, you must build the
147 loadable module that contains the dispatch table information. Save the existing
148 module before using the following procedure.
152 Place the dispatch table code shown below in a file called \fBfx_dptbl.c\fR.
153 See EXAMPLES, below, for an example of this file.
158 Compile the code using the given compilation and link lines supplied:
162 cc -c -0 -D_KERNEL fx_dptbl.c
163 ld -r -o FX_DPTBL fx_dptbl.o
172 Copy the current dispatch table in \fB/usr/kernel/sched\fR to
178 Replace the current \fBFX_DPTBL\fR in \fB/usr/kernel/sched\fR.
183 Make changes in the \fB/etc/system\fR file to reflect the changes to the
184 sizes of the tables. See \fBsystem\fR(4). The variables affected is
185 \fBfx_maxupri\fR. The syntax for setting this is as follows:
189 set FX:fx_maxupri=(\fIvalue for max fixed-priority user priority\fR)
198 Reboot the system to use the new dispatch table.
202 Exercise great care in using the preceding method to replace the dispatch
203 table. A mistake can result in panics, thus making the system unusable.
206 \fBExample 1 \fRConfiguration File Excerpt
209 The following excerpt from a \fBdispadmin\fR configuration file illustrates the
210 correct format. Note that, for each line specifying a set of parameters, there
211 is a comment indicating the corresponding priority level. These level numbers
212 indicate priority within the fixed priority class; the mapping between these
213 fixed-priority priorities and the corresponding global scheduling priorities is
214 determined by the configuration specified in the \fBFX_DPTBL\fR loadable
215 module. The level numbers are strictly for the convenience of the administrator
216 reading the file and, as with any comment, they are ignored by \fBdispadmin\fR.
217 The \fBdispadmin\fR command assumes that the lines in the file are ordered by
218 consecutive, increasing priority level (from 0 to the maximum configured
219 fixed-priority priority). For the sake of someone reading the file, the level
220 numbers in the comments should agree with this ordering. If for some reason
221 they do not, \fBdispadmin\fR is unaffected.
226 # Fixed Priority Dispatcher Configuration File RES=1000
229 # TIME QUANTUM PRIORITY
250 \fBExample 2 \fR\fBfx_dptbl.c\fR File Used for Building the New \fBfx_dptbl\fR
253 The following is an example of a \fBfx_dptbl.c\fR file used for building the
259 /* BEGIN fx_dptbl.c */
261 #include <sys/proc.h>
262 #include <sys/priocntl.h>
263 #include <sys/class.h>
264 #include <sys/disp.h>
266 #include <sys/fxpriocntl.h>
270 * This is the loadable module wrapper.
273 #include <sys/modctl.h>
275 extern struct mod_ops mod_miscops;
278 * Module linkage information for the kernel.
281 static struct modlmisc modlmisc = {
282 &mod_miscops, "Fixed priority dispatch table"
285 static struct modlinkage modlinkage = {
286 MODREV_1, &modlmisc, 0
291 return (mod_install(&modlinkage));
295 struct modinfo *modinfop;
297 return (mod_info(&modlinkage, modinfop));
300 #define FXGPUP0 0 /* Global priority for FX user priority 0 */
301 fxdpent_t config_fx_dptbl[] = {
370 pri_t config_fx_maxumdpri =
371 sizeof (config_fx_dptbl) / sizeof (fxdpent_t) - 1;
374 * Return the address of config_fx_dptbl
379 return (config_fx_dptbl);
383 * Return the address of fx_maxumdpri
389 * the config_fx_dptbl table.
391 return (config_fx_maxumdpri);
400 \fBpriocntl\fR(1), \fBdispadmin\fR(1M), \fBpriocntl\fR(2), \fBsystem\fR(4)
403 \fISystem Administration Guide, Volume 1, System Interface Guide\fR
407 In order to improve performance under heavy system load, both the \fBnfsd\fR
408 daemon and the \fBlockd\fR daemon utilize the maximum priority in the \fBFX\fR
409 class. Unusual \fBfx_dptbl\fR configurations may have significant negative
410 impact on the performance of the \fBnfsd\fR and \fBlockd\fR daemons.