Real Time Systems: Notes |
These notes make use of mathematical symbols that may not be visible with the default settings on some versions of some browsers.
Symbol | Symbol Name | Symbol | Symbol Name | Symbol | Symbol Name |
---|---|---|---|---|---|
∼ | sim | ∑ | sum | ⌈ | lceil |
⌉ | rceil | ⌊ | lfloor | ⌋ | rfloor |
→ | rarr | ⇒ | rArr | ∞ | infin |
< | lt | ≤ | le | > | gt |
≥ | ge | ≠ | ne | δ | delta |
Δ | Delta | ∂ | part | τ | tau |
π | pi | φ | phi |
If a blank space appears to the left of any of the names in the table above, or the symbol looks strange, try changing the font settings on your browser or using a different browser.
This analysis is based on the following assumptions:
Usum = |
|
ei pi |
C.L. Liu and J. W. Layland, ``Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment'', JACM 20.1 (January 1973) 46-61.
Theorem: A set of n (periodic and aperiodic) tasks is schedulable by EDF scheduling if
|
ei λi |
≤ 1 |
where | λ = | ei min(pi, di) |
Note that this test is only a sufficient condition for schedulabliity, while the test for the case that deadline=period is both necessary and sufficient.
The ratio &lambdai is sometimes called the density of task τ i.
The proof below is from T.P. Baker, ``Stack-Based Scheduling of Real-Time Processes'', in Advances in Real-Time Systems, IEEE Computer Society Press (1993) 64-96; reprinted from The Real-Time Systems Journal 3,1 (March 1991) 67-100, and only covers the case where di≤pi.
J. Liu's book has a proof of the full result, that allows periods beyond the deadline. Most of the proof here applies for arbitrary deadlines. There is one more step to extend it to arbitrary deadlines, which we may discuss in class.
Plan: Assume the theorem is false; show that this leads to a contradiction.
Focus on a period preceding the first time that a job misses its deadline.
Let t be the first time a job misses its deadline. Let t′ be the last time before t such that there are no pending job execution requests with arrival times before t′ and deadlines before or at t. Since no requests can arrive before system start time, t′ is well defined. Since deadlines are all positive, t′ < t. By choice of t and t′, there is no idle time in [t′, t).
We call this the maximal busy interval ending at t because it is the longest interval ending at t that satisfies the following criteria:
Let A be the set of jobs that arrive in [t′, t) and have deadlines in [t′, t). By choice of t′, there are pending requests of jobs in A at all times during the interval [t′,t). Thus, by the EDF priority assignment, the only jobs that will be allowed to start in [t′, t) will be in A. These jobs can only be preempted by other jobs in A.
Let Δ = t - t′, that is, the length of the interval [t′,t). By choice of t′, di ≤ Δ, for every Ji in A. We have the situation shown in the figure below.
For the set of all jobs of τi in A, the total demand for CPU time in [t′, t) is not more than kei, where
k = |
|
+ 1. |
In [t′, t) there is no idle time and the only jobs executing are those in A. Since there is an overflow, the total demand for processor time in [t′, t) exceeds Δ, so
|
Since ⌊X ⌋ ≤ X
|
|
|
We have
|
Since di ≤ Δ for i = 1,...,k
|
This last step is the only place in the proof where we rely on that deadline is less than or equal to period. Can you see how to work the algebra?
[¯]It is obvious that the above result is tight when relative deadlines are equal to periods, since then scheduling only fails when utilization exceeds 100%.
However, if deadline can be less than period the result is not ``only if''. For example, consider the following two tasks:
|
These tasks clearly fail the density test:
|
ei di |
= | 1 1 |
+ | 9 10 |
> 1 |
However, it can be seen that there can never be a missed deadline. Task τ2 will always be able to preempt task τ1, except when their deadlines coincide. When their deadlines do coincide, task τ 1 will already have completed by the time τ2 is released.
Note that there are at least two places in the proof where accuracy the estimation of demand in the busy interval is thrown away. One place is where the floor function is eliminated. Another is where Δ is replaced by di.
Can the theorem can be refined to give a tighter bound?
|
|
|
|
Recall that single-processor preemptive scheduling of independent jobs has been proven to be predictable.
It follows that if we use worst-case execution times and the utilization/density test above we can rely that the task set will still be schedulable if the tasks take less time to execute. Thus, the test is robust w.r.t. execution times.
We did not make any assumptions about first release times (phasing) in the proof, so the result is robust in that sense.
The periods here are only lower bounds (minimum separation of release times), so the result applies to aperiodics as well as periodics, and is robust w.r.t. minor variations in period.
It would be nice to have pictures of some examples here, showing what happens during overload.
Recall that we started with the following formula for the maximum processor demand due to a task Δ in an interval of length Δ.
demand(τi,Δ) = | max (0, ei ( | ⌊ | Δ - di pi |
⌋ | + 1)) |
load(τi,Δ) = | demand(τi,Δ)
Δ |
Consider the following pair of tasks.
i | pi | ei | di |
---|---|---|---|
1 | 7 | 2 | 6 |
2 | 5 | 2 | 9 |
demand(τ1), and its linear upper and lower approximations
The upper diagonal line represents the approximation to the floor function used in the proof above. See how much accuracy is lost.
demand(τ2), and its linear upper and lower approximations
demand(τ1), demand(τ2), and their sum
The total demand, and the sums of the upper and lower bounds. See how much more accuracy is lost, when we take the sum.
loadτ1), and its hyperbolic upper and lower approximations
loadτ2), and its hyperbolic upper and lower approximations
the total load, and the sums of the upper and lower bounds
the total load, and the sums of the upper and lower bounds
Later in the term we will study how to find global and local maxima of the demand and load functions. This will give us a way to test schedulability more precisely than with the utilzation and density tests.
Consider the following graph
© 1998, 2003, 2006 T. P. Baker. ($Id: edfproof.html,v 1.2 2008/08/25 11:18:48 baker Exp baker $) |