Beruflich Dokumente
Kultur Dokumente
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
Schh
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 )
|
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.
T1T3 Th T1 TX Th T1 Th T1 T1 Th
11
Let¶s take an example we have four independent periodic task.
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
1h
| c
ch
G Consider four independent periodic task.
T1è(X,1) Thè(,1.Ú) T3è(h0,1) TXè(h0,h)
It mean after tèh0 the entire schedule consist of replicated segment of length x
here
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
1
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
1Ú
S |
G every job must be able to start and complete
within a frameu
=2
G for at least one task Tiu = ! ="#
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)}
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 .Ú
h
|ccc
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!
hÚ
ScS
G execute aperiodic jobs ahead of periodic
jobs in a frame whenever possible
frame
vs.
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
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
3
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
3Ú
á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 «.