Вы находитесь на странице: 1из 4

versal ~

of fre~ ~i Muhiprogram S heduhng C •


¢" re,noii~
usage; Parts 1 and 2. Introduction and Theory*
oth logi~
gets t h!
b jeers an E. F. CObb, I B M Corp., Poughkeepsie, N. Y.

Ab.stract. In order to exploit fully a fast computer which pos-


sesses simultaneous processing abilities, it should to a large ex-
tent schedule its own workload. The scheduling routine must be
capable of extremely rapid execution if i$ is not to prove self-
defeating.
The construction of t~ schedule entails determining which pro-
grams are to be run concurrently and which sequentially with re-
spect to each other. A concise scheduling algorithm is described
which tends to minimize the time for executing the entire pending
workload (or any subset of it), subject to external constraints
such as precedence, urgency, etc. The algorithm is applicable to
a wide class of machines.

P A R T 1. I N T R O D U C T O R Y R E M A R K S

1.1. S c h e d u l i n g E n v i r o n m e n t rating merely affects the order in which programs are


Scheduling requirements are bound to vary a great deal considered by the scheduling algorithm. The time taken
from one computing installation to another. Factors which to process a given set of programs may be prolonged if
contribute to this variation are: it is stipulated that certain ones are to be given urgent
a. the nature of the jobs to be processed, attention. An additional way in which urgency can be
b. the amount of surplus capacity which the equipment handled will become apparent later.
possesses in relation to the normal load of work, Precedence is a second important concept. The com-
c. the pattern of arrival of workload (e.g., is it heavily pletion of one program may be essential before some other
peaked?), can be started; results or o u t p u t from the first become
d. operating and service policies. operands or input for the second. This kind of precedence,
In spite of these variations, it seems worthwhile to at- which stems from causes external to the scheduling, should
tempt to define a scheduling algorithm that can form a be distinguished from precedence that is inevitably gen-
common foundation upon which many installations may erated by the scheduling algorithm whenever a schedule
build by adding routines oriented toward their particular is produced. T r e a t m e n t of externally derived precedence
needs. will be described in Part 4* of this paper.
The reasonableness of such an objective is already The arrival rate and consumption rate of work to be
recognized for large-scale machines. I t is doubly rein- processed determine the extent to which a backlog of
forced by the existence of machines capable of execut- work builds up. This in turn places a limit on how far
ing concurrently two or more (related or unrelated) ahead one m a y schedule the machine. It is desirable that
programs. The complexity of scheduling work for such ma- the scheduling algorithm be adaptable to extreme varia-
chines is far beyond the capabilities of the normal operat- tions in the extent of the backlog, including the case of no
ing staff. Further, scheduling decisions must be made with backlog at all with in-flow of work at a mere trickle. For
great rapidi W in order to be useful; human beings by this reason, the scheduling algorithm can be executed in
themselves cannot make such decisions rapidly enough. either of two modes. In the static mode, generation of a
We consider first several concepts which appear to ap- schedule is separated from its execution. Consequently, it
is reasonable to corrsider generating a number of trial
ply to numerous installations. Urgency is one of the most
schedules, select the best one and then execute it. In the
f~miliar of these concepts. At any particular time it may
dynamic mode, the scheduling activity consists solely of
be more urgent to process one job than some other. Each
augmenting an existing schedule; this activity is quite
~rp job would thus have an urgency rating generated in a intimately interleaved with execution. The static mode is
Erb manner dictated by a particular installation's own re- clearly applicable only when an adequate backlog of nn-
quirements. The interpretation, however, may be as- scheduled work exists. The dynamic mode, on the other
sumed to be fixed, providing the interpretation is suffi- hand, may be applied in all situations.
ciently general. In the scheme proposed here the urgency Another kind of adaptability needed by a scheduling
* P:rrts 3 and 4, Scheduling Algorithm and External Con- algorithm is tire ability to cope with time information of
str'dnts, will ~Lppear in a future issue. varying degrees of reliability and, in the extreme case,

Communications of the ACM 347


with a complete absence of such infonm~tion. In this con- 1.3. F o r m o f P r o g r a m s
neetion, degraded versions of the algorit~hm will be dis-
cussed in P a r t 4.
Programs are assumed lo be fully relocatable prior t0
execution -wi~h ~o dependence on specific assignments 0f
iisrepl
~le0l're~
space (including input-output, traits), or necessary ass0. iiare t.(
1.2. Class o f M a c h i n e s
elation with a specific member of a, set ()f i~crchangeable itcedur
The algorithm is intended to be applicable to a wide time-shared facilities. However, programs are not re-
class of machines, called multiple facility systems. Such quired to be relocatable during execution.
a system consists of " a number of connected facilities, Programs and data :u'e not :~ssumed to be segmented
each capable of operating simultaneously (and, except for or orgmfized into modules of any pre(tetermiimd size. &
memory references, independently) on programs which installation may, however, superimpose such a policy;
need not be related to one another" [1]. The sharing of some types of machine m a y so dictate.
time or space on a facility nmst be controllable in a flexible
way to insure that the scheduling effort will be rewarding. 1.4. E x p l a n a t o r y N o t e
A multiple facility system is quite likely to contain The remainder of this paper is divided into three parts.
several facilities of the same k i n d - - f o r example, two Part, 2 deals with a formulalion of the scheduli~g problem,
similar arithmetic units or several similar tape channels. ignoring for the t.ime being the dynamic mode and external
A group of similar facilities is treated as a single composite constrMnts such as precedence, urgency, eLc. From this
facility by the scheduling algorithm. It, is assumed tha~ formulation, four types of lower bounds are derived for
the work scheduled for a composite facility is subdivided the execution time of the pending workload. These bounds
by a separate and subsequent allocation algorithm. The are used as a basis for the (essentially empirieM) Mgorithm
special case of subdividing the work assigned to a set of described in Part 3. External eonstrmnts are introduced in 0
tape channels and tape units is a sufficiently independent P a r t 4, and the scheduling Mgorithm is extended to handle 10usl
topic to warrant treatment in a separate paper. them. b;
P A R T 2. T H E O R E T I C A L C O N S I D E R A T I ( ) N S }i!~lla~i

2 .1. T h e P r o b l e m time ti are very hkelv • to b¢~ approxun'~te. . . In . supplying. txvhi


I
Su,mose we are oiven a nmlti,qe facility svatem eoui,~,-cd time information the progranm~er m a y expe( g assistance ittm~
with two kinds of facilities--those which mav be time- IIOrIl
" t'h e s'u p e t.v"l:s"o t y s v~" ~ t e n l . N u ( ~'
n aSSlS;~t
,c~!', ~: (;e . . m. .a y tal(e 1s
i!in
~a..... a .... ~, +,. . . . . . . ~.;~ ...... ~............. ~............ ~ ~a..... a
~Dltltl~lblKuM (blliJt LIII.],D(7 I~VIIIID|| lllay k)~.: ~l.)aCg-/lllIC;lll.~,Jl'V/-Sl.l~[IrvTkl[.
the term ot tmle studies (made during a pr(vmus run) of
1 J " /
l
'ika.
\ o e . . • -, • i~ . . , iI¢D,
A ~.et of programs ,, is to be executed so as~ to minimize the selected
. . seettons
. . . .of h~s P ~ogtam . . . . : • I o~. m tmy programs . ~t ~
time for the whole set would be reasonable to expect the tram fractions to be 1
Each program i takes time t~ to be executed when run aeeutate
:" "" at least., ~ ' to ~ ~he
. . . . . nea~e.~t ' "~' quattel
" "'.
nlano ~,.a f .... +l.;~, 1..... +u ..# .: ........... e..~+: . . . . . . . . .
....... } allkl l~Jl blll~ 1UtlSmOtl. KJI IJllllkJ kite} lli;tbblUllD Dik ~ lij ~
Programs will often deviate from their anticipated
. . " .
:{
sl'

~,~. . . . . +;~m,~ ~¢ +u. . . . . . . . . . A +;. . . . . . ;~,~,1. . . . . . . . . . . . elapsed tnnes. Because over-running m a y seriously upset 10(
facility k and time facility j a schedule, a limit is placed on the extent of over-run, lsei
Let us further suppose t h a t the a d j a c e n c y c o n s t r a i n t ap- When this limit is exceeded, the program in question is :/!yi
set aside for external superwsory" consideration or treat- ~24
plies to every space facility; that is, for every program i ment bv an installation-oriented routine. ~i
and space facility k, it is necessary that the space fraction
S~k be allocated so t h a t program i occupies a set of adja-
cent locations on facility k. Normally, this constraint 2.3. S p a c e Fra('tion D i a g r a m
applies to core and disk storage but not to tape unit aL Consider space facility k. Take space fraction for this
location. facility as ordinate and elapsed time as abscissa. Then, the
Note that any subset of programs selected to be run space-time provided by this facility is represented by the
concurrently must meet the requirement that the total
space fraction used by the subset on each Space facility
SPACE ,~-
does not exceed urfity. The scheduling problem does not FRACTION |
r e q u i r e that an upper bound be imposed on the total time LOAD |
fractions. Neither does it p r e c l u & such action. As we shall
(o.,,~~.. .... (®.,
see, the procedure described herein treats space fractions ./5-5
75~~;~5"7 re
(O
,)
and time fractions in a near-symmetric way, and art u p p e r
_ _ -

ii1~!
(0,O)~ ELAPSEDT~ME
b o u n d is i m p o s e d on total time fractions.
F:[c. 1. S p a c e f r a c t i o n dia, gr~mt
2.2. A c c u r a c y o f S c h e d u l i n g D a t a
We ,nay assume the space fractions S~k to be exact. On rectangular domain (0, 0), (0, 1), (',~, I), (.'~
the other hand, the time fractions r~ and expected elapsed is shaded in figure I.

348 C o m m u n i c a t i o n s o f the ACM


The demand of program i for' space-time on facility k time of the given programs:
is represented by ~ rectangle of height s~ and base t i . The
Eli = Eriiti
corresponding rectangles for all programs of the given set i
ssary are to be packed into the rectangular domain by a pro-
Again, there is a bound of this type for each time-
cedure which will be described later. An example of pack-
shared facility. The space arid time fraction diagrams are
re referred to collectively as the load diagrams.
i 2,
segm
ed Sil
!it I
2.5. T y p e o f Mixes
T h e term mia; is applied to a set> of programs either
(0,I)
I a, li I planned to be in the execution phase together or actually
<///////)/////////J
.... P~
being executed concurrently. A feasible mix is a set of
SPACE programs for which the space fr'~clion sum on each space-
FRACTION
LOAD shared facility is less than or equal to unity.
thr~e The fact that a given mix is feasible does not imply that
t~g pg .4 P3 it can be executed efficiently- that is, in less time than
~nde~ it would take to execute these programs one at a time.
r,'slili:I
derD¢~
(0,0)
b<- T
ELAPSED
TIME
Consider, for example, a mix consisting of two programs,
which for some time-shared facility have time fractions
ti'~<}. 2, F i v e p r o g r a m s on a s p a e e - s h ~ r e d f a c i l i t y each equal to unity. Clearly, there is rio time advantage
aigiit< in rumfing these programs together; there may aetually be
Of course, the packing must be implemented simultane- a disadvantage due to the extra supervisory overhead in-
ously on all facilities. In other words, if space is allocated curred. A mix is said to be profitable if it is feasible and
to program i on facility k between time t and t + t ~ , then contains no pair of programs each of which demands a
space must be allocated to this program on all other time fraction of unity on some common facility.
l i facilitiesbetweenthese sametwo times 2.6. P a i r w i s e I n f e a s i b l e a n d Unprofitable S u b s e t s
The abscissa T of the rightmost edge of the rectangle
sup! which extends farthest to the right (i.e., along the elapsed A pairwise infeasible subset consists entirely of programs
n
~a~;i,,0~t i m e axis) represents the least time in which the schedule of which no two form a feasible mix. It is Clear that pro-
~ ° ~ : represented by the diagram can be executed. Suppose that, grams belonging to a pairwise infeasible subset must be
instead of the loose packing indicated in the diagram, we run one after the other. Hence, the sum of their elapsed
have a perfectly tight packing into a rectangle of dimen- times is a lower bound for the execution time of the whole
sions 1, vk. Then, we m a y write, by smnming areas, set. Accordingly, there exists a lower bound of this type
for every such subset.
Vk ~ E Sikti
An improved set of lower bounds is obtained by con-
D

sidering every pairwise unprofitable subset. Such a subset


Clearly Vk is a lower bound for the execution of the given
consists entirely of programs of which no two form a
set of programs. There are as m a n y lower bounds of this
profitable mix. For every such subset the sum of the
type as there are space facilities.
elapsed times of the member programs is a lower bound.
2.4. T i m e F r a c t i o n D i a g r a m T h e greatest of these lower bounds clearly belongs to the
longest pairwise unprofitable subset.
'me fraction loading of a time-shared facility may
sented by a diagram similar to the space fraction
for a space-shared facility. However, the total (O,R) P I " ((o,R)
etion at any instant is limited only by the upper TIME
FRACTION
if any) imposed by the scheduling procedure. LOAD
ample is given in figure 3 of a time fraction dia-
r 5 programs on facility j with start-stop times as
:t in the example of a space fraction diagram.
ever the total time fraction on some facility ex-
nity, one or more of the programs using that (o,o)
ELAPSED TIME
will receive service from it at, a reduced rate, arid
,sod times of these programs will accordingly be FIG. 3. F i v e p r o g r a m s oil a t i m e - s h a r e d f ' m i l i t y
t.
program i requires of facility j an amount rijti of
2.7. S u m m a r y o f Lower B o u n d s
regardless of the rate at which it receives this
service. If tiffs quantity is summed over all programs, we We have seen that there exist the following types of
(° obtain a second type of lower bound for the execution lower bounds for the execution time of a given set of pro-

Communications of the ACM 349


grains: dora in specifying values for these limits may be used to
generate M t e r n a t i v e schedules on. ~ tr:i~:fl b~sis. These
Ca) ~ rijti , one for each j,
schectules nm, y lhen be evMual:ecl a,s described below in
secti(m 2.10.
(b) ~ Sikti , one for each k,
i
(c) execution time of each pairwise unprofitable subset. 2.9. L o a d a~<t L i m i t V e c t o r s

In addition to these, the execution time t~ of each program For conveniet~ce, we treat the spa.co H,~(t i.ime fractions
represents a fore'ill type. All four types of bounds are of a program as compot~ents of a single vect;or, known as
independent; that. is, any one of them may be the greatest the load vector for that program. The loasl vet{or for a
lower bound of atl. given mix is simply the sum of lhe Ioa.d vectors of all the
These bounds may be readily computed and the value programs p:,r{icipa.ting iu ihat mix.
(T, say) of the greatest determined. While other lower The lower and uppe)' limits for each fatility *nay be
Wh~
bounds exist, they are less :readily e(.)mputed and will not tre:~ted similarly as components of ~ 5>'l.t:cr Zi~it vector b
east-s
not be discussed here. and an W)per limit vector B, respectively,
)~a.in
For every mix we now require that; e~ch c()mponent 0f
2.8. P r i n c i p l e o f U n i f o r m L o a d i n g T0r i
it.s load vector be less than or equal to the correspoMing
ium0:
The ,greatest lower bound T for the execution time of a component of the upper limit vector B. It' at: any time
~r0gr~
given set of programs m a y be used to determine for each during the generation of a mix every component of the ieim
facility the degree of loading which is necessary if this mix load vector e(tuals or exceeds the corresponding com. ar re
greatest lower bound is to be attained. Of course, this ponent of tile lower limit vector b, no more programs are :cries
theoretical loading and the greatest lower bound itself added to t h a t mix. ilher
may well be unattainable. For a time-shared facility j and }dter
a space-shared facility k, the necessary degrees of loading 2.10. Evaluation of a Schedule
ihta 1
are, respectively: We may expect that the execution time ot' m~y given It i~
E Sikti program will be extended when run concurrently with , sh0
~ 'r~t~ and i other programs due to delays in getting service from time- mpl0
T T shared facilities. These delays become significant when uire
We shall refer to these quantities as target loadings. the time fraction load on one or more facilities exceeds ited
In generating the early part of a schedule, it is possible unity. (;iv
through poor placement of programs to underload a time- For the sake of simplicity, schedules ,nay be generated >isd
shared or space-shared facility to such a degree that the ignoring these delays, tIowever, in comparing two sched- :{
ules, allowance should be made for them; otherwise, an

lwl,er
bound T cannot possibly be attained even if a perfect
packing is assumed for the remaining programs. It is also erroneous result may be obtained. Suc[h allowance can-
possible to overload a time-shared facility to such an ex- not be anything but approximate clue to inadequacies in
the information available concerning the behavior of each
tent that the time for executing the given set of programs
is agmn unnecessarily prolonged. program. I ae,
It is clear that, if the degree of loading of each facility Consider the time interval between successive mix
remMned at its target value defined above, the shortest changes (a mix change occurs whenever a program begins
possible schedule would be obtained. However, it is also or ends). Let. this time interval be of magnitude At, before
clear that in practice such an ideally uniform loading will allowance is made for extension. Let X be the maximum
normMly be unattainable. A less stringent goal must be time fraction load which the pertinent mix places on the
accepted. time-shared facilities. Then at, approximate value for the UlII
Accordingly, we set lower and upper limits upon the extended time interval for the mix is
loading of each facility. The upper limit for a space-shared
A t . m a x (i, X).
facility Should always be set to unity, since any greater
value is useless and any lesser value m a y lengthen the By summing the extended time intervMs for all mixes,
schedule unnecessarily. For t h e same reason, the upper we obtain an approximate execution time for the schedule.
limit for a time-shared facility should not be set to a value
less than unity, but it, certainly m a y exceed unity. Within REFERENCE
these constraints it is desirable t h a t for each facility the
1. E. F. CODD, •. S. LowRY, 1!]. i.~'[¢l)ONOU(ai, ([~+A. SCALZI,5.[ul-
mean of the lower and upper limits be as close as possible tiprogramming S T R E T C H : Feasibility Considcr~ti0ns.
to tlhe corresponding target loading. The remMning free- Corrt*r~. A C M 2 (November 1959). ! 21[

]i~ e,

350 C o m m u n i c a t i o n s of t h e ACM

Вам также может понравиться