Tight Performance Bounds of Heuristics for a Real-Time Scheduling Problem Yingfeng Oh and Sang H. Son Technical Report No. CS-93-24 May 24, 1993

Tight Performance Bounds of Heuristics for a Real-Time Scheduling Problem

Yingfeng Oh and Sang H. Son Department of Computer Science University of Virginia Charlottesville, VA 22903

Abstract

The problem of scheduling a set of periodic tasks on a number of processors using a fixed-priority assignment scheme was first studied by Dhall and Liu in their paper entitled “On a real-time scheduling problem”. Two scheduling heuristics ? Rate-Monotonic-Next-Fit (RMNF) and Rate-Monotonic-First-Fit (RMFF) were proposed, and their worst-case performance was proven to have an upper bound of 2.67 and 2.2, and a lower bound of 2.4 and 2.0, respectively. In this paper, we first tighten up the worst-case bounds for both RMNF and RMFF, and at the same time, correct some errors existing in the original proof of the upper bound for RMFF. The tight worst-cast bounds of RMNF and RMFF are proven to be 2.67 and 2.33, respectively. Then, in an effort to find a more efficient algorithm, we propose a new scheduling heuristic ? Rate-Monotonic-Best-Fit (RMBF), and study its worst-case performance. Surprisingly, RMBF also has a tight worst case bound of 2.33.

I. Introduction

The problem of preemptively scheduling a set of periodic tasks with hard deadlines equal to the task periods on a single processor was first solved by Liu and Layland [12], and Serlin[17]. In the case of fixed priority assignment, the rate-monotonic algorithm [12] [17] was proven to be optimal. In the case of dynamic priority assignment, the earliest deadline first (EDF) algorithm [12] was proven to be optimal. The rate-monotonic algorithm assigns priorities to tasks according to their periods, where the priority of a task is in inverse relationship to its period. The rate-monotonic algorithm has recently gained a lot of recognition since it can be used as a backbone algorithm for designing predictable real-time systems. Many significant results have been obtained

___________________________________

This work was supported in part by ONR, by DOE, and by IBM.

within the framework of rate-monotonic scheduling, for example, the scheduling of tasks which need to be synchronized [20], the scheduling of tasks which are “imprecise” [13] [14] [21], the scheduling of aperiodic and sporadic tasks [9] [22], and the scheduling of support to overcome transient overload [16]. In this paper, we consider the problem of scheduling a set of periodic tasks on a multiprocessor system using a fixed priority assignment scheme. The study of scheduling periodic tasks on a multiprocessor system is justified for various reasons. In some cases, due to heavy computing demands, multiprocessor support can be the best, perhaps the only, means of providing sufficient processing power to meet critical real-time deadlines. In other cases, multiprocessor support for a hard real-time system is a much better choice for reliability than a uniprocessor system, since a multiprocessor system is generally more reliable than a uniprocessor system. However, the problem of scheduling a set of periodic tasks, using either fixed priority or dynamic priority assignment, on a number of processors, is a NP-hard problem [11]. For practical purpose, simple scheduling heuristics which can obtain fast results need to be devised. There are potentially numerous scheduling heuristics to solve this scheduling problem. A particular class of scheduling heuristics, which use the rate-monotonic algorithm to schedule the set of tasks assigned on each individual processor, is especially favored for a number of reasons. First, the rate-monotonic algorithm is optimal for fixed priority assignment of periodic tasks on a processor. The reason the fixed priority assignment is used is for practical purposes, such as ease of implementation and the minimal scheduling overhead involved. Secondly, simple and efficient bin-packing heuristics can be used to assign tasks onto processors so that the least number of processors is used. Finally, since rate-monotonic scheduling is used to schedule tasks on a processor, many extant results concerning rate-monotonic scheduling of real-time tasks on a single processor can be readily adapted to accommodate more practical needs of real-time systems, such as, the scheduling of soft-deadline tasks [10], the scheduling of tasks which need to be synchronized [20], and the mode change protocols [19] [23]. Dhall and Liu [5] were the first to propose heuristic algorithms to solve this problem. They proposed two scheduling algorithms, which were called the Rate-Monotonic-Next-Fit (RMNF) and Rate-Monotonic-First-Fit (RMFF), and analyzed their performance. The worst-case performance of RMNF and RMFF was proven to have a upper bound of 2.67 and 2.23, and a lower bound of 2.4 and 2.0, respectively. Unfortunately, the bounds were not tight, with gaps existing between the upper bounds and lower uppers of both algorithms. This posed a nagging problem, since the lower bounds may in fact be the real lower bounds, and the upper bounds may in fact be the real upper bounds, or neither the lower bounds nor the upper bounds have anything to do with the real bounds. This problem may be aggravated in actual implementation when multiple processors are needed to execute a number of periodic tasks in some hard real-time applications. On the one hand, a sufficient number of processors should be provided to execute the tasks so that their

- 1-

hard deadlines are guaranteed even in the worst case. On the other hand, the least number of processors should be used so that processor resources are not wasted. In this paper, we tighten up the worst-case performance bounds for both RMNF and RMFF. In the process, we found that there were some errors in the original proof of the upper bound for RMFF. The errors were corrected, and the tight bound of RMFF was shown to be 2.33 rather than 2.23. In an attempt to find more efficient algorithms, we then propose a new scheduling algorithm ? Rate-Monotonic-Best-Fit (RMBF), and study its performance. This new algorithm, based on the bin-packing heuristic, Best-Fit, assigns tasks on processors in such a manner as to maximize the utilization of a processor. RMBF is intrinsically more complex than RMFF, and is expected to have better performance in assigning tasks to processors. However, the worst-case performance of RMBF is, to our surprise, no better than that of RMFF. Bin-packing heuristics are chosen because assigning tasks on processors bears many similarity to packing items into bins. Many of the bin-packing heuristics are quite simple, and yet deliver very good performance. The key difference in this case, however, is that bins in bin-packing have unitary size, while the “size” or utilization of a processor in scheduling tasks on a multiprocessor changes dynamically according to some pre-defined functions. This difference makes the analysis of the worst-case performance of the scheduling heuristics considerably more complicated than that of bin-packing heuristics. Other related work in this area includes the two scheduling heuristics studied by Davari and Dhall [3] [4]. They are the First-Fit-Decreasing-Utilization-Factor (FFDUF) and NEXT-FIT-M algorithms. FFDUF sorts the tasks in non-increasing order of utilization factor and assigns them to processors in that order. NEXT-FIT-M classifies tasks into M classes with respect to their utilizations. Processors are also classified into M groups, so that a processor in k-group executes tasks in k-class exclusively. The worst-case performance of FFDUF is tightly bounded by 2, while the performance of NEXT-FIT-M is upper bounded by a number SM, which is a decreasing function of the pre-selected number M, e.g., SM = 2.34 for M = 4, and SM = 2.28 for M → ∞. This paper is organized as follows. In the next section, the scheduling problem is formally defined. The performance of RMNF is proven to be tightly bounded by 2.67 in Section III. The RMFF algorithm is presented, and its performance analyzed in Section IV, while the performance of RMBF is given in Section V. Finally, we conclude in Section VI and indicate the remaining problems.

II. Problem Definition

In order to present any scheduling results, it is necessary to state the assumptions beforehand. The presentation of these assumptions follows the format used by Liu and Layland [12].

- 2-

(A) The requests of all tasks for which hard deadlines exist are periodic, with constant interval between request. (B) Each task must be completed before the next request for it arrives ? i.e., all its versions must be completed by the end of each request period. (C) The tasks are independent in that the requests of a task do not depend on the initiation or the completion of requests for other tasks. (D) The computation time for each task is constant for that task and does not vary with time. Computation time here refers to the time which is taken by a processor to execute the task without interruption. (E) Any non-periodic tasks in the system are special, and do not have hard deadlines. Assumptions (A), (B), and (D) have been argued to have close resemblance to many industrial real-time systems [12], and have thus been used by many in studying and building real-time systems. Though Assumption (C) does exclude the situation where certain tasks have precedence of execution before others, it nevertheless is a good model for many real-time systems. Assumption (E) may appear to be overly restrictive in the first glance. However, with the rapid advance of real-time scheduling techniques, Assumption (E) can be totally omitted. It is put in here so that we can focus ourselves on periodic tasks at the moment. The various ways to efficiently schedule non-periodic, hard deadline tasks along with periodic tasks can be found in real-time scheduling literature [9] [22]. It follows that a task τi is completely characterized by two numbers, the computation time Ci and the period Ti. The ratio Ci / Ti is called the utilization factor of the task τi. The problem of scheduling a set of periodic tasks on a multiprocessor can be defined as follows: Given a set of n tasks Σ = {τ1, τ2, …, τn}, where each task τi is characterized by its computation time Ci and its period Ti, i.e., τi = (Ci, Ti), what is the minimum number of processors needed to execute the task set such that all n tasks can be guaranteed to meet their deadlines? The preemptive scheduling discipline and the fixed priority assignment scheme are assumed. To solve this problem, a heuristic approach which consists of two steps is usually adopted: (1) A heuristic algorithm is employed to assign tasks to processors; (2) The rate-monotonic algorithm is used to schedule tasks on each individual processor. The problem of assigning tasks onto a minimal number of processors very closely resembles the bin-packing problem, in which items of variable sizes are packed into as few bins as possible. Therefore, many of the bin-packing heuristics can be used to assign tasks onto processors. However, there is a key difference between bin-packing and the scheduling of periodic tasks on a multiprocessor: the “size” of a bin, which corresponds to the utilization of a processor, is not always unitary, but rather it is a variable whose values are determined by some pre-defined functions. These functions are referred to as schedulability conditions.

- 3-

When a task is assigned to a processor, the scheduler must make sure that the addition of the task to the processor should not jeopardize the schedulability of those tasks that have already been assigned to it. To accomplish this goal, the following schedulability condition can be used. Condition WC: If a set of m tasks is scheduled according to the rate-monotonic scheduling algorithm, then the minimum achievable utilization factor is m ( 2 1 ? m ? 1 ) . As m approaches infinity, the minimum utilization factor approaches ln2. This schedulability condition was first given by Liu and Layland [12]. It implies that a task set can be scheduled to meet their deadlines if the total utilization factor of the tasks is less than a threshold number, which is given by m ( 2 1 ? m ? 1 ) , where m is the number of tasks to be scheduled. This condition is a worst-case condition, and therefore it is referred to as Condition WC (Worst Case). The function f (m) = m ( 2 1 ? m ? 1 ) is a strictly decreasing function with regards to m, the number of tasks on a processor. In studying the performance of RMNF and RMFF, Dhall and Liu [5] used a different schedulability condition, which is stated as follows: Condition IP: Let τ 1, τ 2, …, τ m be a set of m tasks with periods T 1 ≤ T 2 ≤ … ≤ T m . Let 1 ? ( m ? 1) m?1 u = ∑i C ? Ti ≤ ( m ? 1 ) ( 2 ? 1 ) . If Cm / Tm ≤ 2(1 + u / (m-1))-(m=1 i 1) - 1, then the set can be feasibly scheduled by the rate-monotonic scheduling algorithm. As m approaches infinity, the minimum utilization factor of τ m approaches 2e-u - 1.

This schedulability condition requires that the tasks be sorted in the order of non-decreasing period, thus implying that the task set should be known beforehand. Some of the task sets that can not be scheduled by using Condition WC can be scheduled by using this condition, since this condition takes advantage of the fact that tasks are ordered against non-decreasing periods. This condition is referred to as Condition IP (Increasing Period). The function f (u, m) = 2(1 + u/(m-1))(m-1) - 1 is a strictly decreasing function with regards to both u and m. Both Condition WC and Condition IP can be easily used to test the schedulability of a task set, since the only parameters involved are the total utilization of tasks and the number of tasks. A sufficient and necessary condition, which takes into account both the computation time and the period of a task when a task is scheduled, was recently given by Lehoczky et al [8]. Because of its complexity, the performance of the scheduling heuristics using this condition is not studied here. In the following, we focus our studies on the scheduling heuristics using Condition IP as schedulability condition. Note that the scheduling heuristics ? RMNF and RMFF studied by Dhall and Liu used the same schedulability condition. Notations: Let N0 and N(A) be the number of processors used by an optimal algorithm and the number of processors used by a heuristic algorithm A, respectively. Then, the guaranteed performance bound of the algorithm A, denoted as ?(A), is defined as N ( A) ?(A) = lim N0 → ∞ N 0

- 4-

Processors are numbered in the order consistent with that of allocating them. P and Q are used to denote processors. τ x, l denotes the lth task that is assigned on the xth processor. u x, l denotes the utilization of task τ x, l . τ i is used to denote the ith task where there is no confusion. u i denotes the utilization of the ith task on a processor or in a task set. τ = (x, y) characterizes a task τ, where x and y are the computation time and the period of task τ.

III. Tight Bound for Rate-Monotonic-Next-Fit

The Rate-Monotonic-Next-Fit algorithm is given as follows: Algorithm RMNF: 1. Tasks are sorted in the non-decreasing order of their periods. 2. Set i = j = 1. /* i denotes the ith task, j the number of processors allocated */ 3. Assign task τ i to processor P j if this task together with the tasks that have been assigned to P j can be feasibly scheduled on P j according to Condition IP. If not, assign task τ i to P j + 1 and set j = j + 1. 4. If i < n, then set i = i + 1 and go to step 3 else stop. When the algorithm finishes, the value in j is the number of processors required to execute a given set of tasks. In order to obtain the tight bound of its worst-case performance, we prove that the upper bound given by Dhall and Liu is indeed the real upper bound by showing that for a given number of processors in the optimal schedule, a task set which can achieve the worst-case upper bound under Algorithm RMNF can always be constructed. The upper bound was stated in Theorem 3.1, the proof of which can be found in [12]. The low bound, as given in Theorem 3.2, requires surprisingly a much involved proof. For all sets of tasks, lim N ? N0 ≤ 2.67, where N0 is the minimum number of N0 → ∞ processors required to feasibly schedule the same set of tasks, and N is the number of processors obtained by Algorithm RMNF. Theorem 3.2: Let N be the number of processors required to feasibly schedule a set of tasks by Algorithm RMNF, and N 0 the minimum number of processors required to feasibly schedule the same set of tasks. Then lim N ? N0 ≥ 2.67 . Together with TheN →∞ orem 3.1, it is concluded that ? ( RMNF ) 0 = 2.67. Proof: In order to find the worst-case situations, where the biggest ratio between N and N0 is achieved, it is necessary to find those sets of tasks, which, when scheduled by Algorithm RMNF, use as many processors as possible. In other words, for a given set of tasks, where the total utilization is fixed, the worst case is achieved by appropriately allocating the utilization for each task and ordering the tasks in a certain way such that the number of processors required to execute the Theorem 3.1:

- 5-

task set is maximized according to the RMNF Algorithm. The function f (u, m) = 2(1 + u/(m-1))-(m-1) - 1 is a strictly decreasing function with regards to m, and it approaches the minimum utilization factor given by 2e-u - 1 when m approaches infinity. In fact, for a sufficiently large number m, 2(1 + u / (m-1))-(m-1) - 1 approaches 2e-u - 1 very quickly. Therefore, we claim that the following set of N*(m + 1) tasks requires N processors for sufficiently large m and small ε, when scheduled by Algorithm RMNF: ? ? ? ? ? ? ? ? ? m ? ? ? ? ? ? ? ? ? m (α, 1), ( ε, 1 ) , …… , ( ε, 1 ) , ……, (α, 1), ( ε, 1 ) , …… , ( ε, 1 )

where the value of α is obtained by solving the equation α = 2e-α - 1. α ≈ 0.3745. That N processors are used by Algorithm RMNF to schedule the N*(m + 1) tasks is because α > 2e-(α+mε) - 1. The total utilization of this set of tasks is therefore equal to Nα + Nmε. If this task set can be N perfectly scheduled on N0 = Nα + Nmε in the optimal schedule, then ? = = N / (Nα + Nmε) N0 ≈ 1 / α ≈ 2.67, for very small ε such that mε is small. Unfortunately, since α ≈ 0.3745, the above task set can not be perfectly scheduled in the optimal schedule using only Nα + Nmε processors, unless the execution of a task can be interrupted (not because of the rate-monotonic property), and its execution be resumed on another processor immediately. This later requirement is often referred to as processor migration. This implies that rate-monotonic algorithm is not honored in the optimal schedule. Though the above example does not suit our purpose, there are a number of things that we can adopt from the above example in finding the worst-case examples. First, the last tasks assigned to each processor in the completed RMNF schedule is a very large number m of tasks each with a very small utilization ε such that mε is small. Then the equation f(u) = 2e-u - 1 is used as the schedulability test condition. Second, on each processor in the completed RMNF schedule, it is always assigned, as the first task, a task with a large utilization (compared to ε), followed by, with few exceptions, m tasks each with a very small utilization ε subsequently. From now on, we only concern ourselves with the utilization of the first task on each of processors in the completed RMNF schedule. The following set of the tasks (tasks with ε utilization excluded) gives the worst-case performance of Algorithm RMNF: (0.402764, 1), (0.336940, 1), (0.427903, 1), (0.303749, 1), (0.476093, 1), (0.242412, 1), (0.569466, 1), (0.131655, 1), (0.223080, 1) (0.402764, 1), (0.336940, 1), (0.427903, 1), (0.303749, 1), (0.476093, 1), (0.242412, 1), (0.569466, 1), (0.131655, 1). The utilization of u i + 1 is given by 2 e i ? 1 for 1 ≤ i ≤ 7 and 9 ≤ i ≤ 16. According to the reasons given above, the first 8 tasks (tasks with ε utilization excluded) occupy 8 processors in the completed RMNF schedule, the 9th task is scheduled on the 8th processor, and the rest of the

?u

- 6-

8 tasks are scheduled on 8 processors, for the same reasons. Therefore the total number of processors used in the completed RMNF schedule is 16. Excluding the 9th task, these 16 tasks can be optimally scheduled on 6 processors, as shown below: Processor 1: tasks 1 and 5. Processor 2: tasks 2 and 6. Processor 3: tasks 3 and 4. Processor 4: tasks 7, 8, and 16. Processor 5: tasks 10, 11, and 12. Processor 6: tasks 13, 14, 15, and 17. The total utilizations of these processors are 0.997369, 0.997369, 0.952186, 0.937183, 0.977629, and 0.920228, respectively. Obviously task 9 can not be scheduled into any of these 6 processors, though the total available processor utilization on the 6 processors is larger than the utilization of the 9th task. If the 9th task is replaced by a number of tasks each with a small utilization, yet their total utilizations add up to 0.223080, then the number of processors required to execute this new set of tasks is still 6 in the optimal schedule, since those newly replacing tasks can be now scheduled on the 6 processors. The replacement of the 9th task does not change the number of procesN sors used in the RMNF schedule either. Therefore, ? = = 16 / 6 ≈ 2.67. N0 Yet, in order to prove the theorem, we need to show that for any given number N 0, a task set can be constructed such that the ratio 2.67 is achieved. Even though we only give one task set above as the example where this worst-case ratio is indeed achieved, we claim that the 2.67 ratio is indeed achievable for different numbers of N 0 . For any given number N 0, the task set that can achieve the worst-case ratio can be constructed. However, the construction has to be done in a case by case manner, similar to the above example. The claim lies in the fact that, if the utilization ?u of a task (tasks with ε utilization excluded) is given by u i + 1 = 2 e i ? 1 for 1 ≤ i ≤ N-1, and u1 > α, then the total utilization of the N tasks is given by Nα + Nmε. The ratio is then given by ? = N < N / (Nα + Nmε) ≈ 2.67. The key, of course, is to find many sequences of u i s such that they N0 can be perfectly scheduled in the optimal scheduled without requiring process migration. Note ?u that with u1 > α ≈ 0.3745, and u i + 1 = 2 e i ? 1 for 1 ≤ i ≤ N - 1, u 2 i ? 1 + u 2 i < 2α for 1 ≤ i ≤ N N N ? 2 , as shown in Figure 1. ∑ i u ≤ Nα if N is even. ∑ i u ≥ Nα if N is odd, since u 2 i =1 i =1 i + u 2 i + 1 > 2α for 1 ≤ i ≤ ( N ? 1 ) ? 2 .

Figure 1: Properties of Condition IP

- 7-

From Theorem 3.1, it is concluded that ? = lim

N = 2.67. Q.E.D. N m→∞ 0

IV. Tight Bound for Rate-Monotonic-First-Fit

In assigning tasks to processors, Algorithm RMNF only checks the current processor to see whether a task together with those tasks that have already been assigned to that processor can be feasibly scheduled or not. If not, the task has to be scheduled on an idle processor, even though the task may be scheduled on those processors used earlier. To overcome this waste of processor utilization, the RMFF Algorithm always starts to check the schedulability of a task on processors with lower indexes, i.e., those processors on which some tasks have been assigned. This algorithm is given as follows: Algorithm RMFF: Let the processors be indexed as P1, P2, …, with each initially in the idle state, i.e., with zero utilization. The tasks τ1, τ2, …, τn, which are ordered according to nondecreasing periods, will be scheduled in that order. To schedule τi, find the least j such that task τi, together with all the tasks that have been assigned to processor Pj can be feasibly scheduled according to Condition IP for a single processor, and assign task τi to Pj. Algorithm RMFF can be described in a more algorithmic format as follows: Algorithm RMFF (Input: task set ∑; Output: m) 1. Tasks are sorted in the non-decreasing order of their periods. 2. Set i = 1 and m = 1. /* i denotes the ith task, m the number of processors allocated*/ 3. (a) Set j = 1. /* j denotes the jth processor */ (b) If u i ≤ 2 ( 1 + U j ? k j ) ?kj ? 1 , assign task τi to Pj, i.e., increment k j = k j + 1 and U j = U j + u i , and set m = j if j < m, where k j and U j denote the number of tasks already assigned to processor Pj and the total utilization of the k j tasks, respectively, and u i denotes the utilization of task τi. Otherwise, increment j = j + 1 and go to step 3(b). 4. If i > n, i.e., all tasks have been assigned, then return m. Otherwise increment i = i + 1 and go to step 3(a). When the algorithm terminates, m is the number of processors required for scheduling the given set of tasks according to the RMFF Algorithm. Since an idle processor will not be used until all the processors with some utilizations can not execute an incoming task, it is therefore expected that Algorithm RMFF would have better performance than that of Algorithm RMNF, which was shown to be the case, to some extent, by Dhall and Liu [5]. The following results were

- 8-

obtained in [5]. Lemma 1: If m tasks can not be feasibly scheduled on m ? 1 processors according to the RMFF Algorithm, then the utilization factor of the set of tasks is greater than m ? ( 1 + 2 1 ? 3 ) . Lemma 2: If tasks are assigned to the processors according to the RMFF Algorithm, among all processors to each of which two tasks are assigned, there is at most one processor for which the utilization factor of the set of the two tasks is less than 1/2. Theorem 1: Let N be the number of processors required to feasibly schedule a set of tasks by the RMFF Algorithm, and N 0 the minimum number of processors required to feasibly schedule the same set of tasks. Then as N 0 approaches infinity, 2 ≤ N/N0 ≤ 4 × 21/3 / (1 + 21/3) (≈ 2.23). Unfortunately, Lemma 1 is incorrect, as shown by the following counter example. Lemma 2 gives a weak result for RMFF Algorithm. These two errors led the authors to arrive at the wrong upper bound. In the following, we first show the incorrectness of Lemma 1, and present its correct version. We then give a strong version of Lemma 2. A new upper bound is proven finally. Example: Consider the case where m = 2 and the two tasks are given as follows: τ1 = (21/2 - 1, 1) τ2 = (2 - 21/2 + ε, 21/2), where ε is a small number and ε > 0. According to the RMFF Algorithm, τ1 is first assigned to a processor. Since u1 = 21/2 - 1 and 2 (1 + u1)-1 -1 = 21/2 - 1 < 21/2 - 1 + ε / 21/2 = u2, τ2 can not be scheduled together with task τ1 on one processor, according to Condition IP. Since τ1 and τ2 can not be scheduled on one processor, u1 + u2 must be greater than 2/(1 + 21/3) ? 0.88 according to Lemma 1. But u1 + u2 = 2(21/ 2 - 1) + ε / 21/2 = 0.8284 + ε / 21/2, which is less than 0.88 for small ε. When m > 2, similar examples can be constructed to show the incorrectness of Lemma 1. Henceforth, a new version of Lemma 1 is given as follows: Lemma 4.1: If m tasks can not be feasibly scheduled on m - 1 processors according to the RMFF Algorithm, then the utilization factor of the set of tasks is greater than m / (1 + 21/2) = m ( 21 ? 2 ? 1 ) . Proof: The proof is by induction. (1) m = 2. Suppose u1 and u2 are the utilizations of two tasks which can not be scheduled on a processor according to Condition IP, i.e., u2 > 2(1 + u1)-1 - 1. u1 + u2 = u1 + 2(1 + u1)-1 - 1. To find the minimum of f(u1) = u1 + 2(1 + u1)-1 - 1, we take the derivative of function f(u1), and solve for u1. The minimum of f(u1) is achieved when u1 = (21/2 - 1). Therefore u1 + u2 > 2(21/2 - 1). (2) Suppose the Lemma is true for m = k , i.e.,

∑ ik = 1 ui > k ( 21 ? 2 ? 1 )

where ui is the utilization of task i.

(E.Q.1)

When m = k + 1 , the (k + 1)th task can not be scheduled on any of the k processors, i.e., u i + u k + 1 > 2 ( 2 1 ? 2 ? 1 ) , where 1 ≤ i ≤ k . Summing up the k equations yields

∑ ik = 1 ui + kuk + 1 > 2 k ( 21 ? 2 ? 1 )

(E.Q.2)

- 9-

Multiplying k -1 on both sides of equation (E.Q.1) yields (k -1)

∑ ik = 1 ui > (k - 1) k ( 21 ? 2 ? 1 )

(E.Q.3)

Adding up equations (E.Q.2) and (E.Q.3) and dividing the new equation on both sides by k k+1 yields ∑ i u > ( k + 1 ) ( 2 1 ? 2 ? 1 ) . Therefore Lemma 4.1 is proven. Q.E.D. =1 i A strong version of the original lemma ? Lemma 2 by Dhall and Liu is given as follows: Lemma 4.2: If tasks are assigned to the processors according to the RMFF Algorithm, among all processors to each of which two tasks are assigned, there is at most one processor for which the total utilization factor of the two tasks is less than or equal to 2(21/3-1) ≈ 0.52. Proof: This lemma is proven by contradiction. Suppose that the contrary is true. Let τ j, 1 and τ j, 2 be the two tasks assigned to processor Pj, and τ k, 1 and τ k, 2 be the two tasks assigned to processor Pk with j < k, such that u j, 1 + u j, 2 ≤ 2(21/3-1) and u k, 1 + u k, 2 ≤ 2(21/3-1), (E.Q.4) where u x, l is the utilization of task τ x, l . There are three cases to consider. Note that the testing condition used is Condition IP, i.e., if a task’s utilization C / T ≤ 2 ( 1 + u ? ( m ? 1 ) ) ? ( m ? 1 ) - 1, then this task together with the m - 1 tasks which have already been assigned to a processor can be feasibly scheduled by the rate1 ? ( m ? 1) m?1 monotonic scheduling algorithm, where u = ∑ i C ? Ti ≤ ( m ? 1 ) ( 2 ? 1 ) . The =1 i ? ( m ? 1) function f(u, m) = 2 ( 1 + u ? ( m ? 1 ) ) - 1 is a strictly decreasing function with regards to u and m. Case 1: Tasks τ k, 1 and τ k, 2 were assigned to processor Pk after task τ j, 2 had been assigned to processor Pj. According to RMFF, we must have u k, 1 > 2(1 + ( u j, 1 + u j, 2 ) / 2)-2 - 1 and u k, 2 > 2(1 + ( u j, 1 + u j, 2 ) / 2)-2 - 1 Summing up these two inequalities, we have u k, 1 + u k, 2 > 4(1 + ( u j, 1 + u j, 2 ) / 2)-2 - 2 > 4(1 + 21/3-1)-2 - 2 = 2(21/3-1) which is a contradiction to (E.Q.4). Case 2: Tasks τ k, 1 and τ k, 2 were assigned to processor Pk after task τ j, 1 had been assigned to processor Pj, but before task τ j, 2 . According to RMFF, we must have u k, 1 > 2(1 + u j, 1 )-1 - 1 and u k, 2 > 2(1 + u j, 1 )-1 - 1 Summing up these two inequalities yields u k, 1 + u k, 2 > 4(1 + u j, 1 )-1 - 2 > 4(1 + 2(21/3-1))-1 - 2) > 2(21/3-1) since u j, 1 ≤ 2(21/3-1) and 2(1 + 2(21/3-1))-1 > 21/3. However, this is again a contradiction to (E.Q.4). Case 3: Task τ k, 1 was assigned to processor Pk after task τ j, 1 had been assigned to pro- 10 -

cessor Pj, and task τ k, 2 was assigned to Pk after task τ j, 2 had been assigned to Pj. According to RMFF, we must have u k, 1 > 2(1 + u j, 1 )-1 - 1 and u k, 2 > 2(1 + ( u j, 1 + u j, 2 ) / 2)-2 - 1 > 2(1 + 21/3-1)-2 - 1 = (21/3-1) Summing up these two inequalities yields u k, 1 + u k, 2 > 2(1 + u j, 1 )-1 - 1 + (21/3-1) > 2(1 + 2(21/3-1))-1 - 1 + (21/3-1) > 21/31/3 - 1 + (2 -1) = 2(21/3-1) which is again a contradiction to (E.Q.4). Q.E.D. Actually, a more generalized result is obtained for the case where the number of tasks assigned to a processor is arbitrary. The proof of the following lemma is given in the appendix. Lemma 4.3: If tasks are assigned to the processors according to the RMFF Algorithm, among all processors to each of which n ≥ 1 tasks are assigned, there is at most one processor for which the utilization factor of the n tasks is less than or equal to n(21/(n+1)-1). 1 ? ( n + 1) lim n ( 2 ? 1 ) = ln 2

n→∞

Let N be the number of processors required to feasibly schedule a set of tasks by the Algorithm RMFF, and N 0 the minimum number of processors required to feasibly schedule the same set of tasks. Then lim N ? N0 ≤ 2 + ( 3 ? 2 3 ? 2 ) / N0 → ∞ ( 2 ( 2 1 ? 3 ? 1 ) ) ≈ 2.33. In order to prove the above bound, we define a function that maps the utilizations of tasks into the real interval [0, 1] as follows: f ( u) = { or u ? ( 2 ( 21 ? 3 ? 1 ) ) 1 f(u)

1.0

Theorem 4.1:

0 ≤ u < 2 ( 21 ? 3 ? 1 ) 2 ( 21 ? 3 ? 1 ) ≤ u ≤ 1

1/2

u Figure 2: Mapping Function for RMFF and RMBF

a=0.52 1

0

- 11 -

u?a 0≤u<a , where a = 2 ( 2 1 ? 3 ? 1 ) . 1 a≤u≤1 Let τ j, 1, τ j, 2, …, τ j, k be kj tasks assigned to processor Pj, and let j deficiency δj of processor Pj is defined as f ( u) = { ?0 δj = ? ?k ? 2 ( 1 + Uj ? kj ) j ? 1 Uj ≥ kj ( 2

1 ? kj

∑ i = 1 uj, i

kj

= U j . The

? 1)

Otherwise

The coarseness αj of processor Pj is defined as 0 j = 1 αj = { max 1 ≤ i ≤ j ? 1 δ i j>1 Lemma 4.4: For Algorithm RMFF, the following properties hold: (1) No task is assigned to an idle processor unless it can not be assigned in any nonidle processor. (2) If a processor P has a coarseness of α, then the utilization of each task that was assigned to P exceeds α. Proof: For Algorithm RMFF, properties (1) and (2) hold according to its definition. Q.E.D. Lemma 4.5: If a processor is assigned a number of tasks τ 1, τ 2, …, τ m , with utilizations u 1, u 2, …, u m , then ∑ m f ( u i ) ≤ 1 ? a , where a = 2 ( 2 1 ? 3 ? 1 ) . i=1 Proof: Without lose of generality, it is assumed that u1 ≥ u2 ≥ … ≥ um. If u1 ≥ a, then u2 < a. m m ) = f(u1) + ∑ i f ( ui ) = 1 + ( ∑ i u ) / a ≤ 1 + (1 - a) / a = 1 / a. Otherwise (u1 < ∑ im= 1 f ( uim =2 i =2 m a), then ∑ i = 1 f ( u i ) = ∑ i = 1 u i / a ≤ 1 / a. Q.E.D. Lemma 4.6: Suppose tasks are assigned to processors according to RMFF Algorithm. If a procesm sor with coarseness α ≥ a / 3 is assigned m ≥ 3 tasks, then ∑ i f ( u i ) ≥ 1 , where =1 u 1, u 2, …, u m are utilizations of the m tasks τ 1, τ 2, …, τ m that are assigned to the processor. Proof: According to Lemma 4.4, u i > α ≥ a / 3 for 1 ≤ i ≤ m . If one of the tasks has a utilization m greater than a, then ∑ m f ( u i ) ≥ 1 . Otherwise, ∑ m f ( ui) = ∑ i u / a ≥ m ( a ? 3 ) / a ≥ 1, =1 i i=1 i=1 since m ≥ 3. Q.E.D. Lemma 4.7: Suppose tasks are assigned to processors according to RMFF Algorithm. If a processor with coarseness α < a / 3 is assigned m ≥ 3 tasks τ 1, τ 2, …, τ m with utilizations m u 1, u 2, …, u m , and ∑ i u ≥ ln2 - α, then ∑ m f ( ui ) ≥ 1 . =1 i i=1 m Proof: If one of the tasks τ 1, τ 2, …, τ m has a utilization greater than a, then ∑ i f ( ui ) ≥ 1 . =1 m m Otherwise, ∑ i = 1 f ( u i ) = ∑ i = 1 u i / a ≥ (ln2 - α) / a ≥ (ln2 - a /3) / a ≥ 1. Q.E.D. Lemma 4.8: Suppose tasks are assigned to processors according to RMFF Algorithm. If a processor with coarseness α is assigned m ≥ 1 tasks τ 1, τ 2, …, τ m with utilizations m u 1, u 2, …, u m , and ∑ i f ( u i ) = 1 ? β where β > 0, then =1 (1) m = 1 and u 1 < a or

- 12 -

(2) m = 2 and u 1 + u 2 < a or

Q.E.D.

α - γ, where γ > 0. To find out the relationship between γ and β, let us replace the first three tasks τ 1, τ 2 , and τ 3 by three new tasks with utilizations υ1, υ2, and υ3, such that υ1 + υ2 + υ3 = u1 + u2 + u3 + γ, υ1 ≥ u1, υ2 ≥ u2, υ3 ≥ u3, and υ1 < a, υ2 < a, υ3 < a. According to Lemma 4.7, m f(υ1) + f(υ2) + f(υ3) + ∑ i f ( u i ) ≥ 1. Since f(υ1) + f(υ2) + f(υ3) = f(u1) + f(u2) + f(u3) + f(γ) =4 m = f(u1) + f(u2) + f(u3) + γ / a, γ / a + 1 - β ≥ 1. γ ≥ aβ. Therefore, ∑ i u ≤ ln2 - α - aβ. =1 i

∑ im= 1 ui ≤ ln2 - α - aβ. m Proof: (1) If m = 1 and u 1 ≥ a, then ∑ i f ( u i ) ≥ 1, which is a contradiction. =1 m (2) If m = 2 and u 1 + u 2 ≥ a, then ∑ i f ( u i ) ≥ 1, which is again a contradiction. =1 m (3) If properties (1) and (2) do not hold, then m ≥ 3. Since ∑ i f ( u i ) < 1, α must be less =1 m m than a / 3 and ∑ i = 1 u i < ln2 - α according to Lemma 4.6 and Lemma 4.7. Let ∑ i u = ln2 =1 i

(3) m ≥ 3 and

Proof of Theorem 4.1: Let Σ = { τ 1, τ 2, …, τ m } be a set of m tasks, with their utilizations m u 1, u 2, …, u m respectively, and ? = ∑ i f ( u i ) . By Lemma 4.5, ? ≤ N0 / a, where a = =1 1?3 2 (2 ? 1) . Suppose that among the N number of processors used by RMFF Algorithm to schedule a given set Σ of tasks, L of them has ∑ j f ( u j ) = 1 ? β i with βi > 0, where j ranges over all tasks in processor i among the L processors. Let us divide these processors into three different classes: (1) Processors that only one task is assigned. Let n1 denote the number of processors in this class. (2) Processors that two tasks are assigned. Let n2 denote the number of processors in this class. According to Lemma 4.2, there is at most one processor whose utilization in the RMFF schedule is less than or equal to a = 2 ( 2 1 ? 3 ? 1 ) . Therefore n2 = 0 or 1. (3) Processors that at least three tasks are assigned. Let n3 denote the number of processors in this class. Obviously, L = n1 + n2 + n3. For each of the rest N - L processors, ranges over all tasks in a processor.

n

∑ j f ( uj )

≥ 1, where j

For the processors in class (1), ∑ i 1= 1 u i > n1 (21/2 - 1) according to Lemma 4.1. Since n n according to ∑ i 1= 1 f ( ui ) < 1, ui < a, and therefore ∑ i 1= 1 f ( ui ) > n1 (21/2 - 1) / a. Moreover, 1/2 Lemma 4.9, there is at most one task whose utilization is less than or equal to (2 - 1). In the optimal assignment of these tasks, the optimal number N0 of processors used can not be less than n1 /2, i.e., N0 ≥ n1 /2, since possibly with one exception, any three tasks among these tasks can not be scheduled on one processor.

- 13 -

For the processors in class (3), let Q1, Q2, ……, Q n denote the n3 processors in this class, 3 k and α i be the coarseness of processor Q i , and ∑ l i= 1 f ( u l ) = 1 - βi with βi > 0, for 1 ≤ i ≤ n3. For processor i, U i ≤ ln2 - α i - aβi according to Lemma 4.8. According to the definition of coarseness, α i + 1 ≥ δ i ≥ ln2 - U i , since δ i = 2 ( 1 + U i ? k i ) ?ki ?u - 1 > 2 e i - 1 > ln2 - Ui. Therefore α i + 1 ≥ α i + aβi, for 1 ≤ i < n3. Summing up these (n3 - 1) equations yields a ∑ i 3= 1 β i ≤ α n - α 1 < a / 3, i.e.,

n ?1

∑ i = 1 ∑ l = 1 f ( ul)

n3

ki

3

≥ n3 - 1 - ∑ i 3= 1 β i > n3 - 4 / 3.

n ?1

∑ i = 1 βi < 1 / 3.

n3 ? 1

Now we are ready to find out the relationship between N and N0.

? = ∑m f ( u i ) ≥ (N - L) + n1 (21/2 - 1) / a + n3 - 4 / 3 i=1

= N - n1 - n2 - n3 + n1 (21/2 - 1) / a + n3 - 4 / 3 = N - n1(1 - (21/2 - 1) / a) - n2 - 4 / 3

≥ N - 2N0(1 - (21/2 - 1) / a) - n2 - 4 / 3, where a = 2 ( 2 1 ? 3 ? 1 ) .

Since ? ≤ N0 / a by Lemma 4.5, N0 / a ≥ N - 2N0(1 - (21/2 - 1) / a) - n2 - 4 / 3 ≥ N - 2N0(1 - (21/2 - 1) / a) - 7 / 3. Therefore, N / N0 ≤ (2a + 1 - 2(21/2 - 1)) / a + 7/(3N0).

N0 → ∞

lim N ? N0 ≤ (2a + 1 - 2(21/2 - 1)) / a ≈ 2.33. Q.E.D.

Let N be the number of processors required to feasibly schedule a set of tasks by RMFF Algorithm, and N 0 the minimum number of processors required to feasibly schedule the same set of tasks. Then lim N ? N0 ≥ 2.3 . N0 → ∞ Proof: In order to find the bound ? = lim N ? N0 , we proceed by finding the maximum number N0 → ∞ of processors needed to schedule a certain set of tasks using RMFF Algorithm, given that the optimal number of processors required to schedule the same set of tasks is known. In the process, the desired set of tasks is constructed. Note that this process is exactly opposite to how a set of tasks is scheduled. Let N 0 = m, where m is a natural number. A set of tasks, which uses exactly N 0 number of processors in the optimal schedule, is to be specified in the following. Without generality, all tasks are assumed to have a period of 1. This set of tasks consists of a theoretically infinite regions, given that N 0 is sufficiently large. The regions of tasks are given as follows. Note that the regions specified first are scheduled last in the RMFF Algorithm, in other words, they appear last in the task set. Region 1: There are 2 N 0 number of tasks each with a utilization of u1 = (21/2 - 1) + ε, where

Theorem 4.2:

- 14 -

ε is a arbitrary small number. These 2 N 0 tasks will utilize 2 N 0 number of processors in the

RMFF schedule, while requires only N 0 number of processors in the processors in the optimal schedule. If N 0 ≤ 2, then we have found ? = 2. Region 2: If 3 ≤ N 0 ≤ 5, there are N 0 tasks, each of which has a utilization of u2 = (21/5 - 1). These N 0 tasks utilize one processors in the RMFF schedule, while requires no extra processor in the optimal schedule, only to fill part of the utilization left by tasks in region 1, i.e., (21/5 - 1) < 1 2*((21/2 - 1) + ε). Note that tasks in region 1 can not be scheduled on this processor, since u1 > 2(1 + 3u2 / 3)-3 - 1. N = 2 N 0 + 1. The bound is given by ? = 2 N 0 / N 0 + 1 / N 0 . Region 3: If 6 ≤ N 0 ≤ 9, the tasks in regions 1 and 2 are included. Furthermore, there are three more tasks each having a utilization of (21/5 - 1) and six tasks each with a utilization of u3 = 1 - 2*((21/2 - 1) + ε) - (21/5 - 1) - ε. These nine tasks use one processor in the RMFF schedule, while requires no extra processor in the optimal schedule, only to fill part or all of the utilization left by tasks in regions 1 and 2. Note that since u2 > 2(1 + (3u2 + 6u3) / 10)-10 - 1. The tasks in region 2 can not be scheduled on the processor occupied by tasks in this region. N = 2 N 0 + 2, and the bound is therefore given by ? = 2 N 0 / N 0 + 2 / N 0 . Region 4: If 10 ≤ N 0 ≤ 12, the tasks in regions 1, 2, and 3 are included. Furthermore, there are four more tasks each having a utilization of (21/5 - 1), except the last one with a utilization of (21/5 - 1) + ε, where ε is an arbitrary small number. These four tasks are placed in one processor in the RMFF schedule, while requires no extra processor in the optimal schedule, only to fill part of the utilization left by tasks in regions 1, 2, and 3. Note that these tasks do not appear first in the task, rather they follow after the nine tasks in region 3, but before the three tasks each having a utilization of (21/5 - 1). Since 5(21/5 - 1) - 4u2 < u2. The last three tasks in region 3 can not be scheduled on the processor occupied by tasks in this region. N = 2 N 0 + 3, and the bound is therefore given by ? = 2 N 0 / N 0 + 2 / N 0 . This process continues until the largest value of N is found for a given N 0 , as illustrated by Figure 3. Note that the value ui is determined by finding the smallest k such that ui = (21/k - 1) and i?1 ui ≤ 1 - ∑ l u , for i ≥ 2. =1 l

For a given N 0 , N = 2 N 0 + 1 + ( N 0 ? 3 ) ? 4 + 1 + ( N 0 ? 25 ) ? 30 + …… The bound is given by 2 N 0 + 1 + ( N 0 ? 3 ) ? 4 + 1 + ( N 0 ? 25 ) ? 30 + …… N ?= = ≈ 2.30. (E.Q.5) N0 N0 For example, given N 0 = 27, we construct a set of tasks which, according to RMFF Algorithm, requires N = 62 number of processors. There are 2 N 0 = 54 number of tasks with utilization u1 = (21/2 - 1) + ε, where ε is a arbitrary small number. There is one processor occupied by three tasks each with a utilization of u2 = (21/5 - 1). There are ( N 0 ? 3 ) ? 4 = 6 number of processors occupied by 6*4 tasks each with a utilization of (21/5 - 1). There is finally a processor occupied by 25 tasks each with a utilization of u3

- 15 -

= 1 - 2*((21/2 - 1) + ε) - (21/5 - 1) - ε. The set of tasks is given as follows. Note that the total number of tasks is 106.

ε+υ

30x0.00263 =0..693238

ε+υ

ε+υ

ε+υ

ε+υ

0.4141

2551x0.00263 30x0.0226 =0.67088 =0.678343

25x0.56527 =0.565275 4x0.1487 3x0.1487 =0.5948 =0.4461 0.4141 0.4141

Direction of 1 allocating processors

( N 0 ? 25 ) ? 30

1

( N0 ? 3) ? 4

1

2 N0

N0

(a) RMFF Schedule Figure 3: RMFF vs Optimal τ i = (u3, 1), for 1 ≤ i ≤ 25.

(b) Optimal Schedule

τ i = (u2, 1) for 26 ≤ i ≤ 52 except i = 29, 33, 37, 41, 45, 49, where τ i = (u2 + ε, 1). τ i = (u1, 1) for 53 ≤ i ≤ 106. According to RMFF Algorithm, The first 25 tasks are scheduled on the first processor. Since u2 > 2(1 + 25u3 / 25)-25 - 1, the 26th task is scheduled on the second processor. The 29th task can not be scheduled on the second processor, since u2 + ε > 2(1 + 4u3 / 4)-4 - 1. Proceeding in this fashion, the 23 successive tasks occupy 6 processors. The 53th task have to be scheduled on the 8th processor, since u1 + ε > 2(1 + 3u3 / 34)-3 - 1. The rest of the 53 tasks occupies 53 processors, one task for a processor, since (21/2 - 1) + ε > 2(1 + u1)-1 - 1 = 2 / (21/2 + ε) - 1. The total N number of processors required is thus N = 62. The bound is given by ? = ≈ 2.30. N0 Table 1: Performance of RMFF (and also RMBF) N0 2 3 4 5 6 7 8 9

?(RMFF)

2 2.33 2.25 2.20 2.33 2.29 2.25 2.22

N0 10 11 12 13 17 20 27 48

?(RMFF)

2.30 2.29 2.25 2.31 2.29 2.30 2.30 2.29

- 16 -

The exact performance bounds for several given optimal number of processors are given in Table 1. We conjecture that the above formula (E.Q.5) gives the EXACT tight bound for RMFF Algorithm. Q.E.D.

V. Tight Bound for Rate-Monotonic-Best-Fit

When Algorithm RMFF schedules a task, it always assigns it to the lowest indexed processor on which the task can be scheduled. This strategy may not be optimal in some cases. For example, the lowest indexed processor on which a task is scheduled may be the one with the largest available utilization among all those busy (non-idle) processors. This processor could have been used to execute a future task with large enough utilization so that it could not be scheduled on any busy processors, had it not been assigned a task with a small utilization earlier on. In order to overcome these likely disadvantages, a new algorithm is designed as follows, which is based on the Best-Fit bin-packing algorithm. Algorithm RMBF: Let the processors be indexed as P1, P2, …, with each initially in the idle state, i.e., with zero utilization. The tasks τ1, τ2, …, τn, which are ordered according to their non-decreasing periods, will be scheduled in that order. To schedule τi, find the least j such that task τi, together with all the tasks that have been assigned to processor Pj can be feasibly scheduled according to Condition IP for a single processor, and 2 ( 1 + U j ? k j ) ?kj - 1 be as small as possible, and assign task τi to Pj, where k j and U j are the number of tasks already assigned to processor Pj and the total utilization of the k j tasks, respectively, and u i is the utilization of task τi. Surprisingly, even with this modification in assigning tasks to processors, the RMBF Algorithm does not outperform Algorithm RMFF in the worst-case, as shown by Theorem 5.1 and Theorem 5.2. Before we prove the tight bound for RMBF, the following definition is needed, which is key to the proof of Theorem 5.1. Definition 1: For all the processors required to schedule a given set of tasks by the RMBF Algorithm, they are divided into two types of processors: Type (I): For all the tasks τ 1, τ 2, …, τ m with utilizations u 1, u 2, …, u m that were assigned to a processor Px in the completed RMBF schedule, there exists at least one task τ i with i ≥ 2 that was assigned to Px, not because it could not be assigned on any processor Py with lower index, i.e., y < x, but because ?ny ? ( i ? 1) ny i?1 ) ? ( i ? 1 ) ) 2 (1 + (∑l u 1 < 2 1 u ( + ( ) ? n ) ∑ l = 1 l y - 1, where ny =1 l is the number of tasks assigned to processor Py. Processor Px is called a Type (I) processor. Such a task τ i is, for convenience, referred to as a task with Type (I)

- 17 -

property. Type (II): They consist of all the processors that do not belong to Type (I). Lemma 5.1: For Algorithm RMBF, the following properties hold: (1) No task is assigned to an idle processor unless it can not be assigned in any nonidle processor. Proof: For Algorithm RMBF, properties (1) is true according to its definition. Q.E.D. Lemma 5.2: If m tasks can not be feasibly scheduled on m ? 1 processors according to the RMBF Algorithm, then the utilization factor of the set of tasks is greater than m ( 21 ? 2 ? 1 ) . Proof: The proof of this lemma is similar to that of Lemma 4.1. Q.E.D. The two lemmas given below follow directly from Lemma 4.2 and Lemma 4.3. Lemma 5.3: In the completed RMBF schedule, among all processors of Type (II), to each of which two tasks are assigned, there is at most one processor for which the total utilization factor of the set of the two tasks is less than or equal to 2(21/3-1). Lemma 5.4: In the completed RMBF schedule, among all processors of Type (II), to each of which n tasks are assigned, there is at most one processor for which the total utilization factor of the set of the n tasks is less than or equal to n(21/(n+1)-1). 1 ? ( n + 1) lim n ( 2 ? 1 ) = ln 2 . n→∞ Lemma 5.5: In the completed RMBF schedule, if the second task on any of the Type (I) processors has Type (I) property, then the first task on that processor has a utilization greater than (21/2-1). Proof: Let τ k, 1 and τ k, 2 be the first and second tasks assigned to processor Pk of Type (I), and Py, with y < k, is one of the processors on which τ k 2 could have been scheduled, but 2(1 + u k, 1 )-1 - 1 ?ny ny < 2 ( 1 + ( ∑ l = 1 u y, l ) ? n y ) - 1, where n y is the number of tasks assigned to processor Py, and where u x, l is the utilization of task τ x, l . ?ny n Since u k, 1 > 2 ( 1 + ( ∑ l y= 1 u y, l ) ? n y ) - 1 (note that this is true even though τ k, 1 is assigned to processor Pk before some of tasks among the n y tasks are assigned to processor Py), ?ny ny -1 u k, 1 > 2 ( 1 + ( ∑ l = 1 u y, l ) ? n y ) - 1 > 2(1 + u k, 1 ) - 1. Therefore u k, 1 > (21/2-1). Q.E.D. Lemma 5.6: In the completed RMBF schedule, if the mth task on any of the Type (I) processors has Type (I) property, where m ≥ 3, then the total utilization of the first (m-1) tasks on that processor is greater than (m-1)(21/m-1). The proof of this lemma is given in the appendix. The following lemma is key to the proof of Theorem 5.1. Lemma 5.7: In the completed RMBF schedule, among the processors of Type (I) on which the second task has Type (I) property, there are at most three of them, each of which has a total utilization less than 2(21/3-1). Proof: This lemma is proven by contradiction. Let Pi, Pj, Pk, and Pl be the four processors, each

- 18 -

of which has a total utilization less than 2(21/3-1) with i < j < k < l, i.e.,

where ni ≥ 2, nj ≥ 2, nk ≥ 2, and nl ≥ 2 are the number of tasks assigned to processors Pi, Pj, Pk, and Pl, respectively. Let’s define u i, 1 and u i, 2 to be the utilizations of the first task τ i, 1 and second tasks τ i, 2 assigned to processor Pi, u j, 1 and u j, 2 to be the utilizations of the first task τ j, 1 and second tasks τ j, 2 assigned to processor Pj. u k, 1 and u k, 2 , u l, 1 and u l, 2 are similarly defined. We further assume that n y is the number of tasks which have been assigned to processor Pi, when the second task on processor Pj is assigned. Note that i < j and 1 ≤ n y ≤ nj. There are three cases to consider. Case 1: Tasks τ j, 1 and τ j, 2 are assigned to processor Pj after task τ i, 2 is assigned to processor Pi. Since task τ j, 2 is a Type (I) task, the following inequality must hold Note that n y ≥ 2, i.e., other tasks may have been assigned to processor Pi after task τ i, 2 but before τ j, 1 is assigned to processor Pj. Since 2 ( 1 + ( ∑ x y= 1 u i, x ) ? n y )

n ?ny

∑ x = 1 ui, x < 2(21/3-1) n ∑ x = 1 uj, x < 2(21/3-1) n ∑ x = 1 uk, x < 2(21/3-1) n ∑ x = 1 ul, x < 2(21/3-1)

j k l

ni

2(1 + u j, 1 )-1 - 1 < 2 ( 1 + ( ∑ x y= 1 u i, x ) ? n y )

n

?ny

-1

- 1 ≤ 2(1 + ( u i, 1 + u i, 2 ) / 2)-2 - 1 < 2(1 + u i, 1 / 2)-2 - 1,

2(1 + u j, 1 )-1 - 1 < 2(1 + u i, 1 / 2)-2 - 1, i.e., 1 + u j, 1 > (1 + u i, 1 / 2)2. Case 2: Tasks τ j, 1 and τ j, 2 are assigned to processor Pj after task τ i, 1 is assigned to processor Pi but before task τ i, 2 is assigned to processor Pi.

n

This case is impossible with RMBF scheduling. Since ∑ x i = 1 u i, x < 2(21/3-1) and u i, 1 > (21/2-1) according to Lemma 5.5, u i, 2 < 2(21/3-1) - (21/2-1) ≈ 0.1056. Since task τ j, 2 is assigned to processor Pj before task τ i, 2 is assigned to processor Pi, and task τ j, 2 is a Type (I) task, 2(1 + u i, 1 )-1 - 1 > 2(1 + u j, 1 )-1 - 1, i.e., u i, 1 < u j, 1 . Since task τ i, 2 is also a Type (I) task, it must be true according to the definition that

n ?nz

(E.Q.6)

2(1 + u i, 1 )-1 - 1 < 2 ( 1 + ( ∑ x z= 1 u j, x ) ? n z ) - 1, where n z is the number of tasks that have been assigned to processor Pj after task τ j, 2 , but before task τ i, 2 is assigned to processor Pi. Note that it is conceivable that other tasks may have been assigned to processor Pj after task τ j, 2 but before task τ i, 2 is assigned to processor Pi. Since 2(1 + u i, 1 )-1 - 1 < 2 ( 1 + ( ∑ x z= 1 u j, x ) ? n z )

- 19 n ?nz

- 1 < 2(1 + u j, 1 )-1 - 1, u i, 1 > u j, 1 .

This is a contradiction to equation (E.Q.6). Case 3: Task τ j, 1 is assigned to processor Pj after task τ i, 1 is assigned to processor Pi, and task τ j, 2 is assigned to processor Pj after task τ i, 2 is assigned to processor Pi. Since task τ j, 2 is a Type (I) task, the following inequality must hold Note that n y ≥ 2, i.e., other tasks may have been assigned to processor Pi after task τ i, 2 but before τ j, 2 is assigned to processor Pj. Since 2 ( 1 + ( ∑ x y= 1 u i, x ) ? n y )

n ?ny

2(1 + u j, 1 )-1 - 1 < 2 ( 1 + ( ∑ x y= 1 u i, x ) ? n y )

n

?ny

-1

- 1 ≤ 2(1 + ( u i, 1 + u i, 2 ) / 2)-2 - 1 < 2(1 + u i, 1 / 2)-2 - 1,

2(1 + u j, 1 )-1 - 1 < 2(1 + u i, 1 / 2)-2 - 1, i.e., 1 + u j, 1 > (1 + u i, 1 / 2)2. Therefore for processors Pi and Pj, we have 1 + u j, 1 > (1 + u i, 1 / 2)2. 1 + u k, 1 > (1 + u j, 1 / 2)2 1 + u l, 1 > (1 + u k, 1 / 2)2 (E.Q.7) For the tasks assigned on processors Pj and Pk, and Pk and Pl, it can be similarly proven that (E.Q.8) (E.Q.9)

Summing up equations (E.Q.7), (E.Q.8), and (E.Q.9) yields u l, 1 > ( u i, 1 2+ u j, 1 2 + u k, 1 2) / 4 + u i, 1 . Since u i, 1 > (21/2-1), u j, 1 > (21/2-1), and u k, 1 > (21/2-1) according to Lemma 5.5, u l 1 > 3(21/2-1)2 / 4 + (21/2-1) = 0.5429 > 2(21/3-1). This results in a contradiction to the assumption that n ∑ x l= 1 ul, x < 2(21/3-1). Q.E.D. Let N be the number of processors required to feasibly schedule a set of tasks by the RMBF Algorithm, and N 0 the minimum number of processors required to feasibly schedule the same set of tasks. Then lim N ? N0 ≤ 2 + ( 3 ? 2 3 ? 2 ) ? a N0 → ∞ ≈ 2.33, where a = 2 ( 2 1 ? 3 ? 1 ) . In order to prove the above bound, we define a function that maps the utilization of tasks into the real interval [0, 1] as it is done in the previous section. The function is the same as the one used for RMFF Algorithm. For a processor Pj, its deficiency δj and its coarseness αj are similarly defined as those for RMFF Algorithm. Also note that Lemma 4.6, Lemma 4.7, and Lemma 4.8 also hold for those processors of Type (II) in the RMBF schedule. The following lemma is also true. Lemma 5.8: If a processor is assigned a number of tasks τ 1, τ 2, …, τ m , with utilizations u 1, u 2, …, u m , then ∑ m f ( u i ) ≤ 1 ? a , where a = 2 ( 2 1 ? 3 ? 1 ) . i=1 Proof of Theorem 5.1: Let Σ = { τ 1, τ 2, …, τ m } be a set of m tasks, with their utilizations m u 1, u 2, …, u m respectively, and ? = ∑ i f ( u i ) . By Lemma 5.8, ? ≤ N0 / a, where a = =1 1?3 2 (2 ? 1) . Theorem 5.1:

- 20 -

Suppose that among the N number of processors used by RMBF Algorithm to schedule a given set Σ of tasks, M1 of them belongs to processors of Type (I). Since all processors of Type (I) must be assigned at least two tasks, there exists for each processor at least an number m with m ≥ 2 such that the mth task is a Type (I) task. For all the processors of Type (I) on each of which the mth task is a Type (I) task with m ≥ 3, ∑ j f ( u j ) > 1 since ∑ j u j > 2(21/3 - 1) according to Lemma 5.6. 2(21/3 When m = 2, there are at most three of them, each of which has a total utilization less than - 1). Therefore, for all the processors of Type (I), there are at most three processors whose ∑ j f ( uj ) is less than 1 in the RMBF schedule.

Now let L = n1 + n2 + n3 be defined similarly as in Section IV, except that they are for processors of Type (II). All the results derived in Section IV are applicable to the set of Type (II) processors in the RMBF schedule Now we are ready to find out the relationship between N and N0.

? = ∑m f ( u i ) ≥ (N - L - 3) + n1 (21/2 - 1) / a + n3 - 4 / 3 i=1

= N - n1 - n2 - n3 + n1 (21/2 - 1) / a + n3 - 13 / 3

≥ N - 2N0(1 - (21/2 - 1) / a) - n2 - 13 / 3, where a = 2 ( 2 1 ? 3 ? 1 ) .

Since ? ≤ N0 / a, N0 / a ≥ N - 2N0(1 - (21/2 - 1) / a) - n2 - 13 / 3 Therefore, N / N0 ≤ (2a + 1 - 2(21/2 - 1)) / a + 16/(3N0).

N0 → ∞

lim N ? N0 ≤ (2a + 1 - 2(21/2 - 1)) / a ≈ 2.33. Q.E.D.

Theorem 5.2: Let N be the number of processors required to feasibly schedule a set of tasks by RMBF Algorithm, and N 0 the minimum number of processors required to feasibly schedule the same set of tasks. Then lim N ? N0 ≥ 2.3 . N →∞ Proof: The proof of Theorem 4.2 is applicable to the proof 0of this theorem. Q.E.D.

VI. Concluding Remarks

In this paper, we are motivated by the increasingly important role played by the rate-monotonic algorithm in designing predictable real-time systems. The problem of scheduling a set of periodic tasks on a multiprocessor using a fixed priority assignment scheme is studied, and the performance of the first two scheduling heuristics used to solve the problem is revisited. The worst-case performance of these algorithms is studied since task deadlines in a hard real-time system have to be guaranteed even in the worst cases. The worst-case performance bounds are tightened up to be 2.33 for RMFF and 2.67 for RMNF. A new scheduling algorithm ? RMBF was

- 21 -

proposed as an alternative to RMFF, and it also has a tight worst-case bound of 2.33. The analytic results presented here are the few ones on scheduling periodic tasks on multiprocessors. Since these three algorithms require that tasks are ordered according to their non-decreasing periods, they are static algorithms. These algorithms obviously are not applicable in situations where the scheduling decisions have to be made dynamically, since the period of an incoming task may be shorter than some of the tasks already assigned to some processors. Therefore, dynamic algorithms need to be developed. We are currently investigating the performance of several dynamic algorithms.

Appendix

Before we prove Lemma 4.3, we need to prove the following lemma. Lemma 4.9: If tasks are assigned to the processors according to the RMFF Algorithm, among all processors to each of which one task is assigned, there is at most one processor for which the utilization factor of the task is less than or equal to (21/2-1). Proof: This lemma is proven by contradiction. The contrary is supposed to be true, i.e., there are at least two processors, each of which has utilization less than or equal to (21/2-1). Let τ j be the task with utilization equal to u j , that is assigned to processor Pj, and τ k be the task with utilization equal to u k , that is assigned to processor Pk with j < k, such that u j ≤ (21/2-1) and u k ≤ (21/2-1) Summing up these two inequalities yields u k + u k ≤ 2(21/2-1) This implies that tasks τ j and τ k are assigned on a single processor, which is a contradiction to the assumption. Q.E.D. Lemma 4.3: If tasks are assigned to the processors according to the RMFF Algorithm, among all processors to each of which n ≥ 1 tasks are assigned, there is at most one processor for which the utilization factor of the set of the n tasks is less than n(21/(n+1)-1). 1 ? ( n + 1) lim n ( 2 ? 1 ) = ln 2

n→∞

Proof: This lemma holds when n is equal to 1or 2 according to Lemma 4.9 and Lemma 4.2. Now suppose that the lemma holds for n ≤ k. The lemma is proven to be true for n = k + 1 by contradiction. Let n = k + 1, and Pi and Pj with i < j be the two processors on each of which exactly n tasks are assigned, such that the total utilization of the n tasks on each processor satisfies

+1 u < (k + 1)(21/(k+2)-1) ∑k m = 1 i, m

(E.Q.10)

and

- 22 -

+1 u < (k + 1)(21/(k+2)-1). ∑k m = 1 j, m

(E.Q.11)

respectively, where ui,m denotes the utilization of the mth task assigned on processor i. Since processors Pi and Pj are each assigned n = k + 1 tasks, we must have ui,k+1 ≤ 2(1 + ∑ k u /k)-k - 1 m = 1 i, m and uj,k+1 ≤ 2(1 + ∑ k u /k)-k - 1 m = 1 j, m

+1 +1 Assume that ?i = ∑ k u and ?j = ∑ k u . Among the n tasks which are m = 1 i, m m = 1 j, m assigned to processor Pj, task τj, x is the first task that is assigned to processor Pj immediately after task τi, k+1 was assigned to processor Pi, 1 ≤ x ≤ k+1. We will consider the boundary condition where task τj, k+1 is assigned to processor Pj before task τi, k+1 is assigned to processor Pi. Case 1: 1 ≤ x ≤ k+1. For x ≤ z ≤ k+1, since τj, z can not be scheduled on processor Pi even after τi, k+1 has been scheduled on Pi, we must have uj, z > 2(1 + ?i/(k+1))-(k+1) - 1 +1 Since ?i = ∑ k u < (k + 1)(21/(k+2)-1) from equation (E.Q.10), m = 1 i, m uj, z > 2(1 + 21/(k+2)-1)-(k+1) - 1 = 21/(k+2)- 1. For 1 ≤ z < x, since τj, z can not be scheduled on processor Pi before τi, k+1 is scheduled on Pi, we must have y uj, z > 2(1 + ?iy/y)-y - 1, for some y ≤ k and ?iy = ∑ m u . = 1 i, m +1 i -y i -(k+1) Since 2(1 + ? y/y) - 1 ≥ 2(1 + ? k+1/(k+1)) - 1, and ?i = ∑ k u < (k + 1)(21/ m = 1 i, m (k+2)-1) from equation (E.Q.10), uj, z > 21/(k+2)- 1 ?1 +1 ?j = ∑ x u + ∑k u > (k+1)(21/(k+2)-1), m = 1 j, m m = x j, m which is a contradiction to equation (E.Q.11). Case 2: The boundary condition where task τj, k+1 is assigned to processor Pj before task τi, k+1 is assigned to processor Pi. For 1 ≤ z ≤ k+1, since τj, z can not be scheduled on processor Pi before τi, k+1 is scheduled on Pi, we must have y uj, z > 2(1 + ?iy/y)-y - 1, for some y ≤ k and ?iy = ∑ m u . = 1 i, m +1 Since 2(1 + ?iy/y)-y - 1 ≥ 2(1 + ?ik+1/(k+1))-(k+1) - 1, and ?i = ∑ k u < (k + 1)(21/ m = 1 i, m (k+2)-1) from equation (E.Q.10), uj, z > 21/(k+2)- 1 +1 ?j = ∑ k u > (k+1)(21/(k+2)-1), m = 1 j, m which is a contradiction to equation (E.Q.11). Q.E.D.

Lemma 5.6: In the completed RMBF schedule, if the mth task on any of the Type (I) processors has Type (I) property, where m ≥ 3, then the total utilization of the first (m-1) tasks on that processor is greater than (m-1)(21/m-1). Proof: Let τ k, 1, τ k, 2, …, τ k, m ? 1 be the tasks that were assigned a processor Pk of Type (I), and

- 23 -

Py, with y < k, is one of the processors on which τ m could have been scheduled, but ?ny ? ( m ? 1) ny m?1 ) ? ( m ? 1 ) ) 2 (1 + (∑l u 1 < 2 1 u ( + ( ) ? n ) ∑ l = 1 y, l y - 1, where ny is the = 1 k, l number of tasks assigned to processor Py, and where u x, l is the utilization of task τ x, l on processor Px. ?ny n Since u k, i > 2 ( 1 + ( ∑ l y= 1 u y, l ) ? n y ) - 1 (note that this is true even though τ k, i is assigned to processor Pk before some of tasks among the n y tasks are assigned to processor Py), ?ny ? ( m ? 1) ny m?1 for 1 ≤ i ≤ m-1, u k, i > 2 ( 1 + ( ∑ l = 1 u y, l ) ? n y ) - 1 > 2 ( 1 + ( ∑ l u ) ? ( m ? 1) ) = 1 k, l - 1. Summing up these (m - 1) inequalities yields ? ( m ? 1) - (m - 1). ∑ jm=?11 uk, j > 2(m - 1) ( 1 + ( ∑ lm=?11 uk, l ) ? ( m ? 1 ) ) Solving the above equation yields ∑ jm=?11 uk, j > (m-1)(21/m-1). Q.E.D.

References

[1] [2] E.G. COFFMAN, JR. (ED.), Computer and Job Shop Scheduling Theory, New York: Wiley, 1975. E.G. COFFMAN, JR., M.R. GAREY, AND D.S. JOHNSON, “Approximate Algorithms for Bin Packing - An Updated Survey,” In Algorithm Design for Computer System Design, pp. 49106, G. AUSIELLO, M. LUCERTINIT, and P. SERAFINI (Eds), Springer-Verlag, New York, 1985. S. DAVARI AND S.K. DHALL, “An On Line Algorithm for Real-Time Tasks Allocation,” IEEE Real-Time Systems Symposium, 194-200 (1986). S. DAVARI AND S.K. DHALL, “On a Periodic Real-Time Task Allocation Problem,” Proc. of 19th Annual International Conference on System Sciences, 133-141 (1986). S.K. DHALL AND C.L. LIU, “On a Real-Time Scheduling Problem,” Operations Research 26, 127-140 (1978). M.R. GAREY AND D.S. JOHNSON, Computers and Intractability: A Guide to the Theory of NP-completeness, W.H. Freeman and Company, NY, 1978. D.S. JOHNSON, Near-Optimal Bin Packing Algorithms, Doctoral Thesis, MIT, 1973 J. LEHOCZKY, L. SHA, AND Y. DING, “The Rate Monotonic Scheduling Algorithm: Exact Characterization and Average Case Behavior,” IEEE Real-Time Symposium, 166-171 (1989). J.P. LEHOCZKY, L. SHA, AND J.K. STROSNIDER. “Enhanced Aperiodic Responsiveness in Hard Real-time Environments,” IEEE Real-Time Systems Symposium, 261-270 (1987).

[3] [4] [5] [6] [7] [8]

[9]

[10] J.P. LEHOCZKY AND S. RAMOS-THUEL. “An Optimal ALgorithm for Scheduling Soft-Aperiodic Tasks in Fixed-Priority Preemptive Systems,” IEEE Real-Time Systems Symposium, 110-123 (1992). [11] J.Y.T. LEUNG AND J. WHITEHEAD. “On the Complexity of Fixed-Priority Scheduling of

- 24 -

Periodic, Real-Time Tasks,” Performance Evaluation 2, 237-250 (1982). [12] C.L. LIU AND J. LAYLAND, “Scheduling Algorithms for Multiprogramming in a Hard RealTime Environment,” J. Assoc. Comput. Machinery 10(1), 174-189 (1973). [13] J.W.S. LIU, K.-J. LIN, AND S. NATARAJAN. “Scheduling Real-time, Periodic Jobs Using Imprecise Results,” IEEE Real-Time Systems Symposium, 252-260 (1987). [14] J.W.S. LIU, K.-J. LIN, W.K. SHIH, A.C. YU, J.Y. CHUNG AND W. ZHAO. “Algorithms for Scheduling Imprecise Computations,” Computer, 58-68 (May 1991). [15] K. RAMAMRITHAM. “Allocation and Scheduling of Complex Periodic Tasks,” International Conference on Distributed Computing Systems, May 1990. [16] S. RAMOS-THUEL AND J.K. STROSNIDER. “The Transient Server Approach to Scheduling Time-Critical Recovery Operations,” IEEE Real-Time Systems Symposium, 286-295 (1991). [17] P. SERLIN, “Scheduling of Time Critical Processes,” Proceedings of the Spring Joint Computers Conference 40, 925-932 (1972). [18] L. SHA, J.P. LEHOCZKY, AND R. RAJKUMAR. “Solutions for Some Practical Problems in Prioritized Preemptive Scheduling,” IEEE Real-Time Systems Symposium, 181-191 (1986). [19] L. SHA, R. RAJKUMAR, J.P. LEHOCZKY, AND K. RAMAMRITHAM. “Mode Change Protocols for Priority-Driven Preemptive Scheduling,” Journal of Real-Time Systems 1(3), 244-264 (1989) [20] L. SHA, R. RAJKUMAR, AND J.P. LEHOCZKY. “Priority Inheritance Protocols: An Approach to Real-Time Synchronization,” IEEE Transactions on Computers 39(9), 1175-1185 (1990). [21] W-K. SHIH, J.W.S. LIU, AND J-Y CHUNG. “Fast Algorithms for Scheduling Imprecise Computations,” IEEE Real-Time Systems Symposium, 12-19 (1989). [22] B. SPRUNT, L. SHA, AND J.P. LEHOCZKY. “Aperiodic Task Scheduling for Hard Real-time Systems,” Journal of Real-Time Systems 1, 27-60 (1989). [23] K.W. TINDELL, A. BURNS, AND A.J. WELLINGS. “Mode Change in Priority Pre-emptively Scheduled Systems,” IEEE Real-Time Systems Symposium, 100-109 (1992).

- 25 -