Deji Chen, Aloysius Mok, and Sanjoy Baruah. Scheduling distributed real-time tasks in the DGMF model. Proceedings of the Real-Time Technology and Applications Symposium, pp 14-22, Washington, DC. May 2000. IEEE Computer Society Press.
Scheduling Distributed Real-Time Tasks in the DGMF Model Deji Chen Fisher-Rosemount Systems, Inc. 8627 Mopac North Austin, TX 78759
[email protected]
Aloysius K. Mok Department of Computer Sciences University of Texas at Austin Austin, TX 78712
[email protected]
Sanjoy Baruah Department of Computer Science University of North Carolina Chapel Hill, NC 27599
[email protected]
Abstract Analytical results on the real-time scheduling of multiprocessor systems have focussed on partitioning and distributing the task set for scheduling on identical single processors, with the assumption that all of a task can be executed on any of a pool of identical processors. A distributed system is a set of nodes networked together. Each node may have a different type of processor and performs different functions. In the distributed environment, a real-time task may require processing on multiple nodes. However, all the nodes have to satisfy the time constraints of the task. In this paper, we show that the Liu & Layland-type classical task models must be extended to handle this type of distributed real-time tasks. We propose a Distributed Generalized Multiframe (DGMF) task model. The scheduling problem of DGMF tasks can be reduced to that of scheduling Generalized Multiframe (GMF) tasks on a single processor. We analyze the fixed priority scheduling of (D)GMF tasks and prove that the deadline-monotonic priority assignment is not optimal for the general case of frame-wise priority assignment. In the context of relative deadline assignment, we show that there are simple cases for which deadlinemonotonic assignment is optimal.
This work is supported in part by a grant from the Office of Naval Research under grant number N00014-99-1-0402 and a grant from the National Science Foundation under grant number CCR-9972105.
1 Introduction Analytical results in real-time task scheduling research have mostly concentrated on the single processor case. The exploration of parallelism in real-time systems has focussed on scheduling tasks simultaneously on a pool of identical processors such that the scheduler makes no distinction between processors. Notable work in the multiprocessor case includes [22, 11, 23, 4]. [11] investigated different ways of deadline assignment to parts of a task on different hosts and their effects on overall deadline-miss statistics. [23] looked at the end-to-end response time of a task under different synchronization protocols. Most of these results are validated by simulation. In a distributed real-time system, a single task may require processing on several heterogeneous processors. A distributed system is typically a set of hosts networked together. Different hosts may have different processors and perform different functions. For example, consider an office network consisting of PCs, a central domain server, a database server, and a gateway to the outside world, etc. A user application — i.e., a task — that starts on a PC may need to query the database server, check security with the domain server, and send e-mail through the gateway. As another example, the video and audio data in a teleconference is continually transmitted from one end to the other through a series of bridge hosts. The classical Liu & Layland model must be extended for capturing real-time tasking requirements for this type of environment. The purpose of this paper is to introduce such a model and to study some of its analytical properties. The scheduling problem for distributed real-time tasks is how to assign execution time on different hosts such that the
task has guaranteed end-to-end response time. For the teleconferencing example, resources on the bridge hosts should be scheduled such that the end-to-end transmission delay is guaranteed. In general, such a guarantee requires the hosts involved to coordinate the completion times of their parts of the task such that the end-to-end delay does not exceed the specified deadline. In this paper, we shall assume that there is a precedence relationship among the hosts so that the execution of a task on the hosts have to be carried out sequentially. The first step to study distributed real-time task scheduling is to formally define the requirements of the tasks in terms of a task model. In the classical Liu & Layland-type periodic task model [18], the repetitive execution time requirement of a task is constant in every period or at least is upper bounded. A real-time task is specified formally with the parameters: E — the execution time; D — the deadline; P — the period; and optionally A — the offset from time=0 of the first request of the task. 1 There has been considerable progress in extending the Liu & Layland-type model to different situations such as resource sharing, priority inversion, etc. In 1996 we [20] introduced the multiframe (MF) real-time task model that considers the variation of the execution times of a single task from one period to the next. We computed a utilization bound for the MF task model which is a generalization of the classic n(21=n ; 1) utilization bound result. Han [8] later provided a better utilization test. [3] gave a schedulability test for fixed priority assignment and proved that the rate-monotonic priority assignment is still the best for the MF task model. A more generalized multiframe (GMF) task model was proposed in [2] where it was proved that the feasibility problem of the GMF model is no harder than that of the classical Liu & Layland-type task model. A summary of these different task models and the complexity of their feasibility problem is provided in [6]. In this paper, we introduce the Distributed Generalized MultiFrame (DGMF) task model that is suitable for specifying distributed real-time tasks in a heterogeneous environment. We prove that the scheduling problem of DGMF task sets can be reduced to the scheduling problem of GMF task sets on a single processor, and hence known analytical results for GMF tasks can be applied to the distributed case. In particular, the feasibility problem of GMF tasks was investigated in detail in [2], but the schedulability problem under the fixed priority scheduling discipline was left open. In this paper, we shall discuss the fixed priority scheduling of (D)GMF tasks. Unlike the classical Liu & Layland-type tasks, the rate-monotonic priority assignment is not optimal for (D)GMF tasks. We shall derive a necessary and suf1 There are different sets of symbols to denote a real-time task in the research literature. Execution time is sometimes denoted with C ; period is also denoted with T .
ficient condition for schedulability by frame-wise-priority assignment. We further show that the rate-monotonic priority assignment is still the best under certain conditions. In the next section, we shall introduce the DGMF model and argue for the advantages of the (D)GMF model over the classical models. Section 3 analyzes the pre-emptive, fixed priority scheduling of GMF tasks and reasonably solves the problem. Section 4 gives an example of analyzing the schedulability of a DGMF task set. We conclude the paper in section 5.
2 The DGMF Model We first define the DGMF task model. In the following all time parameters are real numbers. A DGMF task ~ D; ~ P~ ; H~ ), where E~ , D~ , P~ , and is defined as a 4-tuple ( E; ~H are N ;ary vectors [E0 ; E1 ; : : : ; EN ;1 ] of execution time requirements, [D 0 ; D1 ; : : : ; DN ;1 ] of (relative) deadlines, [P0 ; P1 ; : : : ; PN ;1 ] of minimum separations, and [H0 ; H1 ; : : : ; HN ;1 ] of the hosts in the distributed system respectively. We require E i Di Pi for 0 i < N . The precedence constraints within a task requires that a frame must be finished before the next frame starts, hence we require Di Pi . The interpretation is as follows: The i’th frame (i 0) of task T has an arrival time a i , a deadline ai + di , an execution requirement of e i , and must be executed on host h i , where
a0 0, and ai+1 ai + Pi mod N , di = Di mod N , ei = Ei mod N , and hi = Hi mod N .
Obviously, a single processor system is a trivial DGMF system where there is only one host. In a single processor system, a DGMF task is reduced to a GMF task defined in [2]. We note in [2] a GMF task frame can have deadline larger than the minimum separation time. A GMF task is a DGMF task where H0 = H1 = : : : = HN ;1 . A GMF task can be represented as a 3-tuple ~ D; ~ P~ ). (E; A MF task is a GMF task where D0 = D1 = : : : = DN ;1 = P0 = P1 = : : : = PN ;1 . A MF task is represented as ((E0 ; E1 ; : : : ; EN ;1 ); P ). A classical Liu & Layland task is a MF task where E 0 = E1 = : : : = EN ;1 . It is represented as (E; P ). The following is an example of a DGMF task set. Example 1 Consider a distributed system of 3 hosts. Host
A is the database server and hosts B and C are two control
hosts that also work as clients to the database server. The DGMF tasks running on each of them are:
Host A
TA1 = ([1]; [2]; [3]; [A]) Host B – TB 1 = ([3; 3; 3]; [10; 10; 11]; [10; 12; 30]; [B; B; B ]) – TB 2 = ([1]; [5]; [5]; [B ]) – TB 3 = ([3; 3]; [20; 20]; [20; 31]; [B; B ]) Host C – TC 1 = ([5; 2]; [13; 12]; [30; 30]; [C; C ]) –
In addition, there are two DMGF applications running on B and C that retrieve database value from A:
TBA = ([1; 1; 1]; [7; 7; 7]; [7; 7; 7]; [B; A; B ]) TCA = ([2; 1]; [3; 5]; [3; 5]; [C; A]) Later in this paper, we shall show how to determine the schedulability of this task set under the fixed priority scheduling discipline. A crucial observation on the feasibility of DGMF task sets is given by the following theorem. Theorem 1 The feasibility problem of a set of DGMF tasks in a distributed system is equivalent to the feasibility problem of a set of GMF tasks on a single processor. Proof: For each DGMF task set, we can derive a set of GMF tasks for each host processor in the distributed system and we shall prove that the DGMF set is feasible if and only if the GMF task set on every host is feasible on the corresponding processor. Suppose there are totally m DGMF tasks and n hosts in this distributed system. For a DGMF task T i ; 1 i m and a host H j ; 1 j n, let’s say H j occurs l times in H~ i at indices 0 i1 < i2 < : : : < il < N . We de~ 0 ; D~ 0 ; P~ 0 ) on H j where E~ 0 = fine a GMF task Tij = (E 0 ~ [Ei1 ; Ei2 ; : : : ; Eil ], D = [Di1 ; Di2 ; : : : ; Dil ], and P~ 0 = ;1 Pk ]. [ik2=;i11 Pk ; ik3=;i12 Pk ; : : : ; ikl=;i1l;1 Pk ; Nk=;il1 Pk +ik1=0 i Tij is defined to be an empty GMF task if T has no execution on H j . We can thus define a GMF task set on each host H j to be Sj = fT1j ; T2j ; : : : ; Tmj g. If we consider the n hosts to define a n-dimensional resource space, T ij is the projection of T i onto H j . The DGMF model is thus a job shop model for real-time tasks. It is obvious that any schedule of the m DGMF tasks yields n schedules of the GMF task sets running on n hosts separately. So if the DGMF task set misses a deadline on a host, the corresponding GMF task set on that host will miss its deadline also for the same task invocation pattern. On the other hand, if a GMF task set on a host misses a deadline, we can construct a schedule of the DGMF task
set by simply inserting the missing frames into each DGMF task from which the GMF task is derived. The DGMF set so constructed misses a deadline also on that host. Note: Concurrent running of n GMF task sets on n hosts does not necessarily map into a schedule of the DGMF set, because the GMF frames derived from a DGMF task may be executed concurrently on different hosts, and this is not allowed for a DGMF task. Hence a naive mapping of DGMF tasks into GMF tasks will not work.
2.1 Advantages of DGMF Over Liu & Layland Model Inasmuch as the Liu & Layland-type classical task model assumes a single resource type, it cannot deal with distributed real-time tasks such as those in the DGMF model. We note that even on a single processor, the GMF task model is still necessary in some application domains, especially in industrial process control where a task cannot be simply modeled as repetitive occurrences of a single job. These tasks normally consist of a sequence of job steps. For example, a batch process requires a sequence of procedures to be performed one after another, one procedure in every period; this is different from procedures which are partially ordered but are performed in the same period. It is logically convenient to model such correlated procedures as a single task rather than several independent Liu & Laylandtype classical tasks. On the other hand, a GMF task cannot be represented by an equivalent set of Liu & Layland-type tasks for the purpose of schedulability analysis. One attempt is to model a GMF task as a set of rigid classical tasks. A rigid task (A; E; D; P ) is a task that starts exactly at time A and the consecutive occurrences are separated by exactly P time ~ D; ~ P~ ), units, i.e., P is its period. For a GMF task T = ( E; 0 0 0 the corresponding rigid task set is S T = f(Ai ; Ei ; Di ; P 0 ) j 0 i < N g, where
A0i = a0 + ij=0 Pj , Ei0 = Ei mod N , Di0 = Di mod N , and P 0 = Ni=0;1 Pi .
A set of GMF tasks is equivalent to a union of such corresponding rigid sets only if each GMF task starts at a fixed time and occurs periodically with its minimum separation time [6]. The benefit of the GMF model, however, lies in the fact that it is not rigid and this makes it possible for us to deal with the possibility that the arrival times of a task (frame) at different hosts to be not strictly periodic in the distributed environment. Computationally, the feasibility problem for GMF is not much harder than the rigid tasks
A 0
A1
B1 A2 B2 A1 B1 A2 B2 2 4 6 8 10 12 (b) Rigid task set of the GMF set
A1
A2 A1 A2 2 4 6 8 10 12 (c) Rigid set with minimum separation time
0
0
B A B A 2 4 6 8 10 (a) GMF: 2nd frame of task B starts at 6
Figure 1. Scheduling GMF and Rigid Task Set
since there is a pseudopolynomial-time algorithm for GMF task sets [2]. On the other hand, the feasibility of the rigid task set of a GMF task set does not necessarily guarantee that the GMF set itself is also feasible. For example, the GMF tasks A = ( E~A ; D~A ; P~A ) = ([2; 1]; [2; 2]; [4; 2]) and B = (E~B ; D~B ; P~B ) = ([1; 1]; [3; 2]; [4; 2]) are not feasible together, but the = corresponding rigid task set fA 1 ; A2 ; B1 ; B2 g f(0; 2; 2; 6); (4; 1; 2; 6); (0; 1; 3; 6); (4; 1; 2; 6)g is feasible as is shown in Figure 1 (a) and (b). In Figure 1 (a), the third frame of task A and the second frame of task B both start at time 6. A misses deadline at time 8. This removes the possibility to test GMF feasibility with Liu & Layland-type periodic task models. Another attempt would be to relax the period in the rigid task to be the minimum separation time. This has two problems. First, the semantic ordering of the frame occurrence in the GMF task will be violated; second, some feasible GMF task sets will become infeasible. In fact, the rigid set of the single GMF task A becomes infeasible, as is shown in figure 1 (c) where the second request of A 1 and the second request of A 2 both start at time 10 and A 2 misses a deadline at time 12. The above argument justifies on both semantic and feasibility-analytic grounds that the DGMF model is worth studying in the scheduling of distributed real-time systems. Since the schedulability problem of DGMF tasks is reducible to that of GMF tasks, we can now pay our attention to GMF tasks. It has been proven that the feasibility of GMF task set is no more difficult (from a complexity point of view) than the earlier, simpler models [2]. We shall therefore focus on the schedulability problem of (D)GMF tasks under the fixed-priority scheduling discipline. Our result will enable us to partially solve the problem of fixed priority scheduling for distributed real-time systems.
3 Exact Schedulability Test When every task in a GMF task set has only one frame, the deadline-monotonic priority has been proven to be optimal and the exact schedulability test is done using the concept of the critical instant [1]. For MF task set, the ratemonotonic priority assignment is proven to be optimal and the schedulability test can be done using the critical instant of the peak frame [3]. Given that each frame in a typical GMF task has different execution time, deadline, and minimum separation time, we cannot assign a single priority to a GMF task by, say, a rate-monotonic-like priority assignment, nor can we identify any peak frame or critical instant since the minimum separation time of frames is now variable, i.e., the maximum execution time requirement may not be the most critical since its minimum separation time can be very long. To test a GMF task’s schedulability, we have to test each frame against all possible frame arrival patterns. The schedulability problem of a GMF task set is thus more complex. If the fixed priority scheduling discipline is to be used to schedule DGMF tasks, we could assign a single priority to each GMF task (task-wise-priority-assignment) or we could assign different priorities to different frames (frame-wisepriority-assignment). The former is a special case of the latter in which all frames have the same priority. We shall adopt frame-wise-priority-assignment in our derivation of the exact schedulability test in the next subsection. The analytical result will yield an algorithm for testing schedulability accordingly. Finally, we shall analyze the priority assignment and prove that there is still optimal priority assignment for some special cases of GMF task set.
3.1 Schedulability Test We assume that the frame priorities are already assigned and determine whether the given priority assignment will meet all timing constraints. First, we need some definitions. Suppose there are L priority levels with level 1 the lowest and level L the highest. Consider an N frame GMF task ~ D; ~ P~ ) and a priority level ; 1 L. T = (E;
Let g (T; ; i; j ) with i 0; j > 0 denote, for j successive frames starting from the ith frame, the cumulative execution requirement of all frames with priority higher than . For i N :
g(T; ; i; j ) = g(T; ; s; j ); i = r N + s; 0 s < N Consider 0 i < N :
g(T; ; i; j ) = jk+=ii;1 ek mod N ; where l if priority of E l > el = E 0 if priority of E ; 0 < j N l
g(T; ; i; j ) = r g(T; ; i; N ) + g(T; ; i; s); N < j = r N + s; 0 < s N
Next, we define a function G(T; ; i; t) for t = 0; 1; 2; : : :; that measures, starting from the ith frame,
the cumulative execution requirement requested by the frames of T with priority higher than over an interval of length t (it is not required that all this execution requirement be from frames that have deadlines within ;1 the interval). Let t = r N l=0 Pl + s, the function G(T; ; i; t) can be computed as follows:
G(T; ; i; t) = r g(T; ; i; N ) + g(T; ; i; j + 1);
j is the biggest number such that +(i mod N );1 P jl=( We define l mod N < s. i mod N ) G(T; ; i; 0) = 0. G(T; ; i; t) is a periodic in;1 creasing step function that repeats every N l=0 Pl time units. Each repetition has at most N steps. Suppose T has l priorities in non-decreasing order as 1 ; 2 ; : : : ; l , we have: G(T; 1; i; t) = G(T; ; i; t) G(T; 1 ; i; t); 1 < 1 G(T; r ; i; t) = G(T; ; i; t) G(T; r+1 ; i; t); 1 r < l; r < < r+1 G(T; l ; i; t) = G(T; ; i; t) = 0; l < L So the number of G(T; ; i; t) functions we really need to calculate for the ith frame of T is l N . In the case when all frames have the same priority , we only need to calculate G(T; ; 1; i; t), and G(T; 1; i; t) = G(T; 2; i; t) = : : : = G(T; ; 1; i; t); G(T; ; i; t) = G(T; + 1; i; t) = : : : = G(T; L; i; t) = 0. where
We shall assume that two frames from different tasks are given different priorities; we can arbitrarily break the tie by designating a higher priority to one of them.
Theorem 2 A task T in a GMF set S is schedulable if and only if for every frame i, with 0 i < N; and frame priority i , it is true that for any iT 0 th frame of T 0 2 (S ;fT g); 0 iT 0 < N 0 , the following inequality holds: 9t 0 < Di such that
Ei + T 0 2(S;fT g) G(T 0 ; i ; iT 0 ; t0 ) t0 :
(1)
Proof: Since there is no peak frame, we have to make sure all frames in T are schedulable. We need to prove that for each ith frame of T to meet its deadline, it is necessary and sufficient that the Inequality 1 holds for all possible combinations of other task frames. The proof strategy is identical to the one we used for Lemma 1 in [3], as described below. That Inequality 1 is necessary for the ith frame of T to always meet its deadline is easily seen: For each possible iT 0 th frame of task T 0 6= T , consider the case in which the ith frame of T arrives at time 0, simultaneously with all such iT 0 th frames. Let t0 denote the latest time in all these scenarios at which the ith frame of T completes. The total execution requirement by higher priority frames of T 0 over the interval [0; t0 ) is equal to G(T 0 ; i ; iT 0 ; t0 ), by definition of the function G(T; ; i; t). Inequality 1 follows. The proof that Inequality 1 is sufficient hinges upon the observation that the “worst case” scenario — the one that makes it most likely that the ith frame of T will miss its deadline — occurs when it arrives simultaneously with frames from all other tasks. This observation is proved in a manner virtually identical to the manner in which similar “critical-instant” results have been proved in, e.g., [18, 21], and we shall not repeat it here. Since all possible combinations of other task frames are tested to be true for Inequality 1, at least one of them is the worst case in which T meets the deadline. Theorem 2 is a necessary and sufficient test, but we need to check all possible combinations of task frames. We choose a frame from each task and start them simultaneously at the maximum frequency and test if all of the frames meet the first deadlines. This test has to be done for every combinations of task frames. We give a sufficient test in the following that requires only one test per frame. We define a function G(T; ; t) for t = 0; 1; 2; : : :; that measures the maximum cumulative execution requirement that can be requested by frames of T with priority higher than over an interval of length t (it is not required that all this execution requirement be of frames that have deadlines within the interval). By definition, the function G(T; ; t) can be computed as follows:
N ;1 G(T; ; t) = max G(T; ; i; t) i=0
(2)
G(T; ; t) is also a periodic increasing step function that ;1 repeats every N l=0 Pl time units. Each repeat has at most N N steps. Thus G(T; ; t) can be stored in an array of size N N where each entry is a pair of values representing a time point and step increase. Suppose T has l priorities in non-decreasing order as 1 ; 2 ; : : : ; l , we have: G(T; 1; t) = G(T; ; t) G(T; 1 ; t);
1 < 1 G(T; r ; t) = G(T; ; t) G(T; r+1 ; t); 1 r < l; r < < r+1 G(T; l ; t) = G(T; ; t) = 0; l < L So the number of G(T; ; t) functions we really need to calculate for T is l N . In the case when all frames have the same priority , we only need to calculate G(T; ; 1; t), and G(T; 1; t) = G(T; 2; t) = : : : = G(T; ; 1; t); G(T; ; t) = G(T; + 1; t) = : : : = G(T; L; t) = 0. Since G(T; ; t) G(T; ; i; t) by definition, we have
0
T11 T12 T2 2 4 6 8 10 (a) Frame-wise rate-monotonic assignment
T11 T2 T12 T11 0 2 4 6 8 10 12 (b) T2’s priority between 1st & 2nd frame of T1 Figure 2. Frame-wise Rate-Monotonic Assignment
the following from Theorem 2:
Corollary 1 A task T in a GMF set S is schedulable if for every frame i; 0 i < N; with priority i , the following inequality holds: 9t 0 Di such that
Ei + T 0 2(S;fT g) G(T 0 ; i ; t0 ) t0 :
(3)
3.2 Schedulability Test Algorithm A necessary and sufficient schedulability test algorithm can be derived from Theorem 2. Here we give a sufficient algorithm derived from Corollary 1. Given a GMF task set with a priority assigned to each frame, we use the following steps to test its schedulability.
For each frame i; 0 i < N of task T with priority , calculate G(T; ; 1; t) and store it in an array. Use Corollary 1 to test the schedulability of each frame. Following the response-time analysis method of Joseph and Pandya [10], we transform the problem of determining whether Inequality 3 is true to the problem of determining whether the equation
t0 = Ei + T 0 2(S;fT g)G(T 0 ; i ; t0 ) (4) has a fixpoint for t 0 that is no larger than D i . And this can be determined using the iterative method proposed by Audsley et al. [1]:
R = Ei for (; ; )f R0 = Ei + T 0 2(S;fT g) G(T 0 ; i ; R) If (R0 > Di ) fdeadline missed; returng If (R0 = R) fdeadline met; returng R = R0
g
This sufficiency test is considerably cheaper. However, we do not propose this as an on-line test, especially when priorities are not pre-determined, in which case we have to test all possible priority assignments.
3.3 Priority Assignment For the classical Liu & Layland-type task model, ratemonotonic or deadline-monotonic priority assignment is optimal for the fixed priority scheduling discipline. This is true for MF model as well. Unfortunately, this is no longer the case for (D)GMF model. Since there is no one deadline for a task’s frames, there is no way to assign ratemonotonic or deadline-monotonic priority on a task-wise basis. We can only perform such kind of priority assignment per frame. The “frame-wise rate-monotonic” assignment — i.e., the frame with smaller deadline has higher priority — is not optimal, as is illustrated in Figure 2 for GMF task set S = fT1 ; T2 g = f((4; 2); (4; 4); (4; 4)); ((1); (6); (6))g. In Figure 2(a) task T 2 of S misses deadline at time 6 with frame-wise rate-monotonic priority assignment. Notice that S is schedulable if we assign the first frame of T 1 the highest priority, the second frame of T 1 the lowest priority, and the only frame of T 2 the middle priority(Figure 2(b)). It is interesting to note that in this case S can be also modeled as a MF task set: f((4; 2); 4); ((1); 6)g. We have proved in [3] that the rate-monotonic assignment is optimal for the MF model. Figure 2 shows that optimality is not guaranteed if we allow frame-wise priority assignment. An unschedulable MF tasks may become schedulable if frame-wise priority assignment is used. As a practical note, frame-wise priority assignment is also preferred in many real world applications where some parts of a sequential task requires more attention than the others. For task-wise priority, we have the following two theorems with regard to rate-monotonic assignment for some special cases of GMF task sets. Theorem 3 Deadline-monotonic priority assignment is optimal for a GMF task set if the frame deadlines within each task are the same. Proof: For each task T , we name the frame with the biggest execution time to be the peak frame. First, we prove
that T is schedulable if and only if Inequality 1 holds for the peak frame. As schedulability of T implies that the peak frame is also schedulable, so is Inequality 1 true. On the other hand, if Inequality 1 is true for the peak frame, the same t0 will render Inequality 1 true for all other frames, since the execution time of the peak frame is the biggest. Hence T is schedulable. So to test schedulability of T , we only need to test the peak frame of each task. Given a schedulable priority assignment, find two tasks T 1 and T2 with adjacent priorities but the T1 with smaller deadline has lower priority. For the peak frames of T 1 and T2 and any fixed combinations of other task frames, let t 0 to be the value for T 1 that satisfies Inequality 1. t 0 D1 D2 . If we switch the priority of T 1 and T2 , t0 should be the solution for the Inequality 1 of T 2 ’s peak frame for any frame of T 1 . Hence T2 is schedulable. T1 is schedulable because its priority increases. For any schedulable priority assignment, we can apply the same pair-wise priority switch repetitively until we get a schedulable deadline-monotonic priority assignment. Since the deadlines of a MF task are all equal to its period, we have: Corollary 2 If a feasible priority assignment exists for a system of MF tasks, then the rate-monotonic priority assignment is feasible for that system Corollary 2 is Theorem 2 in [3]. Theorem 4 Deadline-monotonic priority assignment is optimal for a GMF task set if the frame execution times within each task are equal. The deadline of a task refers to its smallest frame deadline. The proof of Theorem 4 is similar to that of Theorem 3. We do not repeat it here. Note: It is known that the optimality of rate/deadlinemonotonic priority assignment is limited to the fixed priority scheduling of the classical Liu & Layland-type task model. It is not necessarily optimal for other extended models where task deadlines are not equal to their periods. In this section we have shown that it is still optimal for certain types of DGMF task sets.
4 Solution to the Example in Section 2 We can now analyze the task set given in Example 1 in Section2 by using the results we have derived from the previous sections. We want to decide whether the distributed system in the example can be scheduled with a fixed priority scheduler. We rewrite the task set in the following in which a DGMF task running on a single host is represented as a GMF task.
Task on Host A
TA1 = ([1]; [2]; [3]) Tasks on Host B – TB 1 = ([3; 3; 3]; [10; 10; 11]; [10; 12; 30]) – TB 2 = ([1]; [5]; [5]) – TB 3 = ([3; 3]; [20; 20]; [20; 31]) Task on Host C – TC 1 = ([5; 2]; [13; 12]; [30; 30]) –
Tasks on Multiple Hosts – –
TBA = ([1; 1; 1]; [7; 7; 7]; [7; 7; 7]; [B; A; B ]) TCA = ([2; 1]; [3; 5]; [3; 5]; [C; A])
We shall only consider task-wise priority assignment here. Derive GMF tasks from DGMF tasks. We have already rewritten single host DGMF tasks as GMF tasks above. Now let’s consider tasks running on multiple hosts. Applying the method used in Theorem 1, we break T BA into TB 4 = ([1; 1]; [7; 7]; [14; 7]) on host B and T A2 = ([1]; [7]; [21]) on host A; we break TCA into TC 2 = ([2]; [3]; [8]) on host C and TA3 = ([1]; [5]; [8]) on host A. Host A. The GMF task set fTA1 ; TA2 ; TA3 g on host A is equivalent to a set of Liu & Layland tasks. Using deadline-monotonic assignment, it is easy to find that the set is schedulable by checking the critical instants. Host B . The GMF task set is fTB 1 ; TB 2 ; TB 3 ; TB 4 g on host B . Since the execution times within each task are equal, we can use deadline-monotonic priority assignment and only test the peak frames. In this case task T B 2 will have the highest priority 4, then T B 4 with 3, TB 1 with 2, and TB 3 with 1. TB 2 is schedulable with the highest priority. For TB 4 :
R = EB4 = 1 R0 = EB4 + G(TB2 ; 3; R) = EB4 + G(TB2 ; 3; 1) = 1+1 = 2 R0 = EB4 + G(TB2 ; 3; 2) = 1+1 = 2 Since the last two values computed for R’ are the same, it follows that the response-time of T B 4 ’s peak frame is 2. This is less than its minimum separation parameter of 7; therefore TB 4 is schedulable.
For TB 1 :
R = EB 1 = 3 R0 = EB1 + G(TB2 ; 2; R) + G(TB4 ; 2; R) = EB1 + G(TB2 ; 2; 3) + G(TB4 ; 2; 3) = 3+1+1 = 5 0 R = EB1 + G(TB2 ; 2; 5) + G(TB4 ; 2; 5) = 3+1+1 = 5 So TB 1 is schedulable. For TB 3 :
R = EB3 = 3 R0 = EB3 + G(TB2 ; 1; R) + G(TB4 ; 1; R) + G(TB1 ; 1; R) = EB3 + G(TB2 ; 1; 3) + G(TB4 ; 1; 3) + G(TB1 ; 1; 3) = 3+1+1+3 = 8 R0 = EB3 + G(TB2 ; 1; 8) + G(TB4 ; 1; 8) + G(TB1 ; 1; 8) = 3+2+2+3 = 10 R0 = EB3 + G(TB2 ; 1; 10) + G(TB4 ; 1; 10) + G(TB1 ; 1; 10) = 3+2+2+3 = 10 So TB 3 is also schedulable. Host C . The GMF task set is fTC 1 ; TC 2 g on host C . We
cannot apply the deadline-monotonic priority assignment. There are two choices, giving T C 1 higher priority, or giving TC 2 higher priority. It is easy to see that T C 2 will miss a deadline if it has lower priority. Let us assign priority 1 to TC 1 and 2 to TC 2 . TC 2 is hence schedulable. For the first frame of TC 1 :
R = EC 11 = 5 R0 = EC 11 + G(TC 2 ; 1; R) = EC 11 + G(TC 2 ; 1; 5) = 5+2 = 7 0 R = EC 11 + G(TC 2 ; 1; 7) = 5+2 = 7
Host A A1
A1 CA A1 BA A1
Hoat B B2 BA
B1 B2
Host C
CA 0
B3
C1
CA A1
B2
A1
B1 BAB2
CA 5
A1 CA A1
B2 BA B1
CA 10
15
A1
A1 CABAA1
B2
B3
B2
CA 20
25
C1 30
Figure 3. A Running Case of the Example Distributed System
So the first frame of T C 1 is schedulable. For the second frame of T C 1 :
R = EC 11 = 2 R0 = EC 11 + G(TC 2 ; 1; R) = EC 11 + G(TC 2 ; 1; 2) = 2+2 = 4 R0 = EC 11 + G(TC 2 ; 1; 4) = 2+2 = 4 So the second frame of T C 1 is also schedulable.
Result. This distributed system is schedulable using task-wise fixed priority assignment. A possible global priority assignment in decreasing order of priority is TA1 ; TB2; TCA; TC 1 ; TBA; TB1 ; TB3 . And figure 3 is a schedule of this distributed system.
5 Conclusion In this paper, we propose DGMF, a distributed generalized multiframe task model for distributed real-time systems, where processors are heterogeneous, task frames may not be strictly periodic and have individual frame-wise relative deadlines which can be used to enforce inter-frame precedence constraints. We demonstrate the advantage of the DGMF model over classical Liu & Layland-type models on both semantic and schedulability-analytic grounds. We prove that this model can be reduced to the GMF (generalized multiframe) task model in terms of feasibility analysis. In previous work [2], we studied the feasibility problem of GMF tasks, i.e., whether there is a feasible schedule by any scheduler. In this paper, we study the schedulability problem of (D)GMF tasks under the preemptive fixed-priority scheduling discipline for frame-wise priority assignment, i.e., whether a
(D)GMF task set is schedulable by the fixed-priority scheduler for frame-wise priority assignment. In general, frame-wise priority assignment makes it more likely for a task set to be schedulable. However, the rate-monotonic assignment is no longer optimal for framewise priority assignment in the MF (multiframe) model. While the optimality of the rate-monotonic assignment no longer applies to GMF tasks in the general case, we show that it is still the best for certain special cases of (D)GMF task sets. We derive a necessary and sufficient condition for schedulability for the general case, and give a sufficient condition together with a cheaper computational method for schedulability testing. This paper does not deal with the assignment of relative deadlines which was discussed in [19] in the context of the processor allocation problem and more recently by other researchers [22, 11, 23, 4]. A number of heuristics have been proposed for the deadline assignment problem, and some performance bounds have been obtained. A simple heuristic for relative deadline assignment is to divide the end-to-end deadline evenly to yield the same relative deadline for every frame in a task. Our results in section 3 justifies the optimality of the deadline-monotonic priority assignment for this case, as well as the case where the computation of each task is divided into equal-sized trunks of execution time. In the general case, the optimal assignment of frame-wise priority can be computationally expensive even if the relative deadlines are given for (D)GMF tasks, inasmuch as, unlike the classical Liu & Layland model, the deadline-monotonic assignment is not optimal in the (D)GMF case. Further work is needed to better understand the relationship between relative deadline assignment and the complexity of exact schedulability analysis. As we have shown in this paper, we can investigate such issues in the context of the DGMF model. The GMF model, upon which this new model is based, was introduced in [2], where only its feasibility problem was analyzed. In this paper, we investigate the schedulability problem of (D)GMF.
References [1] N. C. Audsley, A. Burns, M. F. Richardson, and A. J. Wellings. Hard real-time scheduling: The deadline monotonic approach. In 8th IEEE Workshop on Real-Time Operating Systems and Software, May 1991. [2] S. K. Baruah, D. Chen, S. Gorinsky, and A. K. Mok. Generalized multiframe tasks. Real-Time Systems Journal, 1998. [3] S. K. Baruah, D. Chen, and A. K. Mok. Static-priority scheduling of multiframe tasks. In Euromicro Conference on Real-Time Systems, June 1999. [4] R. Bettati. End-to-End Scheduling to Meet Deadlines in Distributed Systems. PhD thesis, the University of Illinios at Urbana-Champaign, 1994.
[5] A. Burns, K. Tindell, and A. Wellings. Effective analysis for engineering real-time fixed priority schedulers. IEEE Transactions on Software Engineering, 21(5):475–480, 1995. [6] D. Chen, A. K. Mok, and S. K. Baruah. On modeling realtime task systems. Lecture Notes in Computer Science - Lectures on Embedded Systems, 1494, October 1997. [7] M. Dertouzos. Control robotics: The procedural control of physical processes. In Proceedings of the IFIP Congress, pages 807–813, 1974. [8] C.-C. Han. A better polynomial-time scheduleability test for real-time multiframe tasks. In IEEE Real-Time Systems Symposium, December 1998. [9] M. G. Harbour, M. H. Klein, and J. P. Lehoczky. Timing analysis for fixed-priority scheduling of hard real-time systems. IEEE Transaction on Software Engineering, 20(1):13– 28, January 1994. [10] M. Joseph and P. Pandya. Finding response times in a realtime system. The Computer Journal, 29(5):390–395, October 1986. [11] B. Kao and H. Garcia-Molina. Deadline assignment in distributed soft real-time systems. In 13th IEEE International Conference on Distributed Computing Systems, pages 428– 437, 1993. [12] M. Klein, T. Ralya, B. Pollak, R. Obenza, and M. G. Harbour. A Practitioner’s Handbook for Real-Time Analysis: Guide to Rate Monotonic Analysis for Real-Time Systems. Kluwer Academic Publishers, Boston, 1993. [13] J. P. Lehoczky. Fixed priority scheduling of periodic task sets with arbitrary deadlines. In IEEE Real-Time Systems Symposium, December 1990. [14] J. P. Lehoczky and L. Sha. Performance of real-time bus scheduling algorithms. ACM Performance Evaluation Review, 14:44–53, 1986. [15] J. P. Lehoczky, L. Sha, and Y. Ding. The rate monotonic scheduling algorithm - exact characterization and average case behavior. In IEEE Real-Time Systems Symposium, December 1989. [16] J. Y.-T. Leung and M. L. Merrill. A note on preemptive scheduling of periodic, real-time tasks. Information Processing Letters, 11(3):115–118, November 1980. [17] J. Y.-T. Leung and J. Whitehead. On the complexity of fixedpriority scheduling of periodic, real-time tasks. Performance Evaluation, 2:237–250, 1982. [18] C. L. Liu and J. W. Layland. Scheduling algorithms for multiprogramming in a hard-real-time environment. Journal of ACM, 20(1), January 1973. [19] A. K. Mok. Fundamental Design Problems of Distributed Systems for the Hard-Real-Time Environment. PhD thesis, MIT, 1983. [20] A. K. Mok and D. Chen. A multiframe model for real-time tasks. In IEEE Real-Time Systems Symposium, December 1996. [21] A. K. Mok and D. Chen. A multiframe model for real-time tasks. IEEE Transaction on Software Engineering, 1997. [22] L. Sha, R. Rajkumar, and J. P. Lehoczky. Priority inheritance protocols: an approach to real-time synchronization. IEEE Transactions on Computers, 39, 1990. [23] J. Sun and J. S. Liu. End-to-end synchronization protocols of fixed priority periodic tasks. In 16th IEEE International Conference on Distributed Computing Systems, 1996.