FX_DPTBL(5) | File Formats and Configurations | FX_DPTBL(5) |
fx_dptbl
Processes in the fixed priority class are scheduled according to the parameters in a fixed-priority dispatcher parameter table (fx_dptbl). The fx_dptbl table consists of an array (config_fx_dptbl[]) of parameter structures (struct fxdpent_t), one for each of the n priority levels used by fixed priority processes in user mode. The structures are accessed by way of a pointer, (fx_dptbl), to the array. The properties of a given priority level i are specified by the ith parameter structure in this array (fx_dptbl[i]).
A parameter structure consists of the following members. These are also described in the /usr/include/sys/fx.h header.
fx_globpri
fx_quantum
In the default high resolution clock mode (hires_tick set to 1), the value of hz is set to 1000. If this value is overridden to 0 then hz will instead be 100; the number of ticks per quantum must then be decreased to maintain the same length of quantum in absolute time.
An administrator can affect the behavior of the fixed priority portion of the scheduler by reconfiguring the fx_dptbl. There are two methods available for doing this: reconfigure with a loadable module at boot-time or by using dispadmin(8) at run-time.
RES=res
where res is a positive integer between 1 and 1,000,000,000 inclusive and the resolution used is the reciprocal of res in seconds (for example, RES=1000 specifies millisecond resolution). Although you can specify very fine (nanosecond) resolution, the time quantum lengths are rounded up to the next integral multiple of the system clock's resolution.
See Examples for an example of an excerpt of a dispadmin configuration file.
cc -c -0 -D_KERNEL fx_dptbl.c ld -r -o FX_DPTBL fx_dptbl.o
set FX:fx_maxupri=(value for max fixed-priority user priority)
Exercise great care in using the preceding method to replace the dispatch table. A mistake can result in panics, thus making the system unusable.
The following excerpt from a dispadmin configuration file illustrates the correct format. Note that, for each line specifying a set of parameters, there is a comment indicating the corresponding priority level. These level numbers indicate priority within the fixed priority class; the mapping between these fixed-priority priorities and the corresponding global scheduling priorities is determined by the configuration specified in the FX_DPTBL loadable module. The level numbers are strictly for the convenience of the administrator reading the file and, as with any comment, they are ignored by dispadmin. The dispadmin command assumes that the lines in the file are ordered by consecutive, increasing priority level (from 0 to the maximum configured fixed-priority priority). For the sake of someone reading the file, the level numbers in the comments should agree with this ordering. If for some reason they do not, dispadmin is unaffected.
# Fixed Priority Dispatcher Configuration File RES=1000 RES=1000 # TIME QUANTUM PRIORITY # (fx_quantum) LEVEL 200 # 0 200 # 1 200 # 2 200 # 3 200 # 4 200 # 5 200 # 6 200 # 7 . . . . . . . . . 20 # 58 20 # 59 20 # 60
Example 2 fx_dptbl.c File Used for Building the New fx_dptbl
The following is an example of a fx_dptbl.c file used for building the new fx_dptbl.
/* BEGIN fx_dptbl.c */ #include <sys/proc.h> #include <sys/priocntl.h> #include <sys/class.h> #include <sys/disp.h> #include <sys/fx.h> #include <sys/fxpriocntl.h> /* * This is the loadable module wrapper. */ #include <sys/modctl.h> extern struct mod_ops mod_miscops; /* * Module linkage information for the kernel. */ static struct modlmisc modlmisc = { &mod_miscops, "Fixed priority dispatch table" }; static struct modlinkage modlinkage = { MODREV_1, &modlmisc, 0 }; _init() { return (mod_install(&modlinkage)); } _info(modinfop) struct modinfo *modinfop; { return (mod_info(&modlinkage, modinfop)); } #define FXGPUP0 0 /* Global priority for FX user priority 0 */ fxdpent_t config_fx_dptbl[] = { /* glbpri qntm */ FXGPUP0+0, 20, FXGPUP0+1, 20, FXGPUP0+2, 20, FXGPUP0+3, 20, FXGPUP0+4, 20, FXGPUP0+5, 20, FXGPUP0+6, 20, FXGPUP0+7, 20, FXGPUP0+8, 20, FXGPUP0+9, 20, FXGPUP0+10, 16, FXGPUP0+11, 16, FXGPUP0+12, 16, FXGPUP0+13, 16, FXGPUP0+14, 16, FXGPUP0+15, 16, FXGPUP0+16, 16, FXGPUP0+17, 16, FXGPUP0+18, 16, FXGPUP0+19, 16, FXGPUP0+20, 12, FXGPUP0+21, 12, FXGPUP0+22, 12, FXGPUP0+23, 12, FXGPUP0+24, 12, FXGPUP0+25, 12, FXGPUP0+26, 12, FXGPUP0+27, 12, FXGPUP0+28, 12, FXGPUP0+29, 12, FXGPUP0+30, 8, FXGPUP0+31, 8, FXGPUP0+32, 8, FXGPUP0+33, 8, FXGPUP0+34, 8, FXGPUP0+35, 8, FXGPUP0+36, 8, FXGPUP0+37, 8, FXGPUP0+38, 8, FXGPUP0+39, 8, FXGPUP0+40, 4, FXGPUP0+41, 4, FXGPUP0+42, 4, FXGPUP0+43, 4, FXGPUP0+44, 4, FXGPUP0+45, 4, FXGPUP0+46, 4, FXGPUP0+47, 4, FXGPUP0+48, 4, FXGPUP0+49, 4, FXGPUP0+50, 4, FXGPUP0+51, 4, FXGPUP0+52, 4, FXGPUP0+53, 4, FXGPUP0+54, 4, FXGPUP0+55, 4, FXGPUP0+56, 4, FXGPUP0+57, 4, FXGPUP0+58, 4, FXGPUP0+59, 2, FXGPUP0+60 2, }; pri_t config_fx_maxumdpri = sizeof (config_fx_dptbl) / sizeof (fxdpent_t) - 1; /* * Return the address of config_fx_dptbl */ fxdpent_t * fx_getdptbl() { return (config_fx_dptbl); } /* * Return the address of fx_maxumdpri */ pri_t fx_getmaxumdpri() { /* * the config_fx_dptbl table. */ return (config_fx_maxumdpri); }
System Administration Guide, Volume 1, System Interface Guide
October 15, 2002 | OmniOS |