4.4 Allowing Guaranteed and Desired Weights to Differ
4.4.2 The Adaptable Sporadic Task Model, Revisted
In this section, we incorporate the notions of guaranteed and desired weights into the adapt- able sporadic task model that was presented in Section 3.1. It is important to note that, unless otherwise specified, all references to the adaptable sporadic task model in this chap- ter are to the task model presented in this section. We begin our discussion by formally defining when a task changes its weight. A task Ti changes its desired weight at time t if Dwt(Ti, t−ǫ)6=Dwt(Ti, t) whereǫ→0+. Similarly, a task,Ti,changes its guaranteed weight
at timetifGwt(Ti, t−ǫ)=6 Gwt(Ti, t) where ǫ→0+.
Notice that, since we are attempting to minimize MROE, by (4.2), the guaranteed weight for every task on an over-utilized processor is a function of its desired weight and the desired weight of every other task assigned to the same processor. As a result, when a task, Ti,
changes its desired weight at time t, the guaranteed weight for Ti and for every other task
assigned to same processor may change.
Additionally, different actions may occur depending on whether the desired or guaranteed weight of a task changes. Specifically, if a task,Ti, changes its desired weight at timetc when
a jobTij is active, then the following two actions may occur.
• The execution time of Tij may be reduced to the amount of time for which Tij has executed prior totc, and the execution time ofTij+1may be redefined to be the amount
of time “lost” by reducing the execution time ofTij.
• r(Tij+1) may be redefined to be less than d(Tij), which would cause jobs Tij and Tij+1 to “overlap.”
If the guaranteed weightbut not the desired weight of a task changes, then the following two actions may occur
• The deadline of Tij may be changed.
• The release time ofTij+1 (if it exists) may be changed.
Scheduling weights. Just as with the adaptable sporadic task model presented in Sec- tion 3.1, there can be a difference between when a desired weight change is initiated and when it is enacted. We use the desired scheduling weight of a task Ti at time t, denoted SDwt(Ti, t), to represent the “last enacted desired weight ofTi.” Formally,SDwt(Ti, t) equals Dwt(Ti, u), whereu is the last time at or beforetthat a weight change was enacted forTi. It
is important to note that we use the desired scheduling weight of a task to compute theguar- anteed scheduling weight of a task, denoted SGwt(Ti, t). In turn, the guaranteed scheduling
weight is used to compute the deadlines and releases of tasks.
Formally, the guaranteed scheduling weight of Ti that is assigned to the processor P[q] at timetis SGwt(Ti, t) = SDwt(Ti, t) TS(P[q], t), (4.5) where TS(P[q], t) =max 1, X Ti∈ASSN(P[q],t) SDwt(Ti, t) (4.6)
Notice that, by (4.5), the sum of the guaranteed scheduling weights of all active tasks assigned to a processor is at most one, which is formalized by the following property
(W) For any processor P[q] and any timet,P
Tij∈ASSN(P[q],t)SGwt(Ti, t)≤1.
Because the rules for changing the guaranteed weight of a task are simpler than changing its desired weight, it is possible to integrate them directly into the definition of a job’s release and deadline. To do so, we introduce the notion of a perceived deadline of Tij at time t, denotedd(Tij, t), which represents what the deadline of Tij would be if its guaranteed weight did not change. As a shorthand, we use d(Tij) to denote the time u such that u=d(Tij, u). (d(Tij) represents the actual deadline of the job, but it cannot be determined until it is reached
(see the example below). Formally, we defined(Tij, t) as, d(Tij, t) = t+ Irem(T j i,t) SGwt(Ti,t), ifSGwt(Ti, t)>0 ∞, otherwise. (4.7) where Irem(Tij, t) = e(Tij), if t <r(Tij) e(Tij)−Rt r(Tij)SGwt(Ti, u)du, otherwise. (4.8)
Additionally, we definer(Tij) as,
r(Tij) =θ(Tij), j = 1 (4.9)
r(Tij) =d(Tij−1) +θ(Tij), j >1, (4.10)
where θ(Tij) ≥0. Notice that, if for some job Tij and t > r(Tij), SGwt(Ti, t) = 0, then it is
possible thatd(Tij) cannot be reached sinced(Tij, t) =∞. The scenario whereSGwt(Ti, t) = 0
is a special case that is used to representTi leaving the system. Thus, onceSGwt(Ti, t) = 0
holds,Ticannot release any more jobs and is no longer allocated any capacity in any schedule.
As a result, if d(Tij, t) = ∞, then we set d(Tij) as ∞. Notice that all other terms of Ti are
still well-defined since the only other term that is defined usingd(Tij) is r(Tij+1); however, if
d(Tij) =∞, thenTij+1 does not exist.
From the definition of d(Tij, t) in (4.7) it is not hard to see that the following property holds.
(D) For any two times u1 and u2 such that r(Tij) ≤u1 ≤ u2 ≤ d(Tij), Ruu12SGwt(Ti, t)dt ≤ e(Tij).
Notice that, since for t ∈ [r(Tij), d(Tij)), Rt
r(Tij)SGwt(Ti, u) ≤ e(T
j
i), by (4.8), it follows
that for any timet
Irem(Tij, t)≤e(Tij)≤emax(Ti) (4.11)
It is important to note that the PEDF and NP-PEDF scheduling algorithms discussed in this chapterprioritize jobs based on their perceived deadlines; however, even though jobs are
prioritized based on their perceived deadlines, the relative scheduling priority between any two jobs is time invariant. Specifically, it two jobs, Tij and Tab, are assigned to the same processor and at some time t1 ≥ max(r(Tij),r(Tab)), d(Tij, t1) < d(Tab, t1) holds, then at any timet≥max(r(Tij),r(Tab)),d(Tij, t)<d(Tab, t) holds. Intuitively, the reason for this behavior is that the deadlines for both jobs always scale by the same factor, i.e., TS(P1
[q],t). Also, when
the desired weight of a task changes, the relative scheduling priority between any two released jobs of any two tasks is unchanged. (When task’s desired weight is changed, it is possible that the current job may halt and release a new job with a higher or lower scheduling priority. Such an action would change the relative scheduling priority between two tasks but not between the jobs themselves because the original job was halted.)
Example (Figure 4.2). Consider the example in Figure 4.2, which depicts a processor that is assigned four tasks: T1, which has e(T1) = 3 and Dwt(T1) = 2/5; T2, which hase(T2) = 2 andDwt(T2) = 1/3;T3, which hase(T3) = 1 andDwt(T3) = 1/3; andT4, which has e(T4) = 4 and Dwt(T4) = 4/15. The total desired weight is 43. T41’s perceived deadline is shown above each inset. Inset (a) depicts the scenario whereT1 never leaves. Inset (b) depicts the scenario whereT1leaves at time 10 causing the processor to be under-utilized. Notice that, in inset (b), T41’s perceived deadline changes when T1 leaves (at time 10) from 20 to 18.¯3 because T41’s guaranteed scheduling weight changes. This differs from inset (a), in which T41’s guaranteed scheduling weight does not change, and as a result,T41’s perceived deadline remains constant. One final note: while, in inset (a),d(T41) = 20, and in inset (b),d(T41) = 18.¯3, neither of these values are known until these corresponding points in time are reached.
Because the reweighting rules may cause r(Tij+1) < d(Tij), we must slightly modify the definition of “window,” “active,” and “inactive” presented in Section 1.2.
Definition 4.1(Window, Active, and Inactive). IfTij is a job in the adaptable sporadic task system, T, then the window of Tij is defined as the range [r(Tij),min(d(Tij),r(Tij+1))).
Furthermore, the job Tij is active at time t iff t is in Tij’s window (i.e., t ∈
Job deadline 1 T 4 d(T ,t)4 20 20 20 20 20 20 20 20 20 20 Time (a) Scheduled T 1 T 4 Time (b) 20 20 20 T T 2 3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3 18.3 20 20 20 20 20 20 20 20 20 20 d(T ,t)41 1 Job released T T T 2 3 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 20 20 20 20 20 20 20 20
Figure 4.2: A one-processor system with four tasks. (a) T1 never leaves. (b) T1 leaves at time 10. The perceived deadline for T41 is shown above each figure.