COMPILATION LISTING OF SEGMENT start_governor_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/04/82 1642.7 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 start_governor_: proc (ratiop, interval_lengthp); 12 13 /* This is the governor section of the LSS. It is seperate 14* so you can use it just to do the function of governing and 15* have other functions done by other routines (such as 16* accounting. 17* 18* Coded Nov 1970 by Dan Bricklin */ 19 /* Updated 7/22/76 to current version PL/I by S. Herbst */ 20 21 dcl 22 (addr, divide, float) builtin, 23 ioa_ ext entry options (variable), 24 clock_ ext entry returns (fixed bin (71)), 25 hcs_$usage_values ext entry (fixed bin (35), fixed bin (52)), 26 create_ips_mask_ ext entry (ptr, fixed bin (17), bit (36) aligned), 27 hcs_$set_ips_mask ext entry (bit (36) aligned, bit (36) aligned), 28 start_governor_$cput_int ext entry, 29 timer_manager_$sleep_lss ext entry (fixed bin (71), bit (2) aligned), /* timer_manager_ takes care */ 30 timer_manager_$cpu_call_inhibit ext entry (fixed bin (71), bit (2) aligned, entry), /* of handling timer interrupts */ 31 timer_manager_$reset_cpu_call ext entry (entry), 32 ((ratio, interval_length) int static, ratiop, interval_lengthp) fixed bin (17), 33 ((last_real, until) int static, now) fixed bin (71), 34 (cpu_last int static, cpu_now) fixed bin (52), 35 page_waits fixed bin (35), 36 cpu_allowed int static fixed bin (71), 37 ((quit_mask, all_mask) int static, mask) bit (36) aligned, 38 quited_in_cput bit (1) aligned int static, 39 time fixed bin (17), 40 quit condition, 41 all (1) char (32) aligned static int init ("-all"), 42 ips_names (1) char (32) aligned static int init ("quit"); 43 44 45 ratio = ratiop; /* save these values */ 46 interval_length = interval_lengthp; 47 /* prepare for ratio checking interrupts */ 48 49 if ratio > 0 & interval_length > 0 then do; /* only do ratio checking if ratio is greater than zero */ 50 call create_ips_mask_ (addr (ips_names), 1, quit_mask); /* get a mask for quits to be used later */ 51 quit_mask = ^quit_mask; /* make a mask for everything but quit and save */ 52 call create_ips_mask_ (addr (all), 1, all_mask); /* get a mask for nothing */ 53 all_mask = ^all_mask; 54 last_real = clock_ (); /* get time and save it */ 55 call hcs_$usage_values (page_waits, cpu_now); 56 cpu_last = cpu_now + 3000000; /* save current cput plus extra for burst */ 57 cpu_allowed = divide (interval_length*1000000, ratio, 71, 0); 58 /* cpu time allowed in real interval */ 59 call timer_manager_$cpu_call_inhibit (cpu_allowed+cpu_last, "00"b, start_governor_$cput_int); /* set timer */ 60 end; 61 62 return; 63 64 65 /* This section of code is executed every "cpu_allowed" cpu seconds and checks to see */ 66 /* if the amount of cpu time used per real time is in keeping with the ratio. If it is, */ 67 /* control is returned, after setting up the next interrupt to occur. If it is too high a */ 68 /* usage rate, the process is put to sleep long enough to bring the ratio to the acceptable level. */ 69 70 cput_int: entry; /* entry on cpu time interrupt */ 71 72 quited_in_cput = "0"b; 73 now = clock_ (); 74 call hcs_$usage_values (page_waits, cpu_now); 75 if divide (now - last_real, cpu_now - cpu_last, 17, 0) >= ratio then do; 76 /* if not over using, then do */ 77 last_real = now; 78 GOOD: cpu_last = cpu_now; 79 call timer_manager_$cpu_call_inhibit (cpu_allowed+cpu_now, "00"b, start_governor_$cput_int); /* set timer */ 80 if quited_in_cput then do; 81 call hcs_$set_ips_mask (all_mask, mask); /* restore mask to allow everything */ 82 revert condition (quit); 83 signal condition (quit); /* do a quit that the user wanted */ 84 end; 85 return; 86 end; 87 /* if used too much cpu time */ 88 until = last_real + (cpu_now - cpu_last)*ratio; /* 'till when to sleep */ 89 90 on condition (quit) begin; /* set up quit handler */ 91 now = clock_ (); 92 time = divide (until-now, 1000000, 35, 0); 93 if time>60 then call ioa_ ("Will quit in ^.1f minutes", float (time, 27)/60.e0); 94 else call ioa_ ("Will quit in ^d seconds", time); 95 quited_in_cput = "1"b; 96 end; 97 98 call hcs_$set_ips_mask (quit_mask, mask); /* mask everything but quits */ 99 call timer_manager_$sleep_lss (until, "00"b); /* go to sleep */ 100 last_real = clock_ (); 101 go to GOOD; /* set timer */ 102 103 104 105 /* This entry stops the governing of cpu time */ 106 107 stop_governor_: entry; 108 109 call timer_manager_$reset_cpu_call (start_governor_$cput_int); 110 return; 111 112 113 end start_governor_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/04/82 1613.5 start_governor_.pl1 >dumps>old>recomp>start_governor_.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. addr builtin function dcl 21 ref 50 50 52 52 all 000025 internal static char(32) initial array dcl 21 set ref 52 52 all_mask 000023 internal static bit(36) dcl 21 set ref 52* 53* 53 81* clock_ 000050 constant entry external dcl 21 ref 54 73 91 100 cpu_allowed 000020 internal static fixed bin(71,0) dcl 21 set ref 57* 59 79 cpu_last 000016 internal static fixed bin(52,0) dcl 21 set ref 56* 59 75 78* 88 cpu_now 000102 automatic fixed bin(52,0) dcl 21 set ref 55* 56 74* 75 78 79 88 create_ips_mask_ 000054 constant entry external dcl 21 ref 50 52 divide builtin function dcl 21 ref 57 75 92 float builtin function dcl 21 ref 93 hcs_$set_ips_mask 000056 constant entry external dcl 21 ref 81 98 hcs_$usage_values 000052 constant entry external dcl 21 ref 55 74 interval_length 000011 internal static fixed bin(17,0) dcl 21 set ref 46* 49 57 interval_lengthp parameter fixed bin(17,0) dcl 21 ref 11 46 ioa_ 000046 constant entry external dcl 21 ref 93 94 ips_names 000035 internal static char(32) initial array dcl 21 set ref 50 50 last_real 000012 internal static fixed bin(71,0) dcl 21 set ref 54* 75 77* 88 100* mask 000105 automatic bit(36) dcl 21 set ref 81* 98* now 000100 automatic fixed bin(71,0) dcl 21 set ref 73* 75 77 91* 92 page_waits 000104 automatic fixed bin(35,0) dcl 21 set ref 55* 74* quit 000110 stack reference condition dcl 21 ref 82 83 90 quit_mask 000022 internal static bit(36) dcl 21 set ref 50* 51* 51 98* quited_in_cput 000024 internal static bit(1) dcl 21 set ref 72* 80 95* ratio 000010 internal static fixed bin(17,0) dcl 21 set ref 45* 49 57 75 88 ratiop parameter fixed bin(17,0) dcl 21 ref 11 45 start_governor_$cput_int 000060 constant entry external dcl 21 ref 59 59 79 79 109 109 time 000106 automatic fixed bin(17,0) dcl 21 set ref 92* 93 93 94* timer_manager_$cpu_call_inhibit 000064 constant entry external dcl 21 ref 59 79 timer_manager_$reset_cpu_call 000066 constant entry external dcl 21 ref 109 timer_manager_$sleep_lss 000062 constant entry external dcl 21 ref 99 until 000014 internal static fixed bin(71,0) dcl 21 set ref 88* 92 99* NAMES DECLARED BY EXPLICIT CONTEXT. GOOD 000233 constant label dcl 78 ref 101 cput_int 000170 constant entry external dcl 70 start_governor_ 000031 constant entry external dcl 11 stop_governor_ 000447 constant entry external dcl 107 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 640 730 472 650 Length 1132 472 70 165 145 36 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME start_governor_ 100 external procedure is an external procedure. on unit on line 90 86 on unit STORAGE FOR INTERNAL STATIC VARIABLES. LOC IDENTIFIER BLOCK NAME 000010 ratio start_governor_ 000011 interval_length start_governor_ 000012 last_real start_governor_ 000014 until start_governor_ 000016 cpu_last start_governor_ 000020 cpu_allowed start_governor_ 000022 quit_mask start_governor_ 000023 all_mask start_governor_ 000024 quited_in_cput start_governor_ 000025 all start_governor_ 000035 ips_names start_governor_ STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME start_governor_ 000100 now start_governor_ 000102 cpu_now start_governor_ 000104 page_waits start_governor_ 000105 mask start_governor_ 000106 time start_governor_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. fx1_to_fl2 call_ext_out_desc call_ext_out return mpfx2 signal enable ext_entry int_entry divide_fx3 divide_fx4 THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. clock_ create_ips_mask_ hcs_$set_ips_mask hcs_$usage_values ioa_ start_governor_$cput_int timer_manager_$cpu_call_inhibit timer_manager_$reset_cpu_call timer_manager_$sleep_lss NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000025 45 000036 46 000041 49 000043 50 000047 51 000065 52 000071 53 000107 54 000113 55 000121 56 000132 57 000136 59 000144 62 000166 70 000167 72 000175 73 000177 74 000205 75 000216 77 000231 78 000233 79 000236 80 000260 81 000263 82 000273 83 000274 85 000277 88 000300 90 000304 91 000320 92 000327 93 000337 94 000364 95 000406 96 000411 98 000412 99 000423 100 000436 101 000445 107 000446 109 000454 110 000467 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved