According to Corollary 5.1, (5.23) needs to be checked for violation for allk∈[1, Kℓ] andδ∈[A−ℓ1(k−1), δmax
ℓ (k)].
Theorem 5.4. The time complexity of the presented test is pseudo-polynomial if there exists a constant
c such thatUsum≤c <Ub.
Proof. We start with estimating the complexity of checking (5.23). The values ofαu
i(∆),γiu(k),A−i1(k), and B(∆) can be computed in constant time if αu
periodic piecewise-linear parts. These assumptions are used in prior work on the Real-Time Calculus Toolbox (Wandeler and Thiele, 2006) and are sufficient for practical purposes. Under these assumptions, M∗
ℓ(δ) for a given value of δ can be computed in O(n) time, where n is the number of tasks, in two steps. First, for all tasksTi, we calculate the valuesAHC(Ti, δ) and ANC(Ti, δ) inO(n) time. Second,
we calculatePTi∈τANC(Ti, δ) inO(n) time. Third, we select at most m−1 largest positive values of
AHC(Ti, δ)−ANC(Ti, δ) inO(n) time using linear-time selection (Blum et al., 1973) and add their sum
toPTi∈τANC(Ti, δ). The cost of checking (5.23) is thus O(n).
For each task Tℓ, the inequality (5.23) needs to be checked for all k ∈ [1, Kℓ] and all integers in [A−ℓ1(k−1), δmax
ℓ (k)]. By Definition 5.23, δmaxℓ (k) is finite if its denominator is nonzero. By (5.5), we haveUsum≤Ub. Therefore, δmaxℓ (k) is finite if (5.5) is strict. Overall, (5.23) has to be checked at most n·maxTℓ∈τ(Kℓ·maxk≤Kℓ(δ
max
ℓ (k))) times, which implies the pseudo-polynomial time complexity. Checking that (5.23) is violated for each integral value in [A−1
ℓ (k−1), δℓmax(k)] can be computationally expensive. A fixed-point iterative technique can instead be applied so that only a (potentially small) subset of [A−ℓ1(k−1), δmax
ℓ (k)] is checked. In essence, we skip intervals where (5.23) does not hold. A similar technique was used by Zhang and Burns (2009) for checking schedulability under uniprocessor EDF. The important difference is that our procedure does not rely on the assumptions of the sporadic task model and is applicable in multiprocessor systems.
In Definition 5.30 below, we define a sequence of values δ within the interval [A−1
ℓ (k−1), δmaxℓ (k)] that need to be examined in order to check for a violation of (5.23) within this interval. We assume that
A−1
ℓ (k−1)≤δmaxℓ (k), for otherwise (5.23) does not hold trivially. We will need an additional definition below.
Definition 5.29. LetB−1(y) = inf{∆| B(∆)> y}be the pseudo-inverse function of the total processing capacity of the system.
Example 5.8. In Example 1.2,B−1(2) = inf{∆ | B(∆)>2}= 5. Definition 5.30. Letξ(δ) = B−1(M∗
ℓ(δ) + (m−1)·(Eℓ∗(k)−1))
−Θℓ. Let {x[n]} be the sequence such thatx[n+1] :=ξ(x[n]) andx[1]=δmax
ℓ (k). Because, by Definition 5.20, E∗
ℓ(k) upper-bounds a positive variable (which includes the demand of the problem job Tℓ,q) and, by Definition 5.21, Mℓ∗(δ) upper-bounds a non-negative variable, Mℓ∗(δ) + (m−1)·(E∗
ℓ(k)−1) is non-negative for eachδ. Therefore,B−1(Mℓ∗(δ) + (m−1)·(Eℓ∗(k)−1)) (and in turnξ(δ)) is well-defined for eachδ. We henceforth assume that
(L)(5.23) does not hold forδ=δmax
ℓ (k) =x[1].
Otherwise, the test in Corollary 5.1 fails trivially, when the first evaluation interval is considered. Claim 5.8. ξ(x)is a non-decreasing function of x.
Proof. The claim follows from the fact that M∗
ℓ(δ) and B−1(Y) are non-decreasing functions of their arguments.
Lemma 5.10: ξ(x[1])≤x[1].
Proof. ConsiderZ1=B−1(Mℓ∗(x[1]) + (m−1)·(Eℓ∗(k)−1)). By Definition 5.29,
Z1= inf{∆| B(∆)> Mℓ∗(x[1]) + (m−1)·(Eℓ∗(k)−1)}
{from (L), we haveM∗
ℓ(x[1]) + (m−1)·(Eℓ∗(k)−1)<B(x[1]+ Θℓ)}
≤x[1]+ Θℓ.
From the inequality above, we have
x[1]≥Z1−Θℓ {by the definition ofZ1} =B−1(M∗ ℓ(x[1]) + (m−1)·(Eℓ∗(k)−1))−Θℓ ≥ jB−1(Mℓ∗(x[1]) + (m−1)·(Eℓ∗(k)−1)) k −Θℓ =ξ(x[1]).
Lemma 5.11. x[n+1] ≤x[n] for each n.
Proof. Base case: n= 1. Because, by Definition 5.30,x[2]=ξ(x[1]), the required result immediately follows from Lemma 5.10.
Induction step: n >1. By the induction hypothesis,x[n]≤x[n−1]. By Claim 5.8, we haveξ(x[n])≤ ξ(x[n−1]). By Definition 5.30, this impliesx[n+1] ≤x[n].
We next prove an auxiliary lemma. Lemma 5.12. Ify >B−1(y
Proof. Lety∗= inf{∆| B(∆)> y
0}. This implies that
B(y)≤y0for eachy < y∗. (5.30)
We now consider two cases.
Case 1: B(y∗) > y0. Because B(∆) is non-decreasing, by the condition of the case, for y > y∗,
B(y)≥ B(y∗)> y
0.
Case 2: B(y∗) =y
0. Suppose, contrary to the statement of the lemma, that there existsy′ > y∗ such that B(y′)≤y
0. Then, becauseB(∆) is non-decreasing,B(∆)≤y0 for each ∆∈[y∗, y′], and hence, by (5.30),B(∆)≤y0 for each ∆≤y′. Therefore,y∗ is not an infimum for the set whereB(∆)> y0, which contradicts the definition ofy∗.
Lemma 5.13. If x[n+1]< x[n], then (5.23) does not hold for each non-negative integralδ∈(x[n+1], x[n]].
Proof. Consider a non-negativeδ∈(x[n+1], x[n]]. We first lower-boundδ+ Θ
ℓ as follows. δ+ Θℓ> x[n+1]+ Θℓ {becausex[n+1] =ξ(xn), by Definition 5.30} = jB−1(M∗ ℓ(x[n]) + (m−1)·(Eℓ∗(k)−1)) k −Θℓ+ Θℓ = jB−1(Mℓ∗(x[n]) + (m−1)·(Eℓ∗(k)−1)) k
Because δand Θℓ are integral, δ+ Θℓ>B−1(Mℓ∗(x[n]) + (m−1)·(Eℓ∗(k)−1)). By Lemma 5.12, the last inequality implies
B(δ+ Θℓ)> Mℓ∗(x[n]) + (m−1)·(Eℓ∗(k)−1)
{by the selection ofδandM∗ being non-decreasing} ≥Mℓ∗(δ) + (m−1)·(Eℓ∗(k)−1).
The following theorem gives a method for checking (5.23) on the interval [A−ℓ1(k−1), δmax
ℓ (k)] which skips sub-intervals where (5.23) does not hold.
0
B(d+Q )
lM ( )+ (
*ld
m E k
*l( )-1)
x
[1]x
[2]x
[3]d
Figure 5.4: Iterative process for findingδℓin Example 5.9.
Theorem 5.5. Let{x[n]}be the sequence defined in Definition 5.30. Ifx[n+1] <A−1
ℓ (k−1), then (5.23) does not hold for each integralδ within the interval[A−1
ℓ (k−1), δmaxℓ (k)]. Proof. The theorem follows from dividing the interval (x[n+1], δmax
ℓ (k)] into subintervals (x[i+1], x[i]] and applying Lemma 5.13 to each of the subintervals.
We proved the above theorem for the case when time is integral. We defer consideration of continuous time to future work. According to Theorem 5.5, we can apply Corollary 5.1 as follows. First, we check whether (5.23) does not hold for δ =δmax
ℓ (k). Second, we construct the sequence{x[n]} as defined in Definition 5.30. If a fixed pointx[n]=x[n+1] is not found in the interval [A−1
ℓ (k−1), δmaxℓ (k)], then, by Theorem 5.5, (5.23) does not hold for eachδ∈[A−ℓ1(k−1), δmax
ℓ (k)]. If such a fixed point is found, then we conservatively claim that the response-time bound Θℓis violated.
Example 5.9. The iteration process described above can be illustrated graphically. Figure 5.4 shows two functions ofδ: B(δ+ Θℓ) andMℓ∗(δ) + (m−1)·(Eℓ∗(k)−1), which are depicted with bold dotted and solid lines, respectively. The iteration process starts withx[1]=δmax
ℓ (k). At this point, Mℓ∗(x[1]) + (m−1)·(E∗
ℓ(k)−1)<B(x[1]+ Θℓ). The next step is to set x[2] =ξ(x[1]) as shown. Similarly,x[3] is computed. The process continues until a fixed point is found orx[n+1] <A−1
ℓ (k−1) holds. Thus, the iterations skip portions of the interval [A−1
ℓ (k−1), δℓmax(k)] where (5.23) is guaranteed to fail.