Você está na página 1de 41

| 

  


   
 
  


Vikas Kurdia
(Asst. Professor C.S. Department)
(M.Tech Coordinator C.S. & I.T. Department)
4 
G ^ ua unit of work that is carried out by the
system (4 )
G   u a set of related jobs that provide some
system function ( Ñ è { J, J , « , J } )
G task a generalization of a class of jobs
± tasks are specified at design-time
G job J k instance of task i
± jobs occur at run-time

h
4  

G   u timing constraints and behaviour
G 
 


u dependencies among jobs
(or among tasks)
G =

u intrinsic parameters of work
G   u active (processor) and passive
(resource) components required

Îct 19/09 3

 
 
4 
G includes    and 
G =  
  u (ri , di)
± It does not include ri
± but includes di
G also includes execution time ( )

X
Sch h 
G   u all jobs are always allocated required
resources to complete execution within their feasible
regions ( r, d )
G   
   u decides the order in which
jobs are allocated resources
G    u a module that implements a scheduling
algorithm
G   
  

u point in time when
scheduler decides which job to execute next

†
Sch 
G   u assignment of jobs to available
processors
G =     every job starts at or after
its release time and completes by its deadline
G    
   u always
produces a feasible schedule if at least one
feasible schedule exists

]
( Liu Ch. X )
|

 ch  


 
Sch 
G| 
 
  scheduling
decision points are specified !  (static)
G     

 weighted jobs join
a FIFÎ queue ± weight determines amount of
processor time allocated to the job
G 


 u scheduling
decisions are made as events occur (dynamic)
± schedule ready job with highest priority

6
| c  Sch 
G job parameters are known ! 
G job schedule precomputed off-line and
stored as a table for use at run-time
  
  
G scheduling decision times in clock-driven
system is defined ! ;
± scheduler periodically wakes up and generates
next portion of the schedule

Ú
| c  Sch 
G Applicable when system is deterministic
± only a few aperiodic and sporadic jobs
G Some assumptions
± Require periodic tasks in the system
± task parameters known a priori
± each job is ready for execution as soon as it is
released

9
S

 
G wach task denoted by the tuple
(øi, pi, ei, Di)
G Sometimes only the period and execution
time is provided all tasks have a
± relative deadline è period job ready at time 0
± phase è 0  

 at time è 0 !
± denote tasks as pair  

10
Let¶s take an example we have four independent periodic task.

T1è(X,1) Thè(†,1.Ú) T3è(h0,1) TXè(h0,h)

T1T3 Th T1 TX Th T1 Th T1 T1 Th

schedule was designed arbitrarily!

11
Let¶s take an example we have four independent periodic task.

T1è(X,1) Thè(†,1.Ú) T3è(h0,1) TXè(h0,h)

cycles every
critical slack time hyperperiod
instant H è h0
critical
instant
T1 T3 Th T1 TX Th T1 Th T1 T1 Th

0 h X ] Ú 10 1h 1X 1] 1Ú h0

schedule was designed arbitrarily!

1h
| c   ch
G Consider four independent periodic task.
T1è(X,1) Thè(†,1.Ú) T3è(h0,1) TXè(h0,h)

HwRw hyper periodic is L.C.M of p1,ph,p3,pX, mean L.C.M. of X,†,h0,h0


then h0.

It mean after tèh0 the entire schedule consist of replicated segment of length x
here

N is h0/X + h0/† + h0/h0 + h0/h0 è †+X+1+1è11

Here hyper periodic is h0 and number of jobs that is scheduled under hyper
period is 11
S
    
Sch  

   
 
 
G organize ³blocks of activities´ in hyperperiod
burst start timesu
0 X ].† 1h 1] 1Ú
1 h 3 X † ]
T1 T3 Th T1 TX Th T1 Th T1 T1 Th

0 h X ] Ú 10 1h 1X 1] 1Ú h0
1u hu 3u
call T1 call T1 call TX
etc.
call T3 call Th
call Th call T1
1X
Î  ! c"
â    time until start
of next burst
1 X
h h.†
3 †.†
X X
† h
] h


 
Sch 
G partition hyperperiod Hinto equal-sized frames
G each frame has constant length f è frame size
G H is an integral multiple of f
G scheduling decision for a frame made at the start
of the frame
± no preemption within frame
G phase of each task is an integer multiple of f

1]
 
#  
G at start of each frame, scheduler must
ensureu
1. jobs scheduled for execution in frame
have been released and are ready
h. overrun does not occur
± i.e. jobs in previous frames completed

16

 
S |   
G every job must be able to start and complete
within a frameu
= 2    
G for at least one task Tiu   = !  = " #

 floor function Why?


(round down,
integer result) frame divides into
hyperperiod

19
 
S |   $%&
G to ensure that every job completes by its
deadlineu want f small enough that there is
at least one frame between the release time
and deadline of each job ensures that job
frame has a frame in
which to execute
  
G Liu concludes constraint met whenu
= !    =  $   è greatest
common divisor
h0
|ccSch  |   
   

T è {(X, 1), (†, 1.Ú), (h0, 1), (h0, h)}

G Constraints on possible values of f


f • max (1, 1.Ú, 1, h) • h
all satisfy first
f è a divisor of one pi constraint
one of h, X, †, 10, h0
hf ± gcd (pi,f) ” Di ????
h1


consider hf ± gcd (pi,f) ” Di for h, X, †, 10, h0

pi Di hf ±gcd(pi, fèh fèX fè† fè10 fèh0 )


X X X-h Ú-X 10-1 h0-h X0-h
† † X-1 Ú-1 10-† h0-†
h0 h0 X-h Ú-X 10-† h0-10
G therefore, f è h only case to satisfy!

hh
 
' h 

|   (
G what if tasks won¶t all satisfy constraints?
G e.g. can¶t meet bothu
± minimum f to ensure a frame between release
and deadline, and
± f greater than execution time
G can¶t
ensure that a job will be able to
complete in one frame! ???

h3
4 Sc 
G solutionu
partition jobs of a task into slices
with smaller execution times
ei ei1 eih
execution time
execution time
after
before
G schedule slices in different frames
G planned preemption!

hX
  c 
1. choose frame size f
h. partition jobs into slices
3. places slices in frames
G choices are not independent !
± algorithm for choices in Liu †.Ú


|cc c  
G modifyclock-driven scheduler to make
scheduling decisions on frame boundaries
± don¶t need to adjust timer
± job slices are organized into blocks
G useslack time to execute aperiodic/sporadic
jobs
± special ³servers´ ?
± run in background ?

h]
Î 
G if currentblock not completed by time next
block starts frame overrun !
G optionsu
± abort the offending block
± let block complete in background
± finish the job and force others to be late
G exception handling! (gnarly)

h6

    
  c4 
G can use knowledge of deadlines to
advantage!
G all slices in a block must complete within
their frame
± no advantage to completing earlier vs. later in
the frame
G insteadof allocating slack at end of frame,
could use it at beginning!


ScS 
G execute aperiodic jobs ahead of periodic
jobs in a frame whenever possible
frame

vs.

required available for


for block aperiodic

h9
ScS  h
G scheduler can allow aperiodic jobs to
execute whenever there is slack in a frame
G could interleave between slices in a block

s1 sh vs. s1 sh

G increases aperiodic throughput


increases overhead !
30
S c4 
G hard deadlines!
G assume minimum release, max execution
and deadline times are known
G when sporadic job released ± perform an
 
  u
± if jobs already scheduled + new job are = 
then  the job

31
S c4  
G sporadic job can use any slack available in
any frame prior to its deadline
G if enough slack exists to meet deadline, then
 and   the job
G if insufficient slack ± reject the job
immediately
G if more than one sporadic job waiting ±
order them earliest deadline first
3h


   
G sporadic job queue wDF ordering
G in each frameu
1. execute the periodic block first
h. then dynamically accept (or reject) from
sporadic job queue
3. then allow aperiodic jobs
G Liu text has more details (†.].3)

33
#  |h 
G changes in operational mode can impact
schedule
G mode change ³reconfigure´ system
± possibly different set of jobs
± possibly different job parameters
± may need initialization phase to create/delete
jobs

3X
#  |h $c ) &
G change scheduling table for periodic jobs
G how to handle outstanding sporadic jobs
from ³old´ mode?
± must still meet their deadlines (?)
± may not be possible due to reduced amounts of
slack available (?)
± requires careful handling


S

  |cc
 c 
³loop forever´ u
G wake up and execute at tf intervals (frame boundaries)
G retrieve the data structure which defines a frame
G wake up the periodic task server
G service the sporadic job queue
G service the aperiodic job queue
G perform general maintenance
± manage slack time, perform error checking

3]
  | c  
Sch 
advantages of clock-driven schedulingu
G simple to understand
G the validation problem is very easy
(deterministic)
G precedence and dependency can be dealt
with off-line by choice of the schedule

36
|  | c  
Sch 
disadvantages of clock-driven schedulingu
G not well suited for applications with varying
temporal & resource requirements
± exact nature of the workload model is not known
a priori
G notalways easy to design, usually hard to
change !
G sophisticated approaches overheads


á h   
 ch
G Weighted Round-robin (WRR) is a i t- fft
connection scheduling discipline.
G WRR serves a number of packets for each
nonempty connection.
± Number è normalized ( weighted / mean packet size)
G Drawbacksu
± Mean packet size must be known;
± In a scale of one round WRR doesn¶t provide fair link
sharing.
¢  !  f  

á

G The mean packet sizes of class A, , C are
h, 3, X
G The weights of A, , C are 0.†, 0.3, 0.h
G The normalized weights of A, and C areu
± Au 0.†/h è 0.h†
± u 0.3/3 è 0.1
± Cu 0.h/X è 0.0†
G Minimal normalized weight is 0.0†
á
 $|  )&
G Thenumber of packets serviced for A,
and C areu
± NPC è (MNW / weighted)
± Au 0.h†/0.0† è †
± u 0.1/0.0† è h
± Cu 0.0†/0.0† è 1
G A possible schedule isu
AAAAA C «.

Você também pode gostar