|
|
1.1 root 1: /*
2: ** Share scheduling parameters
3: */
4:
5: struct sh_consts
6: {
7: /** Parameters **/
8:
9: u_short sc_fl; /* Scheduling flags */
10: u_short sc_delta; /* Run rate for scheduler in secs. */
11: u_short sc_maxusers; /* Max. number of active users */
12: u_short sc_maxgroups; /* Max. group nesting */
13: u_long sc_sparep0; /* <spare> */
14: float sc_maxpri; /* Max. absolute priority */
15: float sc_maxupri; /* Max. priority for a normal process */
16: float sc_maxusage; /* Max. usage considered */
17: float sc_decay; /* Decay factor for ``l_usage'' */
18: u_long sc_pridecbase; /* Base for decay for ``p_sharepri'' */
19: u_long sc_syscall; /* Cost of system call */
20: u_long sc_bio; /* " " logical block i/o */
21: u_long sc_tio; /* " " stream i/o */
22: u_long sc_tick; /* " " cpu tick */
23: u_long sc_click; /* " " memory tick */
24: float sc_pridecay; /* Decay rate for maximally niced processes */
25: float sc_maxushare; /* Factor for max effective user share */
26: float sc_mingshare; /* Factor for min effective group share */
27: u_long sc_sparep[1]; /* <spare> */
28:
29: /** Feedback **/
30:
31: float sc_totusage; /* E{1/kl.l_usage} */
32: float sc_sparef0; /* <spare> */
33: u_short sc_users; /* Number of active users */
34: u_short sc_groups; /* Number of active groups */
35: float sc_highshpri; /* High value of p_sharepri */
36: float sc_maxcusage; /* Max. current usage */
37: u_long sc_syscallc; /* Total counts of system calls */
38: u_long sc_bioc; /* " " " logical block i/o */
39: u_long sc_tioc; /* " " " stream i/o */
40: u_long sc_tickc; /* " " " cpu ticks */
41: u_long sc_clickc; /* " " " memory ticks */
42: u_long sc_sparef[4]; /* <spare> */
43: };
44:
45: extern struct sh_consts shconsts;
46:
47: #define DecayUsage shconsts.sc_decay
48: #define Delta shconsts.sc_delta
49: #define Groups shconsts.sc_groups
50: #define LASTPARAM shconsts.sc_sparep[0]
51: #define MAXGROUPS shconsts.sc_maxgroups
52: #define MAXPRI shconsts.sc_maxpri
53: #define MaxSharePri shconsts.sc_highshpri
54: #define MAXUPRI shconsts.sc_maxupri
55: #define MaxUsage shconsts.sc_maxcusage
56: #define MAXUSAGE shconsts.sc_maxusage
57: #define MAXUSERS shconsts.sc_maxusers
58: #define MAXUSHARE shconsts.sc_maxushare
59: #define MINGSHARE shconsts.sc_mingshare
60: #define PriDecay shconsts.sc_pridecay
61: #define PriDecayBase shconsts.sc_pridecbase
62: #define Shareflags shconsts.sc_fl
63: #define TotUsage shconsts.sc_totusage
64: #define Users shconsts.sc_users
65:
66: /*
67: ** Share scheduling flags
68: */
69:
70: #define NOSHARE 01 /* Don't run scheduler at all */
71: #define ADJGROUPS 02 /* Adjust group usages */
72: #define LIMSHARE 04 /* Limit maximum share */
73:
74: #ifdef KERNEL
75: /*
76: ** Request software interrupt to run scheduler
77: */
78:
79: #ifdef vax
80: #define setshsched() mtpr(SIRR, 0x1)
81: #define splshsched() splx(0x1)
82: #endif
83: #ifdef sun
84: #define setshsched() softcall(share, (caddr_t)0);
85: #define splshsched() spl1()
86: #endif
87:
88: /*
89: ** Array of costs for a cpu tick biased by p_nice values.
90: */
91:
92: extern long NiceTicks[];
93:
94: /*
95: ** Table for pre-calculated priority decays
96: */
97:
98: extern float NiceDecays[];
99: #endif KERNEL
100:
101: #define _SHARE_ 1
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.