1fx_dptbl(4)                      File Formats                      fx_dptbl(4)
2
3
4

NAME

6       fx_dptbl - fixed priority dispatcher parameter table
7

SYNOPSIS

9       fx_dptbl
10
11

DESCRIPTION

13       The  process  scheduler or dispatcher is the portion of the kernel that
14       controls allocation of the CPU to processes. The scheduler supports the
15       notion  of  scheduling  classes,  where each class defines a scheduling
16       policy used to schedule processes within that  class.  Associated  with
17       each scheduling class is a set of priority queues on which ready-to-run
18       processes are linked. These priority queues are mapped  by  the  system
19       configuration  into  a  set  of global scheduling priorities, which are
20       available to processes within the class. The dispatcher always  selects
21       for  execution  the process with the highest global scheduling priority
22       in the system. The priority queues associated with a  given  class  are
23       viewed  by  that  class as a contiguous set of priority levels numbered
24       from 0 (lowest priority) to n (highest priority—a  configuration-depen‐
25       dent  value).  The  set of global scheduling priorities that the queues
26       for a given class are mapped into might not start at zero and might not
27       be contiguous, depending on the configuration.
28
29
30       Processes  in  the  fixed priority class are scheduled according to the
31       parameters in a fixed-priority dispatcher parameter  table  (fx_dptbl).
32       The  fx_dptbl table consists of an array (config_fx_dptbl[]) of parame‐
33       ter structures (struct fxdpent_t), one for each of the n priority  lev‐
34       els  used  by fixed priority processes in user mode. The structures are
35       accessed by way of a pointer, (fx_dptbl), to the array. The  properties
36       of  a  given priority level i are specified by the ith parameter struc‐
37       ture in this array (fx_dptbl[i]).
38
39
40       A parameter structure consists of the following members. These are also
41       described in the /usr/include/sys/fx.h header.
42
43       fx_globpri    The  global scheduling priority associated with this pri‐
44                     ority level. The mapping between fixed-priority  priority
45                     levels  and global scheduling priorities is determined at
46                     boot time by the system configuration. fx_globpri can not
47                     be changed with dispadmin(1M).
48
49
50       fx_quantum    The  length of the time quantum allocated to processes at
51                     this level in ticks (hz). The time quantum value is  only
52                     a default or starting value for processes at a particular
53                     level, as the time quantum of a  fixed  priority  process
54                     can  be  changed by the user with the priocntl(1) command
55                     or the priocntl(2) system call.
56
57                     In the high resolution clock mode (hires_tick set to  1),
58                     the  value  of  hz  is  set to 1000. Increase quantums to
59                     maintain the same absolute time quantums.
60
61                     An administrator can affect the  behavior  of  the  fixed
62                     priority  portion  of  the scheduler by reconfiguring the
63                     fx_dptbl. There are two methods available for doing this:
64                     reconfigure  with  a  loadable  module at boot-time or by
65                     using dispadmin(1M) at run-time.
66
67
68   fx_dptbl Loadable Module
69       The fx_dptbl can be reconfigured with a loadable module that contains a
70       new  fixed  priority dispatch table. The module containing the dispatch
71       table is separate from the FX loadable module, which contains the  rest
72       of  the  fixed  priority  software. This is the only method that can be
73       used to change the number of fixed priority priority levels or the  set
74       of  global  scheduling priorities used by the fixed priority class. The
75       relevant procedure and  source  code  is  described  in  Replacing  the
76       fx_dptbl Loadable Module below.
77
78   dispadmin Configuration File
79       The fx_quantum values in the fx_dptbl can be examined and modified on a
80       running system using the dispadmin(1M) command. Invoking dispadmin  for
81       the  fixed-priority class allows the administrator to retrieve the cur‐
82       rent fx_dptbl configuration from the kernel's in-core  table  or  over‐
83       write the in-core table with values from a configuration file. The con‐
84       figuration file used for input to dispadmin must conform  to  the  spe‐
85       cific format described as follows:
86
87           o      Blank  lines are ignored and any part of a line to the right
88                  of a # symbol is treated as a comment.
89
90           o      The first non-blank, non-comment line must indicate the res‐
91                  olution to be used for interpreting the time quantum values.
92                  The resolution is specified as:
93
94                    RES=res
95
96
97                  where res is a positive integer between 1 and  1,000,000,000
98                  inclusive  and  the resolution used is the reciprocal of res
99                  in seconds (for example, RES=1000 specifies millisecond res‐
100                  olution).  Although  you  can specify very fine (nanosecond)
101                  resolution, the time quantum lengths are rounded up  to  the
102                  next integral multiple of the system clock's resolution.
103
104           o      The  remaining  lines  in  the  file are used to specify the
105                  fx_quantum values for each of  the  fixed-priority  priority
106                  levels.  The first line specifies the quantum for fixed-pri‐
107                  ority level 0, the second line  specifies  the  quantum  for
108                  fixed-priority  level 1, and so forth. There must be exactly
109                  one line for each configured fixed priority priority  level.
110                  Each  fx_quantum entry must be a positive integer specifying
111                  the desired time quantum in the resolution given by res.
112
113
114       See Examples for an example of an excerpt of a dispadmin  configuration
115       file.
116
117   Replacing the fx_dptbl Loadable Module
118       To change the size of the fixed priority dispatch table, you must build
119       the loadable module that contains the dispatch table information.  Save
120       the existing module before using the following procedure.
121
122           1.     Place  the  dispatch table code shown below in a file called
123                  fx_dptbl.c. See EXAMPLES, below,  for  an  example  of  this
124                  file.
125
126           2.     Compile  the code using the given compilation and link lines
127                  supplied:
128
129                    cc -c -0 -D_KERNEL fx_dptbl.c
130                    ld -r -o FX_DPTBL fx_dptbl.o
131
132
133
134           3.     Copy the current  dispatch  table  in  /usr/kernel/sched  to
135                  FX_DPTBL.bak.
136
137           4.     Replace the current FX_DPTBL in /usr/kernel/sched.
138
139           5.     Make  changes in the /etc/system file to reflect the changes
140                  to the sizes of the tables.  See  system(4).  The  variables
141                  affected  is  fx_maxupri.  The syntax for setting this is as
142                  follows:
143
144                    set  FX:fx_maxupri=(value for max fixed-priority user priority)
145
146
147
148           6.     Reboot the system to use the new dispatch table.
149
150
151       Exercise great care in using the preceding method to replace  the  dis‐
152       patch  table.  A  mistake  can result in panics, thus making the system
153       unusable.
154

EXAMPLES

156       Example 1 Configuration File Excerpt
157
158
159       The following excerpt from a dispadmin configuration  file  illustrates
160       the correct format. Note that, for each line specifying a set of param‐
161       eters, there is a comment indicating the corresponding priority  level.
162       These  level numbers indicate priority within the fixed priority class;
163       the mapping between these fixed-priority priorities and the correspond‐
164       ing  global  scheduling  priorities  is determined by the configuration
165       specified in the  FX_DPTBL  loadable  module.  The  level  numbers  are
166       strictly for the convenience of the administrator reading the file and,
167       as with any comment, they are ignored by dispadmin. The dispadmin  com‐
168       mand  assumes  that  the  lines in the file are ordered by consecutive,
169       increasing priority level (from 0 to the maximum configured  fixed-pri‐
170       ority  priority).  For  the sake of someone reading the file, the level
171       numbers in the comments should agree with this ordering.  If  for  some
172       reason they do not, dispadmin is unaffected.
173
174
175         # Fixed Priority Dispatcher Configuration File RES=1000
176
177         RES=1000
178         #   TIME QUANTUM              PRIORITY
179         # (fx_quantum)                LEVEL
180         200                           #   0
181         200                           #   1
182         200                           #   2
183         200                           #   3
184         200                           #   4
185         200                           #   5
186         200                           #   6
187         200                           #   7
188          .                            .   .
189          .                            .   .
190          .                            .   .
191         20                            #   58
192         20                            #   59
193         20                            #   60
194
195
196
197       Example 2 fx_dptbl.c File Used for Building the New fx_dptbl
198
199
200       The  following is an example of a fx_dptbl.c file used for building the
201       new fx_dptbl.
202
203
204         /* BEGIN fx_dptbl.c */
205
206         #include <sys/proc.h>
207         #include <sys/priocntl.h>
208         #include <sys/class.h>
209         #include <sys/disp.h>
210         #include <sys/fx.h>
211         #include <sys/fxpriocntl.h>
212
213
214         /*
215          * This is the loadable module wrapper.
216          */
217
218         #include <sys/modctl.h>
219
220         extern struct mod_ops mod_miscops;
221
222         /*
223          * Module linkage information for the kernel.
224          */
225
226         static struct modlmisc modlmisc = {
227            &mod_miscops, "Fixed priority dispatch table"
228         };
229
230         static struct modlinkage modlinkage = {
231            MODREV_1, &modlmisc, 0
232         };
233
234         _init()
235         {
236            return (mod_install(&modlinkage));
237         }
238
239         _info(modinfop)
240            struct modinfo *modinfop;
241         {
242            return (mod_info(&modlinkage, modinfop));
243         }
244
245         #define FXGPUP0 0   /* Global priority for FX user priority 0 */
246         fxdpent_t config_fx_dptbl[] = {
247
248         /*  glbpri      qntm */
249
250            FXGPUP0+0,   20,
251            FXGPUP0+1,   20,
252            FXGPUP0+2,   20,
253            FXGPUP0+3,   20,
254            FXGPUP0+4,   20,
255            FXGPUP0+5,   20,
256            FXGPUP0+6,   20,
257            FXGPUP0+7,   20,
258            FXGPUP0+8,   20,
259            FXGPUP0+9,   20,
260            FXGPUP0+10,  16,
261            FXGPUP0+11,  16,
262            FXGPUP0+12,  16,
263            FXGPUP0+13,  16,
264            FXGPUP0+14,  16,
265            FXGPUP0+15,  16,
266            FXGPUP0+16,  16,
267            FXGPUP0+17,  16,
268            FXGPUP0+18,  16,
269            FXGPUP0+19,  16,
270            FXGPUP0+20,  12,
271            FXGPUP0+21,  12,
272            FXGPUP0+22,  12,
273            FXGPUP0+23,  12,
274            FXGPUP0+24,  12,
275            FXGPUP0+25,  12,
276            FXGPUP0+26,  12,
277            FXGPUP0+27,  12,
278            FXGPUP0+28,  12,
279            FXGPUP0+29,  12,
280            FXGPUP0+30,   8,
281            FXGPUP0+31,   8,
282            FXGPUP0+32,   8,
283            FXGPUP0+33,   8,
284            FXGPUP0+34,   8,
285            FXGPUP0+35,   8,
286            FXGPUP0+36,   8,
287            FXGPUP0+37,   8,
288            FXGPUP0+38,   8,
289            FXGPUP0+39,   8,
290            FXGPUP0+40,   4,
291            FXGPUP0+41,   4,
292            FXGPUP0+42,   4,
293            FXGPUP0+43,   4,
294            FXGPUP0+44,   4,
295            FXGPUP0+45,   4,
296            FXGPUP0+46,   4,
297            FXGPUP0+47,   4,
298            FXGPUP0+48,   4,
299            FXGPUP0+49,   4,
300            FXGPUP0+50,   4,
301            FXGPUP0+51,   4,
302            FXGPUP0+52,   4,
303            FXGPUP0+53,   4,
304            FXGPUP0+54,   4,
305            FXGPUP0+55,   4,
306            FXGPUP0+56,   4,
307            FXGPUP0+57,   4,
308            FXGPUP0+58,   4,
309            FXGPUP0+59,   2,
310            FXGPUP0+60    2,
311         };
312
313
314
315         pri_t config_fx_maxumdpri =
316                         sizeof (config_fx_dptbl) / sizeof (fxdpent_t) - 1;
317
318         /*
319          * Return the address of config_fx_dptbl
320          */
321         fxdpent_t *
322         fx_getdptbl()
323         {
324            return (config_fx_dptbl);
325         }
326
327         /*
328          * Return the address of fx_maxumdpri
329          */
330         pri_t
331         fx_getmaxumdpri()
332         {
333         /*
334          * the config_fx_dptbl table.
335          */
336            return (config_fx_maxumdpri);
337         }
338
339
340

SEE ALSO

342       priocntl(1), dispadmin(1M), priocntl(2), system(4)
343
344
345       System Administration Guide, Volume 1, System Interface Guide
346

NOTES

348       In order to improve performance under heavy system load, both the  nfsd
349       daemon  and  the  lockd  daemon  utilize the maximum priority in the FX
350       class. Unusual fx_dptbl configurations may  have  significant  negative
351       impact on the performance of the nfsd and lockd daemons.
352
353
354
355SunOS 5.11                        15 Oct 2002                      fx_dptbl(4)
Impressum