Efficient Online Schedulability Tests
for Real-Time Systems
Tei-Wei Kuo, Senior Member, IEEE, Li-Pin Chang,
Yu-Hua Liu, and Kwei-Jay Lin, Senior Member, IEEE
Abstract—Many computer systems, such as those for open system environments or multimedia services, need an efficient schedulability test for online admission control of new jobs. Although various polynomial time schedulability tests have been proposed, they often fail to decide the schedulability of the system precisely when the system is heavily loaded. On the other hand, most precise schedulability tests proposed to date have a high complexity and may not be suitable for online tests. In this paper, we present new efficient online schedulability tests for both the periodic process model [8] and the multiframe process model [1] in uniprocessor environments. The schedulability tests are shown to be more precise and efficient than any existing polynomial-time schedulability tests. Moreover, the tests can be done incrementally as each new task arrives at the system. Our proposed tests can also be used for the multiframe model where a task may have different computation times in different periods. We show the performance of the proposed schedulability tests in several simulation experiments.
Index Terms—Real-time systems, schedulability test, division graph, reduced set, multiframe process, open system environment, MPEG streams, time reservation.
æ
1
I
NTRODUCTIONC
OMPUTERservers with real-time capabilities are in greatdemands. Many of our daily activities, both personal and business, must make use of some computers in some contiguous interval (e.g., an hour or so). These activities must be done in an interactive and real-time manner (e.g., online entertainment, video conference, distance learning, etc.) The servers therefore must be able to handle a dynamic workload and yet provide a predictable performance. One proposal to build real-time servers for complex environ-ments is the model of open systems. In an open real-time system environment [32], [35], various applications may run concurrently using different application schedulers. Due to the dynamic nature of the system workload, the admission test must admit or reject applications (or threads) dynami-cally, precisely, and efficiently. A new application (or thread) can be admitted only if the available resources can serve both the new application (or thread) and all existing applications (or threads) without violating any individual service requirement.
The schedulability test for priority-based task set has been extensively studied [1], [2], [6], [8], [13], [15], [20], [21], [30]. Some of them are known to be precise [13], [15], [20], [21]. However, precise tests usually have high time
complexities and may not be adequate for online admission control if the system has a large number of tasks or a dynamic workload. Efficient online schedulability tests are needed for many computer systems with performance guarantee, such as those that consider open system environments [32], [35] or time reservation, where real-time and non-real-real-time applications may be admitted in a dynamic fashion. Efficient online schedulability tests and admission control policies are also useful to various service-critical systems, such as tele-medicine systems, tele-conferencing systems, multimedia services that have Quality-of-Service (QoS) requirements [14], [31], and real-time traffic scheduling over networks [3], [9], [24], [29]. In particular, Cheng et al. [3], [9], [24], [29] have considered online admission control for priority-driven switch sche-duling and routing over packet-switched networks, where online schedulability tests are proposed for efficient admission control.
In addition to their complexity, many precise tests for priority-driven systems require iterative calculations of the task response time in the presence of higher priority tasks. It is therefore difficult to develop an intuitive understanding on how a timing parameter change in one task may affect the rest of the system schedulability. Closed-form (but imprecise) tests, in comparison, give a more intuitive reasoning on the effect of changing certain timing para-meters on the system performance. On the other hand, efficient schedulability tests provide online polynomial-time tests. For example, harmonic-period-based schedul-ability tests [5], [6], [7], [30] utilize the jitterless behavior among tasks with harmonic periods and use it to increase the accuracy of the schedulability. Since many real-time tasks can be designed to execute in any period size, selecting a task period wisely to make it harmonic to other periods will have a big payoff in the system schedulability. Similarly, many multimedia tasks or control tasks have only a few base execution frequencies. For example, the servicing
. T.-W. Kuo and L.-P. Chang are with the Department of Computer Science and Information Engineering, National Taiwan University, Taipei, Taiwan 106, ROC. E-mail: {ktw, d6526009}@csie.ntu.edu.tw.
. Y.-H. Liu is with the Department of Computer Science and Information Engineering, National Chung Cheng University, Chiayi, Taiwan 621, ROC.
. K.-J. Lin is with the Department of Electrical and Computer Engineering, 516D Engineering Tower, University of California, Irvine, Irvine, CA 92697. E-mail: [email protected].
Manuscript received 25 Oct. 2000; revised 20 June 2002; accepted 2 Apr. 2003.
Recommended for acceptance by A. Cheng.
For information on obtaining reprints of this article, please send e-mail to: [email protected], and reference IEEECS Log Number 113045.
of video streams in a video-on-demand (VOD) system could often be modeled by a pair of parameters (Bi, Pi), which means that the stream might need the system to deliver up to Bi bytes for every each Pi time units [31], [28], [34]. The periods of the servicing processes are often harmonic for better bandwidth utilization. The resource management of output devices could also be done in the same way [10], where each application could request to output to the framebuffer Bibytes of information for every Pi time units. Real-time garbage collection activities for flash-memory storage systems are introduced in [23] in a similar way. By analyzing the system schedulability based only on these basic (or root) period values, we show in this paper that the system performance can be more accurately predicted.
In this paper, we present new efficient online schedul-ability tests for both the periodic process model [8] and the multiframe process model [1] in uniprocessor environ-ments. The major contributions of this work are as follows: 1. We exploit the harmonic relationship of task periods to provide a more precise schedulability test for the periodic process model [8]. The proposed schedul-ability test not only is much more precise than existing schedulability tests [2], [6], [7], [8], [30], but also has an efficient implementation.
2. Our proposed methodology can also be used for the multiframe process model [1] when a task may have a different execution time requirement in different periods.
3. An incremental schedulability test algorithm has been proposed for online admission control of newly arrived tasks. The incremental algorithm does not need to recompute the response time of all tasks as in some precise schedulability tests [13], [15], [20], [21]. 4. Our tests are especially effective for systems with heavy loads. As will be shown later in this paper, our proposed schedulability tests are shown to be much more precise than many existing polynomial-time schedulability tests [2], [6], [7], [8], [30] when the system is heavily loaded.
We must point out that the techniques proposed in this paper are orthogonal to the past work in the overhead modeling and complicated scheduling algorithms, such as subperiod deadlines, sporadic servers, and process syn-chronization. The goal of this paper is to provide a theoretical base for more efficient schedulability tests. The concept developed in this paper could be integrated with the work in the Rate Monotonic Analysis [15], [21] regarding the overhead handling of context switches and sporadic-server-based analysis [4] and the work in process synchronization regarding blocking time analysis, e.g., [22]. The rest of this paper is organized as follows: Section 2 provides an overview of well-known schedulability tests and compares their pros and cons. Section 3 presents our precise polynomial-time schedulability test for the Liu and Layland model [8]. We provide a theoretical foundation for efficient schedulability tests by exploring the harmonic relationship of task periods. An efficient incremental algorithm is presented for online admission control. Section 4 extends the proposed schedulability test for the multiframe process model [1]. The simulation results for the
proposed schedulabilty tests for the Liu and Layland process model and the the multiframe process model are shown in Section 5. Our tests are especially effective for systems with heavy loads. Our proposed schedulability tests are shown to be much more precise than many existing polynomial-time schedulability tests [2], [6], [7], [8], [30] when the system is heavily loaded. We conclude the paper in Section 6.
2
O
VERVIEWThe real-time resource allocation problem has been an active research topic in recent decades. Liu and Layland [8] first introduced the concept of achievable utilization factor to provide a quick test for deciding the schedulability of a set of independent periodic processes with a fixed execution time and period. In [5], Han and Lin defined the temporal distance constraints among processes and investigate systems with harmonic task periods. The concept of harmonic task periods has also been investi-gated by Kuo and Mok [30] in their study of adaptive system workloads. Han and Tyan [6], [7] proposed new and more precise polynomial-time schedulability tests for the Liu and Layland (independent) process model [8], which are shown to be better than the results proposed in [2], [8]. The proposed schedulability test is based on the comparison with a system consisting only of tasks with harmonic periods.
Under the Liu and Layland (independent) process model [8], the resource requirements of processes are fixed in every period, which can be modeled by two parameters ðci; piÞ. In this model, a task i must be serviced for ci time units per pi time interval. The utilization factor [8] of a system is defined by U¼X n i¼1 ci pi ;
where ciand piare the computation requirement and period of the process i, respectively.cpii is called the utilization factor of the process i. For the simplicity of presentation, we will use terminologies “task” and “process” interchangeably for the rest of the paper.
The online admission control of a new task i¼ ðci; piÞ can be done in terms of the concept of the achievable utilization factor [8]. The schedulability of a set of n processes is guaranteed if the utilization factor of the process set is no more than the achievable utilization factor UðnÞ ¼ nð21=nÿ 1Þ of the Rate Monotonic Scheduling (RMS) algorithm [8], which is an optimal fixed-priority scheduling algorithm. For example, let T be a set of four processes with period pi and computation requirement ci, summar-ized in Table 1. Note that Ui denotes the accumulative CPU utilization factor of processes 1; 2; . . . ; and i. The arrival of a new process with period 20 and computation requirement 3 would fail the admission control of the system because the utilization factor of the system becomes 95 percent and is far over the achievable utilization factor Uð5Þ ¼ 5ð21=5ÿ 1Þ ¼ 74:3 percent reported in [8]. As astute
readers may point out, the utilization factor of T already fails the achievable utilization factor Uð4Þ ¼ 4ð21=4ÿ 1Þ ¼ 75:7 percentreported in [8].
Although Liu and Layland [8] did provide an OðnÞ polynomial-time schedulability test for online admission control, their schedulability test fails to identify many schedulable process sets when the system is heavily loaded with a number of processes. The schedulability test proposed by Kuo and Mok [30] explores the harmonic relationship of session periods and was proven to be much better than the results of Liu and Layland [8]. They show that a process set with periods selected from K funda-mental frequencies is schedulable if the utilization factor of the process set is no more than UðKÞ ¼ Kð21=Kÿ 1Þ. For example, there are two fundamental frequencies in process set T in Table 1, and the schedulability of process set T is guaranteed under the schedulability test proposed by Kuo and Mok [30] because the utilization factor of T is no larger than Uð2Þ ¼ 2ð21=2ÿ 1Þ ¼ 82:8 percent. However, the arrival of new process (in the previous paragraph) still fails the schedulability test proposed by Kuo and Mok [30] because the utilization factor of the system becomes 95 percent and is still over Uð2Þ ¼ 2ð21=2ÿ 1Þ ¼ 82:8 percent. We should point out the schedulability test has a time complexity Oðn5=2Þ and cannot be easily implemented in an incremental way. The schedulability test also quickly deteriorates when the number of fundamental frequencies increases, or when the system is heavily loaded.
Han and Tyan [6] proposed a more precise polynomial-time schedulability test, which is shown to be better than the results proposed in [2], [8]. The proposed schedulability test is based on the transformation of process periods into a special pattern, i.e., a single fundamental frequency. For example, p0i¼ r 2blogðpi=rÞc, where pi and p0i are the original and new periods of each process i, respectively. The
selection of r must minimize the increase of the utilization factor after transformation. If the transformed process set is schedulable, then the original process set is schedulable. Since the periods of the transformed process set form a single fundamental frequency, the original process set is schedulable if the utilization factor of the transformed process set is no more than 100 percent. For example, process set T described in the previous paragraph has three candidates for r, where r 2 fpi=2dlog2ðpi=p1Þeg. Table 2 shows the transformed period p0
i of each process when a different r is selected. Obviously, when r ¼ 2:5 and 3, the minimum increase of the utilization factor, and the original process set is schedulable because the utilization factor of the transformed process set is no more than 100 percent. However, the arrival of new process (in the previous paragraph) still fails the schedulability test proposed by Han and Tyan [6] because, regardless of which r is selected, the utilization factor of the transformed process set will be far more than 100 percent. In fact, the utilization factors of the transformed process set will become 1.2666, 1.15, and 1.25 when r ¼ 1:875, 2:5, or 3 are selected, respectively. As astute readers may point out, the transformation proposed by Han and Tyan [6] usually results in the significant increase of processor utilization and damage the preciseness of their proposed schedul-ability test, especially at heavy system load. Furthermore, the schedulability test is quite complicated and has a time complexity Oðn2Þ for a system of n tasks and can not be implemented with an incremental algorithm because of the recalculation of the special base and, most importantly, the procedure in minimizing the increase of utilization factor.
In the following sections, we propose a polynomial-time schedulability test which is more precise and efficient than existing polynomial-time tests [2], [6], [8], [30]. We will show later that the proposed schedulability test signifi-cantly outperforms any other schedulability test [6], [8], [30], especially when the system is heavily loaded. The proposed schedulability test therefore meets the needs of many computer systems which can be moderately or heavily loaded and require efficient online admission control. We will then extend our results to the multiframe process model [1] when a task may have a different execution time requirement in different periods.
TABLE 1
piand ciDenote the Period pi and the
Computation Requirement of Process i, Respectively
Uiis the accumulative CPU utilization factor of processes up to i.
TABLE 2
3
E
FFICIENTS
CHEDULABILITYT
EST FOR THEL
IU ANDL
AYLANDM
ODEL3.1 Schedulability Test Based on the Liu and Layland Model
The purpose of this section is to propose more precise efficient schedulability tests. We show how the harmonic relationship could be used to improve the precision and the efficiency of schedulability tests. A basic schedulability test and its incremental implementation are then presented. We will show later in the performance evaluation that the proposed schedulability test outperforms many other existing schedulability tests [6], [8], [30].
3.1.1 Definitions
Before proceeding with the following discussion and proofs, some definitions from [8], [30] are in order. Definition 1: Division Graph [30].Given a set of real numbers
P ¼ fe1; e2; ; eng, we construct an irreflexive, asymmetric, transitive, acyclic directed graph G ¼ ðV ; EÞ such that
1. Every vertex 2 V has a corresponding ei2 P , i.e., jP j ¼ jV j.
2. There is a directed edge ðei; ejÞ 2 E if ejjei, where pjjpi means pi is an exact multiple of pj.
3. No arc ðei; ejÞ exists if ej6 jei.
A division graph represents the divisibility relation among a set of real numbers. Given a process set, the correspond-ing division graph of the periods of its processes can be obtained in a straightforward way.
Definition 2: Offspring Set.Let T ¼ f1; ; i; ; ng be a set of periodic processes. An offspring set of process iin T is a subset of T in which the period of each process divides the period of i.
We show later that processes in an offspring set would be merged together to provide a better schedulability test. There is no need to let an offspring set being the largest such set because we can have more flexibility in merging processes in an offspring set of whatever size.
Definition 3: Root. Let T ¼ f1; ; i; ; ng be a set of periodic processes. Process i is a root in T if there does not exist any process period in T which is larger than and can be divided by the period of i.
By the definition of roots, there can be more than one root process in a given process set. Each root process may be associated with more than one offspring set, and the offspring sets of different (root) processes may have intersection.
Defintion 4: Reduced Set and RSR. Suppose that is a periodic process with period p and computation requirement c. A set of n periodic processes, f1; ; i; ; ng, where process i has period pi and computation requirement ci, is a reduced set of ifPni¼1ci
pi¼
c
p, 8pi; pijp, and p ¼ maxni¼1pi, where pjjpi means pi is an exact multiple of pj. is called the RS-representative, or RSR, of the reduced set.
Example 1: Reduced sets, roots, and offspring sets. Let T ¼ f1; 2; 3; 4; 5g be a set of five processes and the
periods of 1, 2, 3, 4, and 5 are 3, 5, 15, 20, and 60, respectively. The division graph of process periods in T is shown in Fig. 1. There is a single root, i.e., 60, in the division graph of T , and there are several offspring sets of 5, e.g., f1; 2; 4g and f1; 2; 3; 4; 5g. There are also offspring sets for other processes in T . For example, f1; 2g is an offspring set of 3. A process is an RSR of a set f1; 2; 3g if the period of is 15, and the utilization factor of is equal to the sum of the utilization factors of 1, 2, and 3. f1; 2; 3g is a reduced set of .
3.1.2 Schedulability Theorems
We are interested in uniprocessor, fixed-priority-driven scheduling of independent hard real-time processes. The deadline of each request of a process is the next request time. Let T ¼ f1; ; i; ; ng be a set of periodic processes, where ciand piare the computation requirement and period of process i, respectively. Assume pis are sorted in increasing order. Since the Rate Monotonic Scheduling (RMS) algorithm is an optimal fixed-priority scheduling algorithm, RMS is adopted in this paper. Suppose that the periods of processes in T are all different. Note that this constraint can be relaxed easily by merging processes with the same period into one process and, then, solving the schedulability problems (by applying the following theorems).
Let Ti¼ f1; ; ig be a subset of T with processes whose periods are less than or equal to pi. When we say that a process set T S is schedulable, it means that every process in T S is schedulable at its critical instant (i.e., within its critical interval). We can prove the following theorems based on the concept of root and reduced set:
Theorem 1 [15], [21].Process i in a set of periodic processes scheduled by a fixed-priority-driven preemptive scheduling algorithm will always meet its deadline for all process phases iff there exists a pair ðk; mÞ 2 Ri such that
X j<i cj mpk pj þ ci mpk; where Ri¼ ðk; mÞj1 k i; m ¼ 1; 2; ; ppki j k n o .
Each pair ðk; mÞ represents a scheduling time point mpk to test the schedulability of process i. Riis called the set of schedulability test points of i.
Lemma 1 and Theorem 2 are related proofs under the mathematic induction procedure. We first prove that, if any process set with an offspring set replaced with the
corresponding RSR is schedulable, then the original process set is schedulable (i.e., Lemma 1 as an induction base). The proof is done by locating a feasible scheduling time point. We then show that the same feasible scheduling time point would exist for a process set with and without any number of offspring sets being replaced with their corresponding RSR’s (i.e., Theorem 2 as an induction hypothesis and an induction step).
For readability, the proofs of most theorems, lemmas, and corollaries in this paper are included in the appendix. Lemma 1.Suppose that Tiÿ1is schedulable. Let jbe any process in Ti, T Oj a subset of an offspring set of j in Ti which includes jand the RSR of T Oj. Let process 0be the process with the largest period in ðTiÿ T Oj[ fgÞ, where the period and computation requirement of 0are p
iand c, respectively. If there exists a pair ðk; mÞ 2 R0such that
X x2ðTiÿT Oj[fgÿf0gÞ cx mpk px þ c mpk; where R0¼ ðk; mÞjk2 ðTiÿ T Oj[ fgÞ; m ¼ 1; 2; ; pi pk ; then Ti (including i) is schedulable.
Proof.Please see the Appendix. tu The following example illustrates the lemma: Given a process set f1; 2; 3g, let their computation requirements and the periods be fð1; 3Þ; ð1; 5Þ; ð2; 15Þg, respectively. Suppose that T2¼ f1; 2g is schedulable. Let T O3¼ f2; 3g be an offspring set of 3 and the RSR ¼ ð5; 15Þ. If f1; g is schedulable, then T3¼ f1; 2; 3g is schedulable. Theorem 2. Suppose that Tiÿ1 is schedulable, and STi is a
nonempty subset of Ti. For each process j2 STi, let T Ojbe a subset of an offspring set of j in Ti such that T Oj\ STi¼ fjg and T Oj\ T Ok¼ for any two distinct processes jand kin STi. For each process j2 STi, j0is the RSR of T Oj. Let process 0 be the process with the largest period in T0
i ¼ ðTiÿSj2STiT Oj[fj0jj0is the RSR of T Oj; for every j2 STigÞ, where the period and computation requirement of 0are pi and c, respectively. If there exists a pair ðk; mÞ 2 R0 such that X x2ðTi0ÿf0gÞ cx mpk px þ c mpk; where R0¼ ðk; mÞj k2 Ti0; m¼ 1; 2; ; pi pk j k n o , then Ti (including i) is schedulable.
Proof.Please see the Appendix. tu The following example illustrates the theorem: Given a process set f1; 2; 3g, let their computation requirements and the periods be fð1; 3Þ; ð1; 5Þ; ð2; 15Þg, respectively. Consider a newly arrived task 4¼ ð1; 24Þ. We could first partition T4 into two disjoint offspring sets: T O3¼ fð1; 5Þ; ð2; 15Þg and T O4¼ fð1; 3Þ; ð1; 24Þg, and let the RSR’s of T O3 and T O4 be (5,15) and (9,24), respectively.
As a result, if fð5; 15Þ; ð9; 24Þg is schedulable, then fð1; 3Þ; ð1; 5Þ; ð2; 15Þ; ð1; 24Þg is schedulable.
Theorem 3 [8].A set of n periodic processes is schedulable if the total utilization factor of the process set is no larger than nð21=nÿ 1Þ.
Theorem 4. Suppose that Tiÿ1 is schedulable. Let K be the number of roots in Ti. If the total utilization factor of Tiis no larger than Kð21=Kÿ 1Þ, then T
i is schedulable.
Proof.Please see the Appendix. tu Since the number of roots in Ti is much less than the number of processes (and the number of fundamental frequencies) in Ti, we surmise that the utilization bound for a process set can be much improved. We can show, as follows, that Theorem 4 can justify the schedulability of a process set more precisely than Theorem 5 [30] and Theorem 3 [8] do.
Theorem 5 [30].A set of periodic processes with K fundamental frequencies is schedulable if the total utilization factor of the process set is no larger than Kð21=Kÿ 1Þ.
Corollary 1. Let T be a set of periodic processes. If T is guaranteed to be schedulable according to Theorem 3, then T is guaranteed to be schedulable according to Theorem 4. Proof. Please see the Appendix. tu Corollary 2. Let T be a set of periodic processes. If T is guaranteed to be schedulable according to Theorem 5, then T is guaranteed to be schedulable according to Theorem 4. Proof.Please see the Appendix. tu Corollary 3.There exists a process set which is guaranteed to be schedulable according to Theorem 4, but not according to Theorems 3 and 5.
Proof.Please see Example 2 in the following section. tu 3.1.3 Schedulability Test Algorithm
Theorem 4 suggests an iterative procedure to show the schedulability of a set T of n periodic processes: Let the total utilization factor of Ti be Ui, where Ti¼ f1; ; ig is a subset of T with processes whose periods are less than or equal to pi.
Step 1: i = 1;
Step 2: If there are K roots in Ti, and Ui Kð21=Kÿ 1Þ, Then, i is schedulable;
Else, the schedulability of ican not be guaranteed; Exit;
Step 3: i = i + 1;
Step 4: Goto Step 2 unless i > n.
If the test fails when i ¼ k, then only processes in Tkÿ1are guaranteed to be schedulable! If the test completes success-fully, all processes are schedulable. The complexity of the algorithm is Oðn2Þ. A comparison among the schedulability-tests based on process number, fundamental frequency number, and (division-graph) root number is given in the next example.
Example 2 Schedulability Tests. Let T be a set of five processes with timing constraints shown in Table 3 and
Ui¼Pij¼1pci
i the utilization factor of process set
Ti¼ f1; ; ig. T1, T2, and T3are schedulable according to the utilization bound UðnÞ ¼ nð21=nÿ 1Þ given by Liu and Layland [8], where n is the number of processes in Ti. However, the schedulability of T4 and T5 cannot be guaranteed by the Liu and Layland’s utilization bound because U4¼ 0:8166 > Uð4Þ ¼ 0:7568 and U5¼ 0:95 > Uð5Þ ¼ 0:7435 (please see Theorem 3). However, since there are only two fundamental frequencies, i.e., f3; 15g and f5; 20g, the utilization bound of T4should be Uð2Þ ¼ 0:8284 according to Theorem 5 and T4 (with U4¼ 0:8166 < Uð2Þ) is schedulable. Unfortunately, the sche-dulability of T5still cannot be guaranteed by the Kuo and Mok’s utilization bound, i.e., the bound in Theorem 5, since there are two fundamental frequencies in T5, i.e., f3; 15g and f5; 20; 60g, and U5¼ 0:95 > Uð2Þ ¼ 0:83. However, since there is only one root in T5, T5 is guaranteed to be schedulable by Theorem 4 since U5¼ 0:95 Uð1Þ ¼ 1.
3.2 Online Incremental Test
We now present an incremental version of the schedul-ability test described in the previous section for online admission control.
Suppose that a system consists of a collection of N existing processes ES ¼ f1¼ ðc1; p1Þ; ; n¼ ðcN; pNÞg sorted in a nondecreasing order of their periods. Suppose these N processes have been admitted to the system and a new process ¼ ðc; pÞ has just arrived. Note that the relative deadline of each process is its period. W.l.o.g., we assume all process periods are distinct.
Let ET ðiÞ denote the division graph of those processes in ESwith a period no larger than the period of i. RootðiÞ and UðiÞ denote the set of roots in ET ðiÞ and the sum of utilization factors ci=pi of processes in ET ðiÞ, respectively. Let j be the largest index for processes in ES whose period is less than the period p of Process . The following algorithm decides if the new process can be admitted to the system: Step 1: RootðÞ ¼ RootðjÞ þ fpg ÿ fpkjpk2 RootðjÞ &
pkjpg;
Step 2: UðÞ ¼ UðjÞ þcp;
Step 3: If UðÞ > Kð21=Kÿ 1Þ, where K is the size of RootðÞ
Then, Return(REJECT); Step 4: i = j+1;
Step 5: ComputeRootFlag = True; Step 6: While (i N) Do
Step 7: If ComputeRootFlag
Then, If (p does not divide pi)
Then, RootðiÞ ¼ RootðiÞ þ fpg ÿfpkjpk2 RootðiÞ & pkjpg; Else, ComputeRootFlag = False; /* RootðiÞ remains for the rest i/ Step 8: UðiÞ ¼ UðiÞ þpc;
Step 9: If UðiÞ > Kð21=Kÿ 1Þ, where K is the size of RootðiÞ
Return(REJECT); Step 10: i = i + 1;
Step 11: EndWhile; Step 12: Return(ACCEPT);
The schedulability of process and all existing processes only need to consider processes whose periods are no more than p. Steps 1 and 2 derive the number of roots of the corresponding division subgraph and the accumulated CPU utilization for processes with periods no more than p (including Process ). The time complexity of the computa-tion is proporcomputa-tional to the number of roots in RootðjÞ. The loop between Step 5 and Step 11 derives the number of roots of the corresponding division subgraph and the accumulated CPU utilization for processes with periods no more than pi. The time complexity of each iteration is proportional to the number of roots in RootðiÞ. Variable ComputeRootFlag is set to optimize the algorithm perfor-mance when the period of p will no longer affect the set of roots in the while loop. The period of p will no longer affect the set of roots in the while loop when p can divide the period of some process.
The time complexity of the incremental algorithm is PN
i¼jjRootðiÞj. Note that the number, i.e., jRootðiÞj, of roots in each division subgraph is usually much less than the number of processes in the division subgraph (e.g., multimedia processes often have harmonic service rates). Although jRootðiÞj may approach N in the worst case when no processes’ rate can divide each other, we surmise that the incremental algorithm will behave like a linear-time algorithm, in general, because process service rates in most real-time system are often chosen from a small collection of values to simplify the system design and to improve the system performance.
For comparison, many other schedulability tests, such as those proposed in [6], [30], cannot be used in an incremental way. In particular, the schedulability test based on the number of fundamental frequencies must be rerun, when-ever a new process arrives, to derive the number of fundamental frequencies in a system [30]. The schedul-ability test based on the Sr and DCT period transformation methods [6] must also recalculate the special base of the entire process set, whenever a new process arrives, to minimize the increase of the system utilization factor during period transformation. The tests [6], [30] are also much more complicated than the proposed schedulability test in this section.
Example 3: Incremental Admission control. We illustrate the incremental algorithm by an example. Consider a set of five existing processes, as shown in Table 4. Their division graph is shown in Fig. 1. Suppose a new process ¼ ðc ¼ 3; p ¼ 30Þ arrives at the system. Processes 1, 2,
TABLE 3 Processes in Example 2
3, and 4 remain schedulable since their periods are shorter and, thus, the priorities are higher. The incre-mental algorithm first derives RootðÞ ¼ Rootð4Þ þ f30g ÿ f15g ¼ f20; 30g and UðÞ ¼ Uð4Þ þ303 ¼ 0:8. Since there are only two roots in RootðÞ, and UðÞ ¼ 0:8 2ð21=2ÿ 1Þ, the algorithm enters the loop between Step 5 and Step 11 with i ¼ 5. Since p, i.e., 30, divides p5, i.e., 60, Rootð5Þ remains the same. The algorithm then derives Uð5Þ ¼ Uð5Þ þ303 ¼ 0:9. Since there is only one root in Rootð5Þ ¼ f60g and Uð5Þ ¼ 0:9 1ð21=1ÿ 1Þ ¼ 1:0, the system increments i and returns “ACCEPT.” The new process is accepted, and all processes can be successfully guaranteed.
4
S
CHEDULABILITYT
EST FOR THEM
ULTIFRAMEM
ODELThe purpose of this section is to extend our results to the multiframe process model for more precise efficient schedulability tests. A basic schedulability test and its incremental implementation are also presented. The pro-posed schedulability test was shown to outperform any other existing schedulability tests [1], [7].
4.1 Motivation
We now extend our result in the last section to processes with varying timing requirements in different frames (or periods), such as multimedia sessions. One example is VCD movies that are often MPEG-1 encoded. MPEG-1 encoded video streams usually consist of a sequence of groups of pictures, and each group of pictures consists of 15 frames with the following pattern: I, B, B, P, B, B, P, B, B, P, B, B, P, B, B, I [16].
The multiframe model proposed by Mok and Chen [1] provides a better analysis model to exploit the schedul-ability of processes with variations in their timing con-straints. They showed that the proposed schedulability test is much more precise than the schedulability test proposed in [8], when the execution time of a process varies sharply from frame to frame [1]. Unfortunately, the schedulability test proposed in [1] does not consider the harmonic relationship of process periods. As a result, schedulable but heavily loaded process sets are difficult to be identified by the schedulability test proposed in [1], where many computer systems, such as multimedia servers, are often heavily loaded. Note that any multiframe-based schedul-ability test based on period transformation methods, such as DCT and Sr in [6], [7], will also have difficulty in indentifying schedulable but heavily loaded process sets because of the same reason in the schedulability analysis of the Liu and Layland-based process set. The transformation
methods usually result in the sharp increase of processor utilization and seriously damage the preciseness of the proposed schedulability test at heavy or even moderate system load [19].1
In this section, we will show our schedulability test that improves the test proposed by Mok and Chen [1] by exploring the harmonic relationship of process periods. Our work can also be compared favorably to [7], as we will see from experiments later in this paper. In the following sections, we will present a much more precise schedul-ability test based on the multiframe process model, which will be shown in Section 5 to greatly outperform existing work [1], [7], especially when the system is heavily loaded. We will then provide an incremental algorithm for online implementation.
4.2 Efficient Schedulability Test Based on the Multiframe Model
4.2.1 Definitions and Claim
In this section, we will first summarize important defini-tions from [1] and define the reduced set for multiframe processes.
Definition 5 [1] Multiframe Process. A multiframe real-time process iis a tuple ðÿi; piÞ, where ÿi is an array of Ni execution times ðC0
i; Ci1; ; C Niÿ1
i Þ for some Ni 1, and pi is the period of i. Let Ci0 be the maximum in an array of execution times ðC0
i; C1i; ; C Niÿ1
i Þ. Ci0 is called the peak execution time of i.
Definition 6 [1] AM Multiframe Process. An array ðC0 i; Ci1; ; C Niÿ1 i Þ is said to be AM (Accumulative Monotonic) if Pjk¼0Ck mod Ni i Pxþj k¼xC k mod Ni i ; 1 x ðNiÿ 1Þ; 1 j < ðNiÿ 1Þ. A multiframe process i¼ fðCi0; Ci1; ; C Niÿ1
i Þ; pig is said to be AM if its array of execution times is AM.
Note that AM is restrictive for process models. However, it is critical for the worst-case schedulability analysis (e.g., critical-instant-based tests). In order to adopt the worst-case schedulability analysis, engineers have to refine/modify the array of execution times for non-AM processes such that the revised execution time is no smaller than the corresponding execution time in the original array.
Lemma 2 [1] The Critical Instance of AM Multiframe Processes. The critical instance of an AM multiframe process is the beginning of the period when its peak execution time is requested simultaneously with the peak execution times of all higher priority processes.
Definition 7 Reduced Set and RSR of AM Multiframe Processes.Suppose that ¼ fÿ ¼ ðC0; C1; ; CNÿ1Þ; pg is a multiframe periodic process with period p and an array ÿ of
1. The multimedia response-time analysis proposed by Sjodin and Hansson [25] is based on a more general multiframe model and rate-based scheduling disciplines. Authors adopt Weighted Fair Queuing (WFQ) and Calculus for Network Delays (CND) to provide linear equations (with several parameters) to bound the transmission of multimedia streams over ATM. The analysis also considers practical issues, such as jitters. The methodology proposed in our paper is for priority-based schedulability tests. Our objective is to provide a basic and theoretic foundation for more efficient (priority-based) schedulability tests. We must emphasize that our work must follow the AM restriction because of the considerations of critical instants.
TABLE 4 Processes in Example 2
computation requirements. A set of n AM multiframe periodic processes f1; ; i; ; ng, where process i has period pi and an array ÿi ¼ ðCi0; C1i; ; C
Niÿ1
i Þ of Ni computation requirements, is a reduced set of if pijp, p ¼ maxni¼1pi, N is the least common multiple of Ni for 1 i n, and, for all 0 j ðN ÿ 1Þ, Cj¼X n i¼1 X ðp=piÞÿ1 k¼0 Cðjðp=piÞþkÞ mod Ni i ! : is called the RSR of the reduced set.
Note that the definitions of roots and offspring sets remain the same for multiframe process sets.
Theorem 6.The RSR ¼ fÿ ¼ ðC0; C1; ; CNÿ1Þ; pg of a set of n AM multiframe periodic processes f1; ; i; ; ng is an AM multiframe process.
Proof. Please see the Appendix. tu Example 4 The RSR of an AM Multiframe Process Set.Let an AM multiframe process set consist of two processes f1¼ fð2; 1; 1Þ; 3g; 2¼ fð3Þ; 6gg. The peak utilization factor of the process set is7
6. ¼ fð6; 6; 5Þ; 6g is the RSR of the process set and is an AM multiframe process, as shown in Fig. 2. The peak utilization factor is 6
6¼ 1. Note that the peak utilization factor decreases.
For the purpose of this paper, we only consider AM multiframe process sets in this section. The results of this section can be used to derive the utilization bound for the general process model proposed in [1]. Note that the traditional process model proposed by Liu and Layland [8] is a special case of the (AM) multiframe model.
4.2.2 Root-Based Schedulability Test
Since Mok and Chen [1] showed that the rate monotonic scheduling (RMS) algorithm [8] is optimal for multiframe process scheduling, the RMS algorithm is adopted in the following discussions. In this section, we are interested in preemptive fixed-priority scheduling. The deadline of a process request is the next request time.
Theorem 7 [1]. For the preemptive fixed priority scheduling policy, an AM multiframe process is schedulable if it is schedulable at its critical instance.
Suppose that T ¼ f1; ; ng is a set of n AM multiframe periodic processes, where i¼ fÿi¼ ðCi0; C1i; ; C
Niÿ1
i Þ; pig. Let Ti¼ f1; ; ig be a subset of T with processes whose
periods are less than or equal to pi. When we say that a process set T S is schedulable, it means that every process in T Sis schedulable at its critical instant (i.e., within its critical interval). The schedulability test proposed in Theorem 1 is revised for AM multiframe processes as follows:
Theorem 8. Process i in a set of AM multiframe periodic processes scheduled by a fixed priority-driven preemptive scheduling algorithm will always meet its deadline for all process phases iff there exists a pair ðk; mÞ 2 Ri such that
X j<i X mpk pj l m ÿ1 x¼0 Cx mod Nj j 0 B B B @ 1 C C C Aþ C 0 i mpk; where Ri¼ ðk; mÞj1 k i; m ¼ 1; 2; ; ppki j k n o .
Proof.Please see the Appendix. tu Lemma 3 and Theorem 9 are related proofs under the mathematic induction procedure. We first prove that if any process set with an offspring set replaced with the corresponding RSR is schedulable, then the original process set is schedulable (i.e., Lemma 3 as an induction base). The proof is done by locating a feasible scheduling time point. We then show that the same feasible scheduling time point would exist for a process set with and without any number of offspring sets being replaced with their corresponding RSR’s (i.e., Theorem 9 as an induction hypothesis and an induction step).
Lemma 3.Suppose that the AM multiframe process set Tiÿ1 is schedulable. Let j be any multiframe process in Ti, T Oj a subset of an offspring set of j in Ti which includes j, and ¼ fðC0; C1; ; CNÿ1Þ; pg the RSR of T O
j. Let process 0 be the process with the largest period in ðTiÿ T Oj[ fgÞ, where the period and the array of computation requirements of 0are piand ÿ0¼ ðC00; C01; ; C0N
0ÿ1
Þ, respectively. If there exists a pair ðk; mÞ 2 R0such that
X x2ðTiÿT Oj[fgÿf0gÞ X mpk px d eÿ1 y¼0 Cy mod Nx x 0 @ 1 A þ C00 mp k; where R0¼ ðk; mÞjk2 ðTiÿ T Oj[ fgÞ; m ¼ 1; 2; ; pi pk ; then the AM multiframe process set Ti (including i) is schedulable.
Proof. Please see the Appendix. tu Theorem 9.Suppose that the AM multiframe process set Tiÿ1is schedulable and STi is a nonempty subset of the AM multiframe process set Ti. For each process j2 STi, let T Oj be a subset of an offspring set of j in Ti such that T Oj\ STi¼ fjg, and T Oj\ T Ok¼ for any two distinct processes jand kin STi. For each process j2 STi, j0is the RSR of T Oj. Let process 0 be the process with the largest period in
Ti0¼ Tiÿ [ j2STi T Oj[ fj0jj0is the RSR of T Oj; for every j2 STig ! ;
where the period and the array of computation requirements of 0are piand ÿ0¼ ðC00; C01; ; C0N
0ÿ1
Þ, respectively. If there exists a pair ðk; mÞ 2 R0such that
X x2ðTi0ÿf0gÞ X mpk px d eÿ1 y¼0 Cy mod Nx x 0 @ 1 A þ C00 mp k; where R0¼ ðk; mÞjk2 Ti0; m¼ 1; 2; ; pi pk j k n o , then the AM multiframe process set Ti (including i) is schedulable. Proof. Please see the Appendix. tu Definition 8: Peak Utilization Factor.The peak utilization factor Umof an AM multiframe process set T ¼ f1; ; ng is equal toPni¼1C0
i=pi, where C0i and piare the peak execution time and period of i, respectively.
Theorem 10 [1]. Let r ¼ minn
i¼1ðC0i=Ci1Þ. For process sets of size n, the bound on peak utilization factor is given by r n ððrþ1
r Þ 1=n
ÿ 1Þ.
Theorem 11. Suppose that Tiÿ1 is schedulable. Let K be the number of roots in Ti. If the total peak utilization factor of Tiis no larger than r K ððrþ1
r Þ 1=K
ÿ 1Þ, then Ti is schedulable, where r is calculated based on the RSR set of Ti.
Proof. Please see the Appendix. tu Note that there is no way to compare the bounds on peak utilization factor derived by Theorems 10 and 11 because r might be different in the original and transformed process sets. However, Theorem 9 does show the capability of the root-based approach. We surmise that the bound on peak utilization factor derived by Theorem 11 should be much better than that derived by Theorem 10, on average, because the number of roots is much less than the number of processes.
Note that the iterative algorithm for schedulability test proposed in Section 3 can be applied here with Theorem 11. However, the complexity of the algorithm becomes OðK N2Þ, where K is the maximum size of the array of execution times for multiframe processes during the creation of RSRs.
4.3 Online Implementation
We now present an incremental version of the schedul-ability test described in the previous section for online admission control. The incremental algorithm for the Liu and Layland model proposed in Section 3 can be revised as follows: Suppose that a system consists of a collection of N existing multiframe processes
ES¼ f1¼ fÿ1¼ ðC10; C 1 1; ; C N1ÿ1 1 Þ; p1g; ; n ¼ fÿN ¼ ðCN0; CN1; ; C NNÿ1 1 Þ; pNgg
sorted in a nondecreasing order of their periods. Let the N existing processes be schedulable and operating. The question is whether to admit a new process ¼ fÿ ¼ ðC0; C1; ; CMÿ1Þ; pg. For the simplicity of algorithm presentation, we assume that process periods are distinct (the proposed algorithm can be extended in a straightfor-ward way when processes may have the same period).
Let ET ðiÞ denote the subgraph of the division graph of processes in ES which have a period no larger than the period of i, and RootðiÞ, UðiÞ, and RSRepðiÞ denote the set of roots in ET ðiÞ, the sum of utilization factors ci=pi of processes in ET ðiÞ and a set of the RSRs in ET ðiÞ, respectively. Note that the set of the periods of the RSRs in ETðiÞ is equal to RootðiÞ. The schedulability of all existing processes and the new process is guaranteed (with the rate-monotonic scheduling [8]) if the following algorithm returns “ACCEPT.” Let j be the maximum index for j in ES whose period is less than the period p of Process . Suppose the array of the computation requirement of is ÿ¼ ðC0; C1; ; CMÿ1Þ.
Step 1: If there exists some pk2 RootðjÞ which can divide p
Then, RSRepðÞ is created by merging the corresponding RSRs in RSRepðjÞ with ; Else, RSRepðÞ ¼ RSRepðjÞ þ fg;
Step 2: RootðÞ ¼ the set of periods of RSRs in RSRepðÞ; Step 3: If RSRepðÞ is not schedulable according to
Theorem 11
Then, Return(REJECT); Step 4: i = j+1;
Step 5: While (i N) Do
Step 6: RSRepðiÞ is created by merging the corresponding RSRs in RSRepðiÞ with ; Step 7: RootðiÞ ¼ the set of periods of RSRs in
RSRepðiÞ;
Step 8: If RSRepðiÞ is not schedulable according to Theorem 11
Then, Return(REJECT); Step 9: i = i + 1;
Step 10: EndWhile; Step 11: Return(ACCEPT);
The multiframe-based incremental algorithm is the same as the Liu and Layland-based incremental algorithm proposed in Section 3, except that the set of RSRs must be maintained. As a result, the time complexity of the incremental algorithm becomesPNi¼jKjRootðiÞj, where K is the maximum size of the array of execution times for multiframe processes dring the creation of RSRs. Note that the number, i.e., RootðiÞ, of roots in each division subgraph is much less than the number of processes in the division subgraph, and many processes in a system, such as multimedia servers or control systems, are often harmoni-cally related. For example, K is usually restrictively bounded in many multimedia systems where video streams are often encoded in a similar way, e.g., VCD (or MPEG-1) encoded. We surmise that the incremental algorithm will be mostly efficient and behave like a linear-time algorithm in general.
Note that the multiframe-based schedulability test based on the Sr and DCT period transformation methods [7] has a time complexity OðN2ðN þ max N
iÞÞ, where Niis the size of the array of execution times of process i. The schedulability test must be rerun by recalculating the special base of the entire process set, whenever a new process arrives, to minimize the increase of the system utilization factor during period transformation [7]. The tests [7] are also much more complicated than the proposed schedulability test in this section.
Example 5: Incremental admission control. We illustrate the incremental algorithm by an example. Consider a set of five existing processes, as shown in Table 5. Their division graph is shown in Fig. 1. Let a new process ¼ fÿ ¼ ð3; 2Þ; p ¼ 30g arrive. Processes 1, 2, 3, and 4 remain schedulable. The incremental algorithm first derives RSRepðÞ ¼ ffð2; 1Þ; 20g; fð21; 20Þ; 30gg. Since r ¼
minni¼1ðC0
i=Ci1Þ ¼ 1:05 and the peak UðÞ ¼ peak Uð4Þ þ 3
30¼ 0:8 is no more than the bound, i.e., 0.834, required by Theorem 11, the algorithm enters the loop between Step 5 and Step 11 with i ¼ 5. The algorithm then derives RSRepð5Þ ¼ ffð52; 48Þ; 60gg. Since r ¼ minni¼1ðC0i=Ci1Þ ¼ 1:083 and the peak Uð5Þ ¼ peak Uð5Þ þ303 ¼ 0:9 is no more than the bound, i.e., 1.0, required by Theorem 11, the system increments i and returns “ACCEPT.” The new process is accepted and all processes can be successfully guaranteed.
5
P
ERFORMANCEE
VALUATIONTo assess the capability of the different schedulability tests, we conducted some experiments. There are two parts in the experiments. The first part compares the capability of different schedulability tests based on the Liu and Layland process model [8], i.e., the schedulability tests based on the number of processes [8] (i.e., Theorems 3 and 10), the number of fundamental frequencies [30] (i.e., Theorem 5), and the number of roots (i.e., Theorems 4 and 11), and the polynomial-time schedulability tests DCT þ Sr proposed by Han and Tyan [6]. The second part compares the capability of the proposed multiframe schedulability test with the tests proposed by Mok and Chen [1] and Han [7]. 5.1 Data Set and Measurement
The primary performance metric used is the ratio of process sets guaranteed to be schedulable by each schedulability test, referred to as Guarantee Ratio. Let n be the number of process sets randomly generated in the simulation and m the number of process sets guaranteed to be schedulable by
a schedulability test. The Guarantee Ratio of the schedul-ability test ism
n.
The process sets for performance evaluation were based on benchmarks and systems reported in [11], [18], [26], [27]. In particular, the Hartstone [27] benchmark aimed at the measuring of the effectiveness and the efficiency of real-time schedulers and their systems. Response time was a major performance metric. The benchmark considered two kinds of workloads: harmonic or nonharmonic workloads. Under harmonic workloads, process periods were 2, 4, or 8 times of a specified base period. Under nonharmonic workloads, process periods were 3, 5, or 7 times of a specified base period. In other words, the maximum number of funda-mental frequencies (/roots) was 3. The systems reported in [11], [18], [26] were based on realistic workloads. In those studies, the ratio of the number of fundamental frequencies and the number of processes was between 1
4 and 1 6 of the number of processes in the process set.
We adopted a random number generator to generate process sets: For the experiments of the Liu and Layland process model, the number of processes per process set was randomly chosen between 10 and 30. The number of fundamental frequencies were basically within two ranges: They were1 1, 1 4 and1 4, 1 10
of the number of processes in the process set. The experiments started with process sets of a utilization factor equal to 70 percent and increased by 5 percent at a time until the utilization factor was equal to 95 percent. Four hundred process sets per utilization factor were tested. The utilization factor of each process was no more than 20 percent of the total utilization factor of the process set. Each process was assigned fundamental frequencies randomly, and the possibility of assigning i fundamental frequencies to a process was1
2 iÿ1
.
For the experiments of the multiframe process model, the number of processes per process set was randomly chosen between 10 and 15, and the number of fundamental frequencies were within a range: That was ½1
1, 1
10 of the number of processes in the process set. The experiments started with process sets of a peak utilization factor equal to 70 percent and increased by 5 percent at a time until the peak utilization factor was equal to 110 percent. Four hundred process sets per peak utilization factor were tested. Each process iwas assigned a period piand an array of Ni execution times ðC0
i; Ci1; ; C Niÿ1
i Þ as follows: Let i and j be two distinct processes sharing a fundamental frequency and i < j. i was assigned a period which divided the period of j. The periods of processes which did not share any fundamental frequency with other processes or only
TABLE 5
share some fundamental frequencies with a larger-index process were randomly chosen in the range ð7; 29Þ (they are prime numbers). The size Ni of the execution time array ðC0
i; C1i; ; C Niÿ1
i Þ of each multiframe process was ran-domly chosen in the range ð1; 20Þ. C0
i was derived based on the period and peak utilization factor of i. Cij¼ C0i r1j
i
for 0 j ðNiÿ 1Þ, and ri was randomly chosen in the range ð2; 5Þ. The process sets under the experiments are all schedulable based on the RMA schedulability tests. In other words, the guarantee ratio of an algorithm reflects the capability of the algorithm in recognizing admissible process sets.
5.2 Simulation Results for
the Liu and Layland Process Model
Figs. 3a and 3b show the guarantee ratios of different schedulability test algorithms when the number of funda-mental frequencies were within two ranges: They were 1 1; 1 4 and 1 4; 1 10
of the number of processes in a process set, respectively. In Figs. 3a and 3b, it can be seen that the guarantee ratio of the root-based schedulability test proposed in this paper greatly outperformed the schedul-ability tests based on the number of processes [8] and the number of fundamental frequencies [30] and the DCT þ Sr-based schedulability tests [6], especially when the utilization factor of a process set is beyond 75 percent. (The guarantee ratio of the schedulability test based on the number of processes is zero when the utilization factor of a process set is beyond 70 percent.)
Note that the average number of roots and the average number of fundamental frequencies in Fig. 3a are 2.13 and 4.80, respectively. The average number of roots and the average number of fundamental frequencies in Fig. 3b are 1.41 and 2.85, respectively. That explains why the root-based schedulability test proposed in this paper greatly outperforms the schedulability tests based on the number of processes [8] and the number of fundamental frequencies [30]. As astute readers might notice, the schedulability tests based on the number of roots and the number of fundamental frequencies [30] has better performance when
the ratio of the number of fundamental frequencies and the number of processes was lower (i.e., Fig. 3b). We should also point out that the guarantee ratio of the root-based tests decreased significantly when the utilization factor increased from 80 to 85 percent. It is because many process sets which had two or more roots would fail the schedulability test since 2 ð212ÿ 1Þ ¼ 0:8284.
The difference between the guarantee ratios of the root-based and DCT þ Sr-root-based schedulability test becomes very significant when the utilization factor of a process set is over 75 percent, which is not even considered as a heavy load. It is because the increasing amount of the utilization factor in the process-set transformation for the DCT þ Sr schedulability test becomes very significant for process sets with a large utilization factor [19]. The experimental results reveal the weakness of period-transform methods such as DCT and Sr [6], [19]. The performance of the DCT þ Sr-based schedulability test quickly deteriorates when the system becomes slightly heavily loaded. On the other hand, the root-based schedulability test performs consistently well and greatly outperforms the DCT þ Sr-based schedulability test [6] and any other tests when the utilization factor of a process set is above 75 percent.
When the root-based schedulability test and DCT þ Sr schedulability test [6] are used jointly, the guarantee ratio improves only slightly. When the utilization factor of a process set is over 85 percent, the DCT þ Sr-based schedul-ability test [6] fails in identifying any schedulable process sets. It shows that, although the root-based schedulability test and DCT þ Sr schedulability test [6] complement each other (when the system is lightly loaded), the DCT þ Sr schedulability test does not help much in identifying any schedulable process sets which could not be identified by the root-based schedulability test.
The reason why the root-based schedulability tests only had a small improvement over other approaches, when the utilization factor was not high (i.e., under 80 percent), was because the utilization factors of experimented process sets were often no larger than the values of the corresponding values of k ð21kÿ 1Þ , regardless of whether k was the
number of roots, the number of fundamental frequencies, or
Fig. 3. The guarantee ratio of Liu and Layland, Kuo and Mok, DCTþ Sr-based, and root-based schedulability tests. (a) The ratio of the number of fundamental frequencies and the number of processes was between1
the number of processes. For example, the values of k ð21kÿ 1Þ were 83, 78, 75.7, 74.3, and 73.4 percent, when k ¼ 2,
3, 4, 5, and 6, respectively. When the utilization factor was over 80 percent, the root-based schedulability tests, that set kas the number of roots in k ð21kÿ 1Þ, greatly outperformed
other approaches because other approaches that set k as the number of fundamental frequencies or the number of processes in k ð21kÿ 1Þ would usually had k ð2
1
kÿ 1Þ being
less than 80 percent. Note that the average number of roots in the experiments was only between 1.41 and 2.13, where the average number of fundamental frequencies was between 2.85 and 4.8.
The efficiency of the root-based algorithm was done by measuring the execution time of different schedulability tests proposed in the literature. The experiments were done on a single-board-computer (SBC) which was equiped with an Intel 80486 DX2-66 microprocessor to reflect the specs of many embedded systems currently in the market. We run the schedulability tests over 400 process sets and averaged their execution times. The summary is shown in Table 6. The values in the first column were to measure the execution times of the schedulability tests over an entire process set, where the second column measured those for online incremental admission control, as shown in Section 3.2. To compare the execution times of efficient schedulability tests with those of precise schedulability tests, e.g., the Rate Monotonic Analysis (RMA) [15], [21], we run the RMA schedulability tests over all of the process sets for the experiments of the efficient schedulability tests. It
was observed that the required execution time of exact schedulability tests on Pentium III-800MHz would be many seconds and sometime went up to thousands of seconds. The process sets under the RMA schedulability tests were as the same as those described in Section 5.1.
5.3 Simulation Results for
the Multiframe Process Model
Fig. 4a shows that the guarantee ratio of the root-based schedulability test greatly outperforms the schedulability tests proposed by Mok and Chen [1] (i.e., results labeled as “Mok & Chen”) and Han [7] (i.e., results labeled as “Mok & Chen + DCT + Sr”), when ri(which was the ratio of Ci0and Ci1) is randomly chosen in the range ð2; 5Þ. Many more process sets are successfully identified to be schedulable by the RMS scheduling algorithm. It is because the number of roots is much smaller than the number of processes. In the simulation experiments, we also observe that the average r¼ minn
i¼1ðC0i=Ci1Þ even increases in the set of the RSRs of offspring sets of roots in each process set. It also made contribution to the performance of the root-based schedul-ability test. The average r in the root-based schedulschedul-ability test is 2.441, while the average r in the original process sets is about 2.015. On the other hand, the DCT þ Sr-based schedulability test [7] fails in identifying any schedulable process sets, when the peak utilization factor of a process set is close to 90 percent. It is because the increasing amount of the utilization factor in the process-set transformation for the DCT þ Sr schedulability test becomes very significant for process sets with a large utilization factor [19].
The peak utilization factors of many multiframe process sets also decrease in the root-based schedulability test because the variation of per-period execution time of a RSR often decrease in the root-based schedulability test (due to the merging of processes). That explains why the root-based schedulability test can guarantee the schedulability of many process sets with a peak utilization factor over 100 percent. Example 4 presented earlier in the paper may help in explaining this phenomenon.
When the upper bound of r ¼ minni¼1ðC0i=Ci1Þ in data generation was increased from 5 to 10, Fig. 4b shows that
TABLE 6
The Execution Time of the Proposed Efficient Schedulability Tests on 486-DX2 66MHz Where
the CPU Utilization was 80 Percent
Note that the two schedulability tests proposed by other researchers did not provide online incremental algorithms.
the guarantee ratio of the root-based schedulability test also greatly outperforms the schedulability tests proposed by Mok and Chen [1] and Han [7], when ri was randomly chosen in the range ð2; 10Þ. The average r in the root-based schedulability test is 3.329, while the average r in the original process sets is about 2.135.
6
C
ONCLUSIONSThis paper proposes efficient online schedulability tests which consider not only the harmonic relationship of process periods, but also the variance of computation times in different periods. The proposed schedulability tests are shown to be much more precise and efficient than existing polynomial-time schedulability tests [1], [2], [6], [7], [8], [30]. Unlike many other polynomial-time schedulability tests, the proposed schedulability tests perform consistently well, regardless of whether the system is lightly or heavily loaded! We also provide an incremental implementation of the schedulability tests for efficient online admission control. The experimental results clearly show the merits of this methodology. A comparison of different schedul-ability tests is summarized in Table 7.
With the advance of software and hardware technolo-gies, there is an increasing demand to study the real-time resource allocation problems for different architectural assumptions and computation models. For future research, we will extend the reduced-set methodology to analyze the schedulability of “mixed” real-time systems consisting of hard, soft, and firm real-time processes and explore different guarantee levels for different kinds of processes. We will also further explore the application semantics of multimedia systems to improve the capacity of the systems in resource allocation.
A
PPENDIXP
ROOFS OFT
HEOREMS, L
EMMAS,
ANDC
OROLLARIESLemma 1.Suppose that Tiÿ1is schedulable. Let jbe any process in Ti, T Oj a subset of an offspring set of j in Ti which includes j, and the RSR of T Oj. Let process 0be the process with the largest period in ðTiÿ T Oj[ fgÞ, where the period and computation requirement of 0are piand c, respectively. If there exists a pair ðk; mÞ 2 R0such that
X x2ðTiÿT Oj[fgÿf0gÞ cx mpk px þ c mpk; where R0¼ ðk; mÞjk2 ðTiÿ T Oj[ fgÞ; m ¼ 1; 2; ; pi pk ; then Ti (including i) is schedulable.
Proof.Suppose that there exists a pair ðk; mÞ 2 R0such that X x2ðTiÿT Oj[fgÿf0gÞ cx mpk px þ c mpk; where R0¼ ðk; mÞjk2 ðTiÿ T Oj[ fgÞ; m ¼ 1; 2; ; pi pk ; we will show as follows that mpk is a scheduling time point at which iis schedulable. Note that 0is if jis i. If jis not i, then 0is i.
If j is i, then 0 is , and T Oj includes i. By the definition of RSR, the utilization factor c
pi of is equal to
P y2T Oj
cy
py. The above formula for the scheduling time
point mpk can be rewritten as follows: mpk X x2ðTiÿT Oj[fgÿf0gÞ cx mpk px þ c ¼ X x2ðTiÿT Oj[fgÿf0gÞ cx mpk px þ X y2T Oj cy pi py ¼ X x2ðTiÿT Oj[fgÿf0gÞ cx mpk px þ X y2ðT OjÿfigÞ cy pi py þ ci =since i2 T Oj= X x2ðTiÿT Oj[fgÿf0gÞ cx mpk px þ X y2ðT OjÿfigÞ cy mpk py þ ci=since pi mpkand pyjpi= ¼ X x2Tiÿ1 cx mpk px þ ci:
If jis not i, then 0is i. The period of is pj. By the definition of RSR, the utilization factor c
pj of is equal to
TABLE 7
The Effectiveness and Efficiency of Schedulability Test Algorithms
P y2T Oj
cy
py. The above formula for the scheduling time
point mpkcan be written as follows: mpk X x2ðTiÿT Oj[fgÿf0gÞ cx mpk px þ ci=Note that 0is i:= ¼ X x2ðTiÿT Ojÿf0gÞ cx mpk px þ mpk pj cþ ci ¼ X x2ðTiÿT Ojÿf0gÞ cx mpk px þ mpk pj pj X y2T Oj cypy 0 @ 1 Aþci ¼ X x2ðTiÿT Ojÿf0gÞ cx mpk px þX y2T Oj cy pj py mpk pj þci ¼ X x2ðTiÿT Ojÿf0gÞ cx mpk px þ X y2T Oj cy pj py mpk pj þ ci=since pyjpj= X x2ðTiÿT Ojÿf0gÞ cx mpk px þ X y2T Oj cy pj py mpk pj þ ci=since ke hd d e dkhe= ¼ X x2ðTiÿT Ojÿf0gÞ cx mpk px þ X y2T Oj cy mpk py þ ci ¼ X x2Tiÿ1 cx mpk px þ ci:
Regardless of whether j is i, mpk is proven as a scheduling time point at which i is schedulable (please see Theorem 1). Since Tiÿ1 is schedulable and i is schedulable, Tiis schedulable. tu Theorem 2. Suppose that Tiÿ1 is schedulable and STi is a nonempty subset of Ti. For each process j2 STi, let T Ojbe a subset of an offspring set of j in Ti such that T Oj\ STi¼ fjg and T Oj\ T Ok¼ for any two distinct processes jand kin STi. For each process j2 STi, j0is the RSR of T Oj. Let process 0 be the process with the largest period in
Ti0¼ ðTiÿ [ j2STi
T Oj
[ fj0jj0is the RSR of T Oj; for every j2 STigÞ; where the period and computation requirement of 0are p
iand c, respectively. If there exists a pair ðk; mÞ 2 R0such that
X x2ðTi0ÿf0gÞ cx mpk px þ c mpk; where R0¼ fðk; mÞj k2 Ti0; m¼ 1; 2; ; b pi pkcg, then Ti (in-cluding i) is schedulable.
Proof. The proof can be done by applying the same argument adopted in Lemma 1 to every RSR j0in STi.tu Theorem 4. Suppose that Tiÿ1 is schedulable. Let K be the number of roots in Ti. If the total utilization factor of Ti is no larger than Kð21=Kÿ 1Þ, then T
iis schedulable.
Proof.Since Ti can be entirely and exclusively partitioned into subsets T Oj of the offspring sets of the K roots Rootj, Ti can be transformed into a process set Ti0which include the K RSRs of the T Oj’s. Because the utilization factor of T0
i is no larger than Kð21=Kÿ 1Þ, the process 0 with the largest period in Ti0is schedulable according to Theorem 3. Note that the utilization factors of Ti and Ti0 are the same according to the definition of RSR. Based on Theorem 1, there must exist a pair ðk; mÞ 2 R0such that
X x2ðTi0ÿf0gÞ cx mpk px þ c mpk; where R0¼ ðk; mÞj k2 Ti0; m¼ 1; 2; ; pi pk j k n o , where the period and computation requirement of 0 are p
i and c, respectively. The correctness of this proof then follows directly from Theorem 2. tu Corollary 1. Let T be a set of periodic processes. If T is guaranteed to be schedulable according to Theorem 3, then T is guarenteed to be schedulable according to Theorem 4. Proof.The proof is trivial because the number of roots is no
larger than the number of processes. tu Corollary 2. Let T be a set of periodic processes. If T is guaranteed to be schedulable according to Theorem 5, then T is guaranteed to be schedulable according to Theorem 4. Proof. The proof is trivial because the number of roots is no
larger than the number of fundamental frequencies, and the set of processes in a fundamental frequency is a special case of an offspring set of some process in the
fundamental frequency. tu
Theorem 6.The RSR ¼ fÿ ¼ ðC0; C1; ; CNÿ1Þ; pg of a set of n AM multiframe periodic processes f1; ; i; ; ng is an AM multiframe process.
Proof. The AM property of can be proven by showing Xj k¼0 Ck mod NX xþj k¼x Ck mod N, 1 x ðN ÿ1Þ; 1 j < ðN ÿ1Þ. Xj k¼0 Ck mod N ð1Þ ¼X j k¼0 Ck ð2Þ ¼X j k¼0 Xn i¼1 X ðp=piÞÿ1 y¼0 Cðkðp=piÞþyÞ mod Ni i ð3Þ ¼X n i¼1 Xj k¼0 X ðp=piÞÿ1 y¼0 Cðkðp=piÞþyÞ mod Ni i ð4Þ ¼X n i¼1 X ðjþ1Þðp=piÞÿ1 k¼0 Ck mod Ni i ð5Þ
X n i¼1 X xðp=piÞþðjþ1Þðp=piÞÿ1 k¼xðp=piÞ Ck mod Ni i ; for any 1 x ðN ÿ 1Þ ð6Þ ¼X n i¼1 Xxþj k¼x X ðp=piÞÿ1 y¼0
Cððk mod NÞðp=piÞþyÞ mod Ni
i ð7Þ ¼X xþj k¼x Xn i¼1 X ðp=piÞÿ1 y¼0
Cððk mod NÞðp=piÞþyÞ mod Ni
i ð8Þ
¼X xþj k¼x
Ck mod N ð9Þ:
The formula in the first line could be rewritten as that in the second line because j < N ÿ 1. It could be further rewritten as that in the third line because we have
Cj¼X n i¼1 X ðp=piÞÿ1 k¼0 Cðjðp=piÞþkÞ mod Ni i !
according to Definition 7. The fourth line could be re-written as that in the fifth line when the rightmost two sigma equations were expanded. The relationship holds because 1; 2; . . . ; nare AM. The derivation of the formulae of the seventh, eighth, and ninth lines could be done in similar ways as those for the third, fourth, and
fifth lines. tu
Theorem 8. Process i in a set of AM multiframe periodic processes scheduled by a fixed priority-driven preemptive scheduling algorithm will always meet its deadline for all process phases iff there exists a pair ðk; mÞ 2 Ri such that
X j<i X mpk pj l m ÿ1 x¼0 Cx mod Nj j 0 B B B @ 1 C C C Aþ C 0 i mpk; where Ri¼ ðk; mÞj1 k i; m ¼ 1; 2; ; ppIk j k n o .
Proof.The correctness of this theorem directly follows from Theorems 1 and 7. Note that, at every schedulability test point of Ri, new computation requests from higher-priority processes may arrive. tu Lemma 3.Suppose that the AM multiframe process set Tiÿ1is schedulable. Let j be any multiframe process in Ti, T Oj a subset of an offspring set of j in Ti which includes j, and ¼ fðC0; C1; ; CNÿ1Þ; pg the RSR of T O
j. Let process 0 be the process with the largest period in ðTiÿ T Oi[ fgÞ, where the period and the array of computation requirements of 0are piand ÿ0¼ ðC00; C01; ; C0N
0ÿ1
Þ, respectively. If there exists a pair ðk; mÞ 2 R0such that
X x2ðTiÿT Oj[fgÿf0gÞ X mpk px d eÿ1 y¼0 Cy mod Nx x 0 @ 1 A þ C00 mp k; where R0¼ ( ðk; mÞjk2 ðTiÿ T Oj[ fgÞ; m¼ 1; 2; ; pi pk ) ;
then the AM multiframe process set Ti (including i) is schedulable.
Proof. Suppose that there exists a pair ðk; mÞ 2 R0such that X x2ðTiÿT Oj[fgÿf0gÞ X mpk px d eÿ1 y¼0 Cy mod Nx x 0 @ 1 A þ C00 mpk; where R0¼ ( ðk; mÞjk2 ðTiÿ T Oj[ fgÞ; m¼ 1; 2; ; pi pk ) ;
we will show as follows that mpk is a scheduling time point at which iis schedulable. Note that 0is if jis i. If jis not i, then 0is i.
If jis i, then 0is and T Ojincludes i. Ck¼ C0kfor 0 k N. By the definition of RSR, Cj¼ X z2T Oj X ðp=pzÞÿ1 k¼0 Cðjðp=pzÞþkÞ mod Nz z ! ;
for 0 j ðN ÿ 1Þ. The above formula for the schedul-ing time point mpk can be written as follows:
mpk X x2ðTiÿT Oj[fgÿf0gÞ X mpk px d eÿ1 y¼0 Cy mod Nx x 0 @ 1 A þ C0 ¼ X x2ðTiÿT Oj[fgÿf0gÞ X mpk px d eÿ1 y¼0 Cy mod Nx x 0 @ 1 A þ X z2T Oj X ðp=pzÞÿ1 k¼0 Cðk mod NzÞ z ! ¼ X x2ðTiÿT Oj[fgÿf0gÞ X mpk px d eÿ1 y¼0 Cy mod Nx x 0 @ 1 A þ X z2ðT OjÿfigÞ X ðp=pzÞÿ1 k¼0 Cðk mod NzÞ z ! þ C0 i =since i2 T Oj= X x2ðTiÿT Oj[fgÿf0gÞ X mpk px d eÿ1 y¼0 Cy mod Nx x 0 @ 1 A þ X z2ðT OjÿfigÞ X dðmpk=pzÞeÿ1 k¼0 Cðk mod NzÞ z ! þ C0 i= since p ¼ pi; pi mpk; and pzjpi =