|
|
1.1 root 1: /*
2: ** Structure for active limits.
3: **
4: ** Used by the kernel and by programs such as "init" and "login".
5: */
6:
7: typedef short uid_t;
8:
9: struct lnode
10: {
11: uid_t l_uid; /* real uid for owner of this node */
12: u_short l_flags; /* (see below) */
13: u_short l_shares; /* allocated shares */
14: uid_t l_group; /* uid for this node's scheduling group */
15: float l_usage; /* decaying accumulated costs */
16: float l_charge; /* long term accumulated costs */
17: };
18:
19: /*
20: ** Values of limits "flags".
21: */
22:
23: #define ACTIVELNODE 001 /* this lnode is on active list */
24: #define LASTREF 002 /* set for L_DEADLIM if last reference to this lnode */
25: #define DEADGROUP 004 /* group account is dead */
26: #define GROUPUSAGE 010 /* this lnode's usage is affected by group */
27: #define CHNGDLIMITS 020 /* this lnode's limits have changed */
28: #define NOTSHARED 040 /* this lnode does not get a share of the m/c */
29:
30: /*
31: ** Kernel user limit structure.
32: */
33:
34: typedef struct kern_lnode * KL_p;
35:
36: struct kern_lnode
37: {
38: KL_p kl_next; /* next in active list */
39: KL_p kl_prev; /* prev in active list */
40: KL_p kl_parent; /* group parent */
41: KL_p kl_gnext; /* next in parent's group */
42: KL_p kl_ghead; /* start of this group */
43: struct lnode kl; /* the limits */
44: float kl_norms; /* normalised shares for this lnode */
45: float kl_eshare; /* effective share for this group */
46: float kl_gshares; /* total shares for this group */
47: float kl_temp; /* temporary for scheduler */
48: u_long kl_cost; /* cost accumulating in current period */
49: float kl_rate; /* run rate for this lnode */
50: u_short kl_refcount; /* processes attached to this lnode */
51: u_short kl_children; /* lnodes attached to this lnode */
52: u_long kl_muse; /* actual number of pages used */
53: };
54:
55: /*
56: ** Limits system call defines.
57: */
58:
59: #define L_MYLIM 0 /* get own limits structure */
60: #define L_OTHLIM 1 /* get other user's limits structure */
61: #define L_ALLLIM 2 /* get all active limits structures */
62: #define L_SETLIM 3 /* set limits */
63: #define L_DEADLIM 4 /* get zombie and limits structure of child */
64: #define L_CHNGLIM 5 /* change active lnode (limits only) */
65: #define L_DEADGROUP 6 /* get limits structure for dead group */
66: #define L_GETCOSTS 7 /* get share constants */
67: #define L_SETCOSTS 8 /* set share constants */
68: #define L_MYKN 9 /* get own kernel lnode structure */
69: #define L_OTHKN 10 /* get other user's kernel lnode structure */
70: #define L_ALLKN 11 /* get all active kernel lnode structures */
71:
72: /*
73: ** Kernel lnode table.
74: */
75:
76: #ifdef KERNEL
77: extern KL_p lnodes;
78: extern KL_p lnodesMAXUSERS;
79: extern KL_p lastlnode;
80: extern int maxusers;
81:
82: extern float zerof;
83: extern float onef;
84: extern float twof;
85: #endif KERNEL
86:
87: #define _LNODE_ 1
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.