2.3 Real-Time Scheduling
2.3.3 Global Multiprocessor Real-Time Scheduling
2.3.3.2 Global Job-Level Fixed-Priority Scheduling
Other than in the uniprocessor case, global JLFPscheduling is not “better” at satisfying HRT constraints than globalFP scheduling when confronted with “difficult” task sets. As mentioned above (page 71), the Dhall effect (Dhall and Liu, 1978) applies equally to bothG-FPscheduling with RMpriorities andG-EDF. Even a globalJLFPscheduler that is optimal with respect to this class of
Task ei pi ui T1 3 10 103 = 2730819 = 0.30 T2 2 7 27 = 2730780 ≈0.29 T3 1 5 15 = 2730546 = 0.20 T4 3 9 13 = 2730910 ≈0.33 T5 5 13 135 = 10502730 ≈0.38 usum(τ) 41052730 ≈1.50 umax(τ) 1050 2730 ≈0.38
Table 2.5: Example task set.
schedulers would fail to schedule Anderssonet al.’s pathological example task setτABJ consisting
ofm+ 1implicit-deadline tasks with parametersei= 1 +andpi = 2(Anderssonet al., 2001): as before, if all tasks release jobs at time0, then the lowest-priority job would not start execution until time1, at which point a deadline miss is unavoidable, assuming that job executes for a full1 +
time units. Therefore, the utilization bound of any globalJLFPscheduler is bounded by m+12 in the HRT case, which is no better than the worst-case utilization bounds of either partitioned orG-FP scheduling. However, this bound applies to partitioned andG-FPscheduling even in the SRT case, whereas there exists a family of globalJLFPschedulers that are SRT optimal (Leontyev, 2010), that is, onmprocessors, they ensure bounded tardiness for any sporadic task setτ withusum(τ)≤m.
Similar toG-FPscheduling, neither an optimal globalJLFPscheduler12 nor anexactHRT
feasiblity test for globalJLFPscheduling is currently known. AsEDFis in the uniprocessor case, G-EDFis the best-studied globalJLFPscheduler, and it is also the one that we focus on in this dissertation. An exampleG-EDFschedule of the task set given in Table 2.5 is shown in Figure 2.16. We will use this task set as an example to demonstrateG-EDFschedulability analysis in the following discussion. We begin with HRT analysis.
Density test. SinceG-EDFis subject to the Dhall effect, reasonableG-EDFschedulability tests must necessarily be based on task-set-specific parameters besides total utilization to identify task sets that are HRT schedulable. Key to the Dhall effect is the presence of high-utilization tasks (Phillips
et al., 1997, 2002). If the maximum utilizationumax(τ)is significantly less than one, then a higher utilization bound exists. The first to derive such a schedulability test were Goossenset al. (2003),
release completion deadline scheduled on processor 1 scheduled on processor 2 20 15 10 5 0 time T1 T2 T3 T4 T5
Figure 2.16: ExampleG-EDFschedule of the task set listed in Table 2.5. Two migrations occur in this example. J1,1 is preempted at time 2 on processor 1 byJ2,1and is scheduled again at time 3 on processor 2, after the higher-priorityJ4,1 completed. The reverse occurs later in the schedule:
at time 12 on processor 2, J4,2 is preempted due to the release of J2,2 and continues to execute
after migrating to processor 1 at time 13. Note thatJ4,2 andJ1,2have the same absolute deadline
d4,2 =d1,2 = 20, but thatJ4,2 was preempted instead ofJ1,2 because deadline ties are broken in favor of lower-indexed tasks.
who showed that a set of implicit-deadline periodic tasksτ is HRT schedulability underG-EDFif
usum(τ)≤m−(m−1)·umax(τ). Bertognaet al. (2005) and Baker and Baruah (2007) subsequently showed that this bound also applies to arbitrary-deadline sporadic task sets if density is substituted for utilization. The resulting schedulability criterion is now commonly referred to as thedensity test.
Theorem 2.7(Goossenset al., 2003; Bertognaet al., 2005; Baker and Baruah, 2007). An arbitrary- deadline sporadic task setτ is HRT schedulable underG-EDFonmprocessors if
δsum(τ)≤m−(m−1)·δmax(τ).
Example 2.7. The total utilization (and hence density) of the implicit-deadline task set given in Table 2.5 is usum(τ) = 41052730 ≈ 1.5. The maximum utilization is umax(τ) = 10502730. On a two-
processor platform (m= 2), the density test yields the inequality
4105 2730 ≤2−(2−1)· 1050 2730 = 5460 2730 − 1050 2730 = 4410 2730 ≈1.62,
which is true. The example task set is thus HRT schedulable underG-EDFon two processors. ♦
Baker’s test. Shortly thereafter, Baker (2003) developed a novel proof strategy that has since enabled several key results, including theG-EDFHRT schedulability tests discussed in the remainder of
this section. From a high-level point of view, Baker’s problem window approach(illustrated in Figure 2.17) consists of the following four steps. LetJk,xdenote the first job to miss a deadline.
1. Identify aproblem windowimmediately prior toJk,x’s deadline miss. For example, a straight-
forward choice of problem window is the interval[ak,x, dk,x).
2. Analyze the problem window to derive anecessarycondition for a deadline miss to occur. For example,Jk,xwill only miss its deadline if allmprocessors execute higher-priority jobs
for more thandk−ek time units during[ak,x, dk,x)(otherwise,Jk,xwould finish in time). In other words, more thanm·(dk−ek)time units of higher-priority work were carried out during the problem window prior toJk,x’s deadline miss.
3. Bound the maximum amount of higher-priority work processed during the problem window. There are two principle sources of higher-priority work: higher-priority jobs that are released during the problem window, andcarry-injobs that were already pending at the beginning of the problem window. Bounding the work due to jobs released during the problem window is relatively straightforward because sporadic tasks are rate-limited. Bounding carry-in work is possible since, by assumption,Jk,xis the first job to miss its deadline; however, bounds on
carry-in work are more difficult to obtain.
4. Relate both bounds to the necessary condition for a deadline miss from Step 2 to obtain a necessary “unschedulability test.” Then invert the necessary “unschedulability test” to obtain a sufficient (but not necessary) HRT schedulability test.
Baker’s technique has been hailed as a “seminal result” (Davis and Burns, 2011b) that has since served as the basis for several published schedulability results—see Davis and Burns and Bertogna and Baruah’s recent surveys for a comprehensive overview (Davis and Burns, 2011b; Bertogna and Baruah, 2011). Besides the overall proof strategy, Baker’s key insight was to extend the problem window to a point in time earlier thanak,x. The benefit is that a longer interval results in reduced overestimation of higher-priority work,i.e., in reduced pessimism. In the case of constrained and arbitrary deadlines, Baker’s test can identify schedulable task sets that are missed by the density test. However, the converse is also true,i.e., the tests are incomparable (Bertognaet al., 2005). In the case
dk problem window dk−ek time dk,x ak,x Processor 1 Processor 2 Processor 3 ek carry-in jobs jobs released in problem window
Figure 2.17: Illustration of Baker’s problem window analysis (Baker, 2003) form= 3processors. In order forJk,xto miss its deadline at timedk,x, allmprocessors must be busy executing higher-
priority jobs for more than(dk−ek)time units during the problem window. Interfering higher-priority jobs were either carried into or released during the problem window. There may exist up toncarry-in jobs.
of implicit deadlines, Baker’s test is equivalent to the density test (Bertogna and Baruah, 2011). For this reason, Baker’s actual schedulability test is not relevant to our main study (see Chapter 4).
Multiprocessor response-time analysis. Bertogna, Cirinei, and Lipari adopted Baker’s approach and developed a series of subsequently less pessimsitic schedulability tests for constrained-deadline sporadic tasks (Bertognaet al., 2005, 2009; Bertogna and Cirinei, 2007). We discuss Bertogna and Cirinei’smultiprocessor response-time analysis(Bertogna and Cirinei, 2007) since it dominates the other two tests (Bertogna and Baruah, 2011). Like uniprocessor response-time analysis (see Section 2.3.1.1 above), Bertogna and Cirinei’s test is an iterative process that is repeated until response-time bounds converge. In the uniprocessor case, the response-time bound of one task does not depend on the response-time bounds of other tasks (recall Example 2.4). That is, the individual response-time bounds are computed on a task-by-task basis and not reconsidered when the response times of other tasks become available. In the multiprocessor case, an outer loop is added that uses updated response-time bounds ofall tasksto obtain better estimates in subsequent iterations of the outer loop. This is illustrated in Listing 2.1, where Lines 3–7 constitute the outer loop and Lines 5–6 the inner loop. In Listing 2.1 and the following discussion, letR(l)i denote the response-time bound forTi determined during thelthiteration of the outer loop, and lets(l)
i ,max(0, di−R (l)
i )denote a
lower bound onTi’sslackbased on itslthresponse-time estimate. Initially, assumeR(0)
i =di, which
1 compute−response−times(τ,m):
2 setl←0
3 do
4 setl←l+ 1
5 foreachTk∈τ:
6 setR(l)k using Theorem 2.8 usings(li−1)for eachTi
7 while∃Ti ∈τ such thats(li−1) < s(l)i
8 foreachTi ∈τ:
9 setRi ←Ri(l)
Listing 2.1: Multiprocessor response-time analysis pseudo-code.
Let Tk denote the task for which the maximum response time is being bounded (Line 6 in
Listing 2.1). As before, let Jk,x denote the first job to miss a deadline. Bertogna and Cirinei
analyzed the problem window[ak,x, dk,x)prior toJk,x’s deadline miss. Two bounds on delay due
to higher-priority jobs of each taskTi(wherei6=k) are crucial to their analysis. The first bound is concerned with how much processor time jobs ofTican consume in the worst case duringLtime units (assuming a legal invocation sequence), which they calledTi’sworkloadWi(L). A second notion of delay is theinterferenceby jobs ofTiwhileJk,xis pending, which is denoted asIi(where Ti6=Tk). Workload and interference differ in that interference only reflects the jobs ofTithat have
a higher priority thanJk,x, whereas the workload includes all ofTi’s jobs in the analyzed interval.
Both interference and workload yield upper bounds on the delay due toTiexperienced byJk,x; to
reduce pessimism, the minimum of the two is used in the computation of the response-time bound. Bertogna and Cirinei (2007) showed that a valid bound onTi’s workloadWi(L)is given by
Wi(L) = & L+di−ei−s(li−1) pi ' ·ei+ min(ei, L+di−ei−s(li−1))
during thelth iteration of the outer loop. Note thatWi(L)is independent ofTkand thus reflects
neitherJk,x’s priority nor the scheduling algorithm in use. In contrast, the interferenceIi reflects
both. Bertogna and Cirinei showed that, underG-EDF, an upper bound onTi’s interference13is
given by Ii = dk pi ·ei+ min(ei, dkmod (pi−s (l−1) i )). 13
This definition ofIidiverges slightly from the one given in (Bertogna and Cirinei, 2007). We use the simpler (and
Based on the workload and interference bounds, Bertogna and Cirinei derived the following response- time bound.
Theorem 2.8(Bertogna and Cirinei, 2007). Let τ denote a set of constrained-deadline sporadic tasks scheduled byG-EDFonmprocessors. Assuming no job misses its deadline, the maximum response time of taskTk∈τ is bounded by the smallestR(l)k that satisfies
R(l)k =ek+ 1 m TXi6=Tk Ti∈τ
minWi(Rk(l)), Ii, Rk(l)−ek+ 1
,
whereRk(l)is determined using a fixed-point iteration with the starting assumptionR(l)k =ek. If the fixed-point iteration fails to converge for some Tk, i.e., if R
(l)
k exceeds dk, then set Rk(l) =dk+ 1. Due to the use of the outer loop, a non-converging response-time bound does not
necessarily cause the task set to be claimed unschedulable. During subsequent iterations of the outer loop, improved slack estimates may be available forother tasks, which may then allow a response-time bound forTkto be determined. Theorem 2.8, when used as illustrated in Listing 2.1, yields a safe upper bound on each task’s maximum response timeif the task set is HRT schedulable,
i.e., if Ri ≤ di for eachTi in Line 9 of Listing 2.1. The response-time bounds determined by
Theorem 2.8 are not necessarily valid if jobs can be tardy (or if tasks have arbitrary deadlines); extended versions of multiprocessor response-time analysis should be used in this case (Leontyev and Anderson, 2008; Liu and Anderson, 2011).
In many cases, multiprocessor response-time analysis is less pessimistic than either the density test or Baker’s test (Bertogna and Baruah, 2011). However, strictly speaking, multiprocessor response- time analysis is incomparable with both tests, that is, there exist task sets that are wrongly deemed unschedulable by Bertogna and Cirinei’s analysis, but that pass the density test or Baker’s test.
Example 2.8. Consider the task set from Example 2.7 as given in Table 2.5. During the first iteration of the outer loop (l= 1), applying Theorem 2.8 to eachTk∈ {T1, . . . , T5}requires 16 fixed-point iterations and yields the following response-time bounds:R(1)1 = 10,R(1)2 = 8,R(1)3 = 6,R(1)4 = 10, andR(14)5 = 10, which implies thats(1)k = 0for eachTk. Since none of the computed response-time bounds improved over the initial assumption ofR0
iteration. Since the resultingRk=R(1)k exceedsdkfor each task exceptT1, the task set is wrongly
claimed unschedulable. ♦
Baruah’s test. The underlying reason for this pessimistic result is that Bertogna and Cirinei’s response-time analysis overestimates the amount of carry-in work contributed by each task (recall that carry-in work is the time needed to service higher-priority jobs that were released prior to the beginning of the problem window). In fact, in Theorem 2.8, each task is considered to contribute carry-in work. Baruah (2007) showed that if the problem window is chosen carefully, then at most
m−1tasks contribute carry-in demand. He proposed a schedulability test (based on Baker’s proof technique) for constrained-deadline task sets that exploits this observation. Since his schedulability test also yields good results for implicit-deadline task sets, we briefly review it next.
LetJk,xdenote the first job to miss its deadline at timedk,x. A major source of uncertainty is that every task may have a job pending at timeak,x,i.e., every task may contribute carry-in demand. Baruah extended the problem window by considering the last point in time prior toak,xat which at least one processor was idle or executing a job with lower priority (i.e., a later deadline) thanJk,x(or
time zero if no such point in time exists prior toak,x). Lett0denote this point in time, and letAk
denote the length of the interval[t0, ak,x),i.e.,ak,x=t0+Ak. This is illustrated in Figure 2.18.
The carefully chosen nature oft0allows two observations. First, at mostm−1higher-priority
jobs are pending at timet0, and, second, all processors are busy executing higher-priority jobs during
[t0, rk,x). Further, forJk,xto miss its deadline, processors must be executing higher-priority jobs for
more than(dk−ek)·mtime units during[ak,x, dk,x), and thus for more than(Ak+dk−ek)·m
time units during[t0, dk,x). This observation corresponds to Step 2 of Baker’s proof strategy. The next step is to bound the amount of higher-priority work carried out during[t0, dk,x). As before, letIi denote the interference due toTi prior toJk,x’s deadline miss. The upper bound on this
interference depends on whetherTihas a carry-in job. LetIi0denote a bound on interference due to TiifTidoesnothave a carry-in job, and letIi00denote a bound on interference due toTi if it does
carry in work into the analysis interval. Baruah derived the following bounds:
Ii0= min(W0 i, L) ifi6=k min(Wi0−ek, Ak) ifi=k
Ii00= min(W00 i , L) ifi6=k min(Wi00−ek, Ak) ifi=k
Ak problem window Ak+dk−ek time dk dk,x ak,x Processor 1 Processor 2 Processor 3 ek carry-in jobs jobs released in problem window t0
Figure 2.18: Illustration of Baruah’s extended problem window (Baruah, 2007) form= 3processors. Baruah extended the problem window byAktime units to the first point in timet0at which at least
one processor is idle or processing a job of lower priority, wheret0 ≤ak,x. In order forJk,xto miss its deadline at timedk,x, allmprocessors must be busy executing higher-priority jobs for more than (Ak+dk−ek)time units during the problem window. Due to the choice oft0, there exist at most
m−1carry-in jobs at timet0.
where L=Ak+dk−ek−1, Wi0= max 0, Ak+dk−di pi + 1 ·ei , and Wi00= Ak+dk pi
·ei+ min(ei,(Ak+dk) modpi).
Unfortunately, the identity of the tasks that do have carry-in jobs is unknown in the general case, but due to the definition oft0 there are at mostm−1such tasks. LetCB denote a bound on the
maximum amount of work that could have been carried in such that X Ti∈τ Ii ≤CB + X Ti∈τ Ii0. (2.1) LetIdiff
i ,Ii00−Ii0denote the difference between the two interference bounds for each taskTi. A
safe upper boundCB is then given by the sum of them−1largest values ofIdiff i .
Recall that a necessary condition forJk,xto miss a deadline is that the total interferencePTi∈τIi
exceeds(Ak+dk−ek)·mduring[t0, dk,x). By inverting this necessary condition (Baker’s Step 4) and by substituting the total interference using Equation (2.1), Baruah obtained the following sufficient HRT schedulability test.
Theorem 2.9(Baruah, 2007). A constrained-deadline task setτ is HRT schedulable underG-EDF
onmprocessors if for allTk ∈τ andAk≥0
CB+ X
Ti∈τ
Ii0 ≤(Ak+dk−ek)·m.
To obtain a finite testing set ofAkvalues, Baruah (2007) further showed that it is sufficient to
test only values ofAkthat satisfy
Ak ≤ etop(τ, m−1)−dk·(m−usum(τ)) + P
Ti∈τ(pi−di)·ui+m·ek
m−usum(τ) . (2.2)
An additional important reduction in the (average) computation cost of the test is due to his observa- tion that it is sufficient to test only values forAkthat correspond to the points in time at which the