|
|
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: float sc_ratedecay; /* Decay rate for ``kl_rate'' */ ! 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 rate 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 max nice ``p_sharepri'' */ ! 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 DecayRate shconsts.sc_ratedecay ! 48: #define DecayUsage shconsts.sc_decay ! 49: #define Delta shconsts.sc_delta ! 50: #define Groups shconsts.sc_groups ! 51: #define LASTPARAM shconsts.sc_sparep[0] ! 52: #define MAXGROUPS shconsts.sc_maxgroups ! 53: #define MAXPRI shconsts.sc_maxpri ! 54: #define MaxSharePri shconsts.sc_highshpri ! 55: #define MAXUPRI shconsts.sc_maxupri ! 56: #define MaxUsage shconsts.sc_maxcusage ! 57: #define MAXUSAGE shconsts.sc_maxusage ! 58: #define MAXUSERS shconsts.sc_maxusers ! 59: #define MAXUSHARE shconsts.sc_maxushare ! 60: #define MINGSHARE shconsts.sc_mingshare ! 61: #define PriDecay shconsts.sc_pridecay ! 62: #define PriDecayBase shconsts.sc_pridecbase ! 63: #define Shareflags shconsts.sc_fl ! 64: #define TotUsage shconsts.sc_totusage ! 65: #define Users shconsts.sc_users ! 66: ! 67: /* ! 68: ** Share scheduling flags ! 69: */ ! 70: ! 71: #define NOSHARE 01 /* Don't run scheduler at all */ ! 72: #define ADJGROUPS 02 /* Adjust group usages */ ! 73: #define LIMSHARE 04 /* Limit maximum share */ ! 74: ! 75: #ifdef KERNEL ! 76: /* ! 77: ** Request software interrupt to run scheduler ! 78: */ ! 79: ! 80: #define setshsched() mtpr(SIRR, 0x1) ! 81: #define splshsched() splx(0x1) ! 82: ! 83: /* ! 84: ** Array of costs for a cpu tick biased by p_nice values. ! 85: */ ! 86: ! 87: extern long NiceTicks[]; ! 88: ! 89: /* ! 90: ** Table for pre-calculated priority decays. ! 91: */ ! 92: ! 93: extern float NiceDecays[]; ! 94: ! 95: /* ! 96: ** Table for pre-calculated rate increments. ! 97: */ ! 98: ! 99: extern float NiceRates[]; ! 100: #endif KERNEL ! 101: ! 102: #define _SHARE_ 1
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.