1 /* BEGIN INCLUDE FILE abs_data.incl.pl1 */ 2 3 /* Absentee data is an array of entries that are threaded into a number of 4 different lists. The skip list is the only "real" list, in the sense that all 5 non-free entries are threaded into it, and the other lists (the defer, ready, cputime, 6 lc, and resource lists) each consist of subsets of the skip list. (The free list 7 does not count, as far as the logic goes, since it is just a list of free array 8 entries that can be used when a new entry is to be added to the skip list. If 9 there are no free entries, a new one is made at the end of the array.) 10 11 The skip, cputime, and readys are actually sixs, one per queue. The defer 12 list contains requests from all six queues, ordered by their deferred times. When 13 a deferred request reaches the head of the defer list, and then its time arrives, 14 it is moved to the tail of the ready list for its queue. Then it is marked as to 15 be run after the request which is currently at the end of its queue. The 16 intention is that when a request's deferred time arrives, it will be treated as 17 if it had just been entered. Requests in the ready list are ordered by their 18 deferred time, so when a request is found whose "position" in the queue (i.e., 19 the job it must be run after) has not yet reached the head of the queue, it 20 is known that none after it can be run either. A request that is deferred indefinitely 21 is placed at the end of the defer list, and when the operator releases it, it is 22 moved into the ready list as if its time had just arrived. 23 24 The resource list, although logically a separate list, is implemented as the 25 first part of the ready list, so the two can be searched as one continuous 26 list. It contains requests waiting for resource reservations. They are ordered 27 by their original queue positions, and they are each free to run as soon as 28 their required resources become available. A request refused login by load control 29 is waiting for a "resource" - namely a free slot in its load control group. 30 Thus it is held in the resource list. 31 32 Requests in the cputime list are deferred because their cpu time limits are higher 33 than their queue's max limit for the current shift. These requests are ordered by 34 their original queue positions. Whenever the max limit for any queue is raised, 35 the cputime list for that queue is scanned from the beginning for requests that 36 can now be run, and those requests are run before any more requests are taken 37 from the queue. 38 39 Requests in the skip list but in none of the others are jobs that are running 40 now, and should be deleted from the queue after they log out. 41 42 The run list is the first part of the skip list. It exists so that jobs started by 43 the abs run operator command can have skip list entries. Such jobs can not be put 44 at the tail of the skip list, because they have been taken from an arbitrary spot 45 in the queue, for immediate running, and the last skip list entry serves as an 46 indicator of where in the queue to read the next job from. 47 48 The load control list (lc list) is a single list (i.e., not one per queue), 49 made up of entries that are on the resource list for some queue. Entries 50 are placed in this list when they are deferred by load control. The purpose of this 51 list is to remember what users, projects, and groups are having their jobs deferred 52 by load control, so we can avoid trying to log in other jobs from the same 53 users, projects, or groups, when it is certian that they will also be deferred. 54 This list is built up as we try to find a job that can log in, and it is 55 destroyed just before we go blocked with no more work to do; it is NOT 56 destroyed when we go blocked with more work to do, after sending ourselves 57 an "aum_ctl" wakeup. 58 59 This segment is maintained by absentee_utility_ and dumped by dump_abs_data. 60 61 The padding is deliberately arranged to make the header 100 octal words long, 62 and each entry 40 octal words long, for convenient reading of octal dumps. 63 64 The segment is truncated and rebuilt at each answering service startup, 65 so there is no need to maintain compatibility with old versions of the structure. 66 67 Modified by T. Casey, May 1978, for resource reservations. 68 Modified by T. Casey, November 1978, for MR7.0, adding cputime list, and queues zero and foreground. 69 Modified by T. Casey, April 1979, for MR7.0a, to add deferral_logged bit. 70 Modified by T. Casey, June 1981, for MR9.0, to add group, person, project, and lc list variables. 71 72 */ 73 74 dcl ABS_DATA_version_2 fixed bin int static options (constant) init (2); /* version number of this declaration */ 75 76 dcl 1 absentee_data aligned based (adp), /* template of internal storage area */ 77 /* adp is declared (static or automatic) by users of this file */ 78 79 2 version fixed bin, /* version of this structure */ 80 2 last fixed bin, /* current number of entries */ 81 2 tail_free fixed bin, /* index of last free entry - if zero no free entry */ 82 2 head_defer fixed bin, /* index of first deferred request */ 83 2 tail_defer fixed bin, /* index of last deferred request */ 84 2 head_lc fixed bin, /* index of first entry on lc list */ 85 2 tail_lc fixed bin, /* index of last entry on lc list */ 86 2 rebuilding bit (1) unaligned, /* on if lists being rebuilt following loop in list search */ 87 2 asd_pad1 bit (35) unaligned, 88 2 last_rsc (-1:4) fixed bin, /* to detect when one pass thru resource list is done */ 89 2 asd_pad2 (2) fixed bin, /* pad to end of 2nd 8-word block */ 90 /* begin 6-element array of 8-word blocks */ 91 2 queue_data (-1:4) aligned, 92 3 head_ready fixed bin, /* index of first ready request in queue */ 93 3 tail_ready fixed bin, /* ........ last ready ................. */ 94 3 head_skip fixed bin, 95 3 tail_skip fixed bin, /* ........ last skip .................. */ 96 3 tail_run fixed bin, 97 3 tail_resource fixed bin, 98 3 head_cput fixed bin, 99 3 tail_cput fixed bin, 100 101 /* end of 8th 8-word block - the header is 64 words long and the entries begin at 100 octal */ 102 103 2 entry (0 refer (absentee_data.last)) aligned like abs_info; /* entries are 32 words long (40 octal) */ 104 105 dcl aip ptr init (null); 106 107 dcl 1 abs_info aligned based (aip), /* description of each entry */ 108 2 next_skip fixed bin, 109 2 prev_skip fixed bin, 110 2 next_defer fixed bin, 111 2 prev_defer fixed bin, 112 2 next_ready fixed bin, 113 2 prev_ready fixed bin, 114 2 next_cput fixed bin, 115 2 prev_cput fixed bin, 116 117 /* 10 octal */ 118 2 prev_free fixed bin, /* index of previous free entry in free list */ 119 2 queue fixed bin, 120 2 switches, 121 3 can_run bit (1) unaligned, /* part of ready list - if on can run */ 122 3 waiting_for_resources bit (1) unaligned, /* part of resource list */ 123 3 waiting_for_load_ctl bit (1) unaligned, 124 3 free_list bit (1) unaligned, 125 3 skip_list bit (1) unaligned, 126 3 defer_list bit (1) unaligned, 127 3 ready_list bit (1) unaligned, 128 3 resource_list bit (1) unaligned, 129 3 cput_list bit (1) unaligned, 130 3 run_list bit (1) unaligned, 131 3 deferral_notified bit (1) unaligned, 132 3 deferral_logged bit (1) unaligned, 133 3 lc_list bit (1) unaligned, /* entry is in lc list */ 134 2 lc_reason fixed bin (2) unsigned unaligned, /* 1=user limit; 2=project limit; 3=group limit */ 135 2 asd_pad3 bit (21) unaligned, 136 2 cpu_limit fixed bin, /* time limit, if on cput list */ 137 2 time fixed bin (71), /* part of defer list - deferred time */ 138 2 message_id bit (72) aligned, /* id of this request in the queue message segment */ 139 140 /* 20 octal */ 141 2 last_message_id bit (72) aligned, /* request which must be run before this request can */ 142 2 request_id fixed bin (71), /* request id of this request */ 143 2 group char (8), 144 2 prev_lc fixed bin, /* index of previous entry on load control (lc) list */ 145 2 next_lc fixed bin, /* index of next entry on lc list */ 146 147 /* 30 octal */ 148 2 person char (22) unaligned, 149 2 asd_pad4 char (1) unaligned, 150 2 project char (9) unaligned; 151 /* an entry is 40 octal words long */ 152 153 /* END INCLUDE FILE ... abs_data.incl.pl1 */