Lecture05 PDF
Lecture05 PDF
!2
Limitations of Deferrable Servers
!3
Sporadic Servers
!4
Simple, Fixed-priority, Sporadic Server (1)
• Define:
• TH : the periodic tasks with higher priority than the server (may be empty)
• tr : the last time the server budget replenished
• tf : the first instant after tr at which the server begins to execute
• At any time t define:
• BEGIN as the start of the earliest busy interval in the most recent contiguous sequence of
busy intervals of TH starting before t (busy intervals are contiguous if the later one starts
immediately the earlier one ends)
• END as the end of the latest busy interval in this sequence if this interval ends before t;
define END = ∞ if the interval ends after t
!5
Simple, Fixed-priority, Sporadic Server (2)
• Consumption rule:
• At any time t ≥ tr, if the server has budget and if either of the following two
conditions is true, the budget is consumed at the rate of 1 per unit time:
• C1: The server is executing
• C2: The server has executed since tr and END < t
• When they are not true, the server holds its budget
!
• That is:
• The server executes for no more time than it has execution budget
• The server retains its budget if:
• A higher-priority job is executing, or
• It has not executed since tr
!6
Simple, Fixed-priority, Sporadic Server (2)
• Replenishment rules
• R1: When system begins executing, and each time budget is replenished,
set the budget to eS and tr = the current time.
• R2: When server begins to execute (defined as time tf)
if END = tf then
te = max(tr, BEGIN)
te = effective replenishment time
else if END < tf then
te = tf
The next replenishment time is set to te + pS
• R3: budget replenished at the next replenishment time, unless:
• If te + pS is earlier than tf the budget is replenished as soon as it is exhausted
• If T becomes idle before te + pS, and becomes busy again at tb, the budget is replenished at
min(tb, te + pS)
!7
Example
T1
T2
TSS
T3
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
!8
Example
T1
T2
TSS
A1 A2 A3
Job A1 executes Job A2 released
Sporadic server is constrained to execute
but no budget for at most 1.5 units out of every 5, due to
Job A1 released,
Budget available
consumption and replenishment rules
server blocked
but blocked
No budget
No aperiodic jobs
server suspended Job A2 executes
!10
Simple, Dynamic-priority, Sporadic Server
!11
Scheduling Sporadic Jobs
!12
Model for Scheduling Sporadic Jobs
• Definitions:
• Sporadic jobs are denoted by Si(ri, di, ei) where ri is the release time, di is
the (absolute) deadline, and ei is the maximum execution time
• The density of a sporadic job Δi = ei/(di − ri)
• The total density of a system of n jobs is Δ = Δ1 + Δ2 + … + Δn
!13
Sporadic Jobs in Dynamic-Priority Systems
!15
Admission Control for Sporadic Jobs/EDF
• Notes:
• This acceptance test is not optimal: a sporadic job may be rejected even
though it could be scheduled (the result for the maximum utilisation is
based on the density and hence is sufficient but not necessary)
• It is possible to derive a – much more complex – expression taking into
account slack time, that is optimal. Unclear if the complexity is worthwhile.
• This acceptance test assumes every sporadic job is ready for execution
when released
• If this is not the case, must modify the acceptance test to take into account the time when the
jobs become ready, rather than their release time, when testing the intervals to see if their
density exceeds 1
!16
Sporadic Jobs in Fixed-Priority Systems
Time available
Execution time
[cont’d]
!17
Sporadic Jobs in Fixed-Priority Systems
• To decide if a new job Si(t, ds,i, es,i) is acceptable when there are n sporadic
jobs in the system, the scheduler first computes the slack σs,i(t) of Si:
X
s,i (t) = b(ds,i t)/ps c es es,i (es,k ⇠s,k )
ds,k <ds ,i
where ξs,k is the execution time of the completed part of the existing job Sk
The job cannot be accepted if σs,i(t) < 0
• As for σs,1(t), but accounting for the already accepted sporadic jobs
• If σs,i(t) ≥ 0, the scheduler then checks if any existing sporadic job Sk with
deadline after ds,i may be adversely affected by the acceptance of Si
• Check if the slack σs,k(t) for each Sk at the time is at least equal to the execution time es,i of Si
(i.e., Si is accepted if σs,k(t) − es,i ≥ 0 for every existing sporadic job Sk with deadline ≥ ds,i)
!
• This acceptance test for fixed-priority systems is more complex than that
for dynamic-priority systems, but is still of reasonable time complexity to
be implemented “on-line”
!18
Practical Usage
• Also defines the replenishment period and the initial budget after
replenishment
• As usual with POSIX, applicable to fixed-priority systems only
!19
Summary
!20