A PTAS for Static Priority Real-Time Scheduling with Resource Augmentation

Similar documents
A PTAS for Static Priority Real-Time Scheduling with Resource Augmentation

An Average-Case Analysis for Rate-Monotonic Multiprocessor Real-time Scheduling

A Robust APTAS for the Classical Bin Packing Problem

A robust APTAS for the classical bin packing problem

Real-time scheduling of sporadic task systems when the number of distinct task types is small

Scheduling Parallel Jobs with Linear Speedup

Rate-monotonic scheduling on uniform multiprocessors

Task assignment in heterogeneous multiprocessor platforms

Scheduling Algorithms for Multiprogramming in a Hard Realtime Environment

Schedulability analysis of global Deadline-Monotonic scheduling

Multiprocessor Scheduling I: Partitioned Scheduling. LS 12, TU Dortmund

Machine Minimization for Scheduling Jobs with Interval Constraints

APTAS for Bin Packing

On Two Class-Constrained Versions of the Multiple Knapsack Problem

8 Knapsack Problem 8.1 (Knapsack)

Schedulability of Periodic and Sporadic Task Sets on Uniprocessor Systems

RUN-TIME EFFICIENT FEASIBILITY ANALYSIS OF UNI-PROCESSOR SYSTEMS WITH STATIC PRIORITIES

This means that we can assume each list ) is

A polynomial-time approximation scheme for the two-machine flow shop scheduling problem with an availability constraint

Polynomial Time Algorithms for Minimum Energy Scheduling

A lower bound for scheduling of unit jobs with immediate decision on parallel machines

The Partitioned Dynamic-priority Scheduling of Sporadic Task Systems

On-line Bin-Stretching. Yossi Azar y Oded Regev z. Abstract. We are given a sequence of items that can be packed into m unit size bins.

Algorithms. Outline! Approximation Algorithms. The class APX. The intelligence behind the hardware. ! Based on

Machine scheduling with resource dependent processing times

Optimal Utilization Bounds for the Fixed-priority Scheduling of Periodic Task Systems on Identical Multiprocessors. Sanjoy K.

Real-Time Systems. Lecture #14. Risat Pathan. Department of Computer Science and Engineering Chalmers University of Technology

Single processor scheduling with time restrictions

Partitioned scheduling of sporadic task systems: an ILP-based approach

Bin packing and scheduling

A New Task Model and Utilization Bound for Uniform Multiprocessors

EDF and RM Multiprocessor Scheduling Algorithms: Survey and Performance Evaluation

Improved Bounds for Flow Shop Scheduling

Non-preemptive multiprocessor scheduling of strict periodic systems with precedence constraints

Single processor scheduling with time restrictions

Multiprocessor Scheduling of Age Constraint Processes

arxiv: v1 [cs.os] 21 May 2008

Scheduling periodic tasks in a hard real-time environment

Multiprocessor Scheduling II: Global Scheduling. LS 12, TU Dortmund

Static-Priority Scheduling. CSCE 990: Real-Time Systems. Steve Goddard. Static-priority Scheduling

Complexity of Uniprocessor Scheduling Analysis

CS264: Beyond Worst-Case Analysis Lecture #18: Smoothed Complexity and Pseudopolynomial-Time Algorithms

Santa Claus Schedules Jobs on Unrelated Machines

AS computer hardware technology advances, both

CS264: Beyond Worst-Case Analysis Lecture #15: Smoothed Complexity and Pseudopolynomial-Time Algorithms

Multiprocessor jobs, preemptive schedules, and one-competitive online algorithms

A Note on Modeling Self-Suspending Time as Blocking Time in Real-Time Systems

ALTERNATIVE PERSPECTIVES FOR SOLVING COMBINATORIAL OPTIMIZATION PROBLEMS

arxiv: v1 [cs.os] 6 Jun 2013

Multiprocessor EDF and Deadline Monotonic Schedulability Analysis

Combinatorial Algorithms for Minimizing the Weighted Sum of Completion Times on a Single Machine

On the Impossibility of Black-Box Truthfulness Without Priors

Single Machine Scheduling with a Non-renewable Financial Resource

Non-Preemptive and Limited Preemptive Scheduling. LS 12, TU Dortmund

Approximation Schemes for Parallel Machine Scheduling Problems with Controllable Processing Times

Predictability of Least Laxity First Scheduling Algorithm on Multiprocessor Real-Time Systems

Real-Time and Embedded Systems (M) Lecture 5

Lecture 6,7 (Sept 27 and 29, 2011 ): Bin Packing, MAX-SAT

Single machine scheduling with forbidden start times

Complexity analysis of the discrete sequential search problem with group activities

The Partitioned Scheduling of Sporadic Tasks According to Static-Priorities

Scheduling Periodic Real-Time Tasks on Uniprocessor Systems. LS 12, TU Dortmund

Preemptive Scheduling of Independent Jobs on Identical Parallel Machines Subject to Migration Delays

Load Regulating Algorithm for Static-Priority Task Scheduling on Multiprocessors

Now just show p k+1 small vs opt. Some machine gets k=m jobs of size at least p k+1 Can also think of it as a family of (1 + )-approximation algorithm

the currently active 1 job whose deadline parameter is the smallest, is an optimal scheduling algorithm in the sense that if a system can be scheduled

Minimizing Mean Flowtime and Makespan on Master-Slave Systems

SPT is Optimally Competitive for Uniprocessor Flow

Deciding Emptiness of the Gomory-Chvátal Closure is NP-Complete, Even for a Rational Polyhedron Containing No Integer Point

2 Martin Skutella modeled by machine-dependent release dates r i 0 which denote the earliest point in time when ob may be processed on machine i. Toge

Bounding the End-to-End Response Times of Tasks in a Distributed. Real-Time System Using the Direct Synchronization Protocol.

Multi-Operation Multi-Machine Scheduling

Matchings in hypergraphs of large minimum degree

Randomized algorithm

Multiprocessor feasibility analysis of recurrent task systems with specified processor affinities

The Feasibility Analysis of Multiprocessor Real-Time Systems

CS6999 Probabilistic Methods in Integer Programming Randomized Rounding Andrew D. Smith April 2003

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

1 Ordinary Load Balancing

Static priority scheduling

Semi-Partitioned Fixed-Priority Scheduling on Multiprocessors

Approximation Schemes for Scheduling on Parallel Machines

BIN PACKING IN MULTIPLE DIMENSIONS: INAPPROXIMABILITY RESULTS AND APPROXIMATION SCHEMES

VOL. VOL NO. ISSUE NEAR-FEASIBLE STABLE MATCHINGS WITH COUPLES 19. Online Appendix. Near-Feasible Stable Matching with Couples

Non-preemptive Fixed Priority Scheduling of Hard Real-Time Periodic Tasks

Embedded Systems 15. REVIEW: Aperiodic scheduling. C i J i 0 a i s i f i d i

Topics in Theoretical Computer Science April 08, Lecture 8

The Maximum Flow Problem with Disjunctive Constraints

An Optimal Real-Time Scheduling Algorithm for Multiprocessors

Colored Bin Packing: Online Algorithms and Lower Bounds

On the Soft Real-Time Optimality of Global EDF on Uniform Multiprocessors

Lecture 5: Efficient PAC Learning. 1 Consistent Learning: a Bound on Sample Complexity

Online Interval Coloring and Variants

Online Scheduling of Parallel Jobs on Two Machines is 2-Competitive

Lecture 5: January 30

Minimizing total weighted tardiness on a single machine with release dates and equal-length jobs

Computers and Intractability. The Bandersnatch problem. The Bandersnatch problem. The Bandersnatch problem. A Guide to the Theory of NP-Completeness

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas February 11, 2014

CMSC 451: Lecture 7 Greedy Algorithms for Scheduling Tuesday, Sep 19, 2017

Algorithm Design. Scheduling Algorithms. Part 2. Parallel machines. Open-shop Scheduling. Job-shop Scheduling.

Transcription:

A PAS for Static Priority Real-ime Scheduling with Resource Augmentation echnical Report Friedrich Eisenbrand and homas Rothvoß Institute of Mathematics EPFL, Lausanne, Switzerland {friedrich.eisenbrand,thomas.rothvoss}@epfl.ch Abstract We present a polynomial time approximation scheme for the real-time scheduling problem with fixed priorities when resource augmentation is allowed. For a fixed ε>0, our algorithm computes an assignment using at most (1+ε) OP +1 processors in polynomial time, which is feasible if the processors have speed 1+ε. We also show that, unless P = N P, there does not exist an asymptotic FPAS for this problem. 1 Introduction In this paper, we are concerned with a scheduling problem described by Liu and Layland [11], which has received considerable attention in the real-time and embedded-systems community. Here one is given a set of tasks = { 1,..., n }, where each task is characterized by two positive values, its period p( ) and its running time c( ). he task releases a job requiring running time c( ) at each integer multiple of its period. A preliminary version of this paper is published at ICALP 2008 Supported by Deutsche Forschungsgemeinschaft (DFG) within Priority Programme 1307 "Algorithm Engineering" 1

c( 1 )=1 p( 1 )=2 0 1 2 3 4 5 6 7 8 9 10 c( 2 )=2 p( 2 )=5 If several tasks are assigned to one processor, then this assignment is feasible if each job, being released by some task at time i p( ) is finished at time (i + 1) p( ), whereby jobs stemming from tasks with smaller period preempt those stemming from tasks with larger period. ies are broken in an arbitrary but fixed way. In this case, we also speak about an assignment in which each task is feasible itself. Liu and Layland [11] have shown that this rate-monotonic scheduling is optimal, meaning if there is a feasible priority assignment, then the one in which the priority of a task equals 1/p( ) is also feasible. he picture above shows a feasible set = { 1, 2 } of tasks. he arrows indicate the points in time, where the two tasks 1 and 2 release jobs. At time 0, the first job of 1 as well as the first job of 2 are released. Since the period of 1 is smaller than the period of 2, the first job of 1 is executed, until it is finished at time 1. Now the first job of 2 is executed, but interrupted by the second job of 1 at time 2. he execution of the first job of 2 is resumed at time 3 and finished at time 4. Notice that the processor is idle for one time unit at time 9 and that the schedule repeats at the least common multiple of the periods which is 10. All jobs finish in time. he set is feasible. he static-priority real-time scheduling problem is now to determine a partitioning of a task-set into 1,..., k, such that each i is a feasible set of tasks for one processor and the number k of processors is minimized. In the real-time literature, this problem is also known as the static-priority real-time scheduling problem with implicit deadlines, since the deadlines are implicitly given by the periods of the tasks. Related work If the periods p( ) of all tasks in are one, then the scheduling problem is simply the well known bin packing problem. his is because a set of tasks would be feasible on one processor if and only if the sum of their running times is bounded by one. Recall that for bin packing an asymptotic PAS [4] and even an asymptotic FPAS exists [8]. he utilization of is defined as util( ) = c( )/p( ). If is feasible, then the utilization util( ) is at most 1. However, can be infeasible, even if util( ) < 1. Consider, for example, again the task system depicted on the cover page. If we increase the running time of 1 by any ε>0, then the set is no longer feasible and its utilization 2

is util( )=(9+5 ε)/10. Liu and Layland [11] have shown that is feasible, if util( ) is bounded by n (2 1/n 1), where n =. his bound tends to ln2 and the condition is not necessary for feasibility, as the example with all periods equal to one shows. Stronger, but still not necessary conditions for feasibility are given in [10, 2, 12]. It is a longstanding open problem, whether there exists a polynomial time algorithm which decides whether a set of tasks is feasible on one processor. A first result in this direction using resource augmentation was presented by Fisher and Baruah [5]. In their paper, the authors show that one can efficiently decide whether a set of tasks is feasible, or infeasible on a faster processor of speed 1+ε. Our approximation scheme can be understood as an extension of their algorithm, which additionally approximates the task-distribution problem. he sufficient condition util( ) n (2 1/n 1) allows to use first-fit and next-fit algorithms as in the case of bin packing. he currently best ratio for such strategies is 7/4 due to [10]. We refer to [3] for a survey of approximation algorithms based on first-fit and nextfit and to the article [1] for an overview on complexity issues of real-time scheduling. he literature on approximation schemes, especially in scheduling, is extensive. We refer to [13] for a recent account. Results We show that, for each ε > 0 there exists a polynomial time algorithm which computes a partitioning using at most (1+ε) OP ( )+1 subsets. Each subset is feasible on a processor of speed 1+ε. Here OP ( ) denotes the minimum number of processors to feasibly schedule. Our result is the first PAS for the real-time scheduling problem with resource augmentation. Furthermore we show that real-time scheduling is harder to approximate than bin packing. Unless P = N P, there does not exist an algorithm which has an additive gap of O(n 1 ε ) for any fixed ε>0. his implies that there does not exist an asymptotic FPAS for real-time scheduling without resource augmentation. he main insights which lead to our PAS with resource augmentation are twofold. i) Apart from the standard rounding of the instance, we describe the concept of local feasibility. he effect of far-scattered periods prevents the application of bin packing techniques. he concept of local feasibility considers these effects only for those tasks, whose periods are close or local to the period of the task in consideration. A local feasible schedule is feasible on a slightly faster machine. ii) In bin packing, small items are first discarded from the instance and then distributed with first-fit. Since the utilization is not a good lower bound for the real-time scheduling problem, a similar approach does not work. We provide a much different technique to treat small tasks. We re-set periods and group small tasks with the same period into one large task. A probabilistic argument shows that the optimum of the modified instance does not grow to much. 3

2 Preliminaries and simplifying assumptions In [11] it is shown that a set of tasks is feasible on one processor, if the first job of each task finishes before its period p( ), or in other words, if the response time of each task is smaller than its period. his response time r of a task is calculated as follows. A task with higher priority interrupts exactly r /p( ) many times. Each time, this task consumes its processing time c( ). herefore r is the smallest fix-point of the response function f (r )=c( )+ \{ }:p( ) p( ) r /p( ) c( ). (1) he task system is feasible if there exists for each a number r p( ) with f (r ) r. Notice that one has for each a N >0 f (a r ) a f (r ). his shows that the task system is feasible if and only if there exists an r for each with p( )/2 r p( ) and f (r ) r. he vector r = (r 1,...,r n ) is a certificate of feasibility of the task-system = { 1,..., n }. Similarly, we say that the task-system is feasible on a processor of speed β>0 if there exists a vector r = (r 1,...,r n ) with p( )/2 r p( ) and f (r ) β r. he next Lemma will be used several times in the sequel. Lemma 1. Let be a set of tasks, then the following holds. i) If util( ) γ with γ > 0, then is feasible on a processor of speed (1/ ln(2)) γ. ii) util( ) OP ( ) (2/ln(2)) util( )+1. iii) If is feasible on a processor of speed β and a second set has utilization at most ε, then is feasible on a processor of speed β+2ε. Proof. If the utilization of a set of tasks is bounded by n (2 1/n 1), then it is feasible on a processor of speed one [11]. he claim i) is merely a reformulation of this fact. ogether with i) one can now analyze a first-fit approach to the scheduling problem and ii) is the outcome of such an analysis. o prove iii) we can assume that a single task with util( ) = ε is added to the task system. We first check the feasibility of a task. Let r be the certificate of feasibility of before was added. hen f (r ) β r and p( )/2 r p( ). Let f be the new response function of after is added to. We have to show that f (r ) (β+2ε) r holds. If p( ) > p( ), then this clearly holds. herefore we suppose that p( ) p( ). Clearly f (r ) f (r )= r /p( ) c( ). (2) Since r (1/2) p( ) we can conclude that r /p( ) 2 r /p( ). his implies that (2) is bounded by 2 r ε and thus that f (r ) (β+2ε) r holds. 4

It remains to show, that itself is feasible on a processor of speed β+2 ε. o this end, we insert a dummy task with running time 0 and period p( ) whose priority shall immediately follow the priority of. he task is feasible on a processor of speed β+2 ε if and only if is feasible on a processor of speed β+2 ε, which follows from the previous discussion. 2.0.1 Simplifying assumptions he number 1/ε can be assumed to be an integer. Furthermore, we round each period up to the next power of (1+ε). If a solution of this rounded instance is feasible, then it is also feasible for the original instance on a processor of speed (1+ε). Next, choose k {0,...,(1/ε) 1} such that the utilization u k of tasks, having their period in an interval [(1/ε) i,(1/ε) i+1 [ with i k (mod 1/ε), is minimized. Clearly u k ε util( ). hus we may remove all tasks, contributing to u k and schedule them in a first-fit manner on (2/ ln 2) OP +1 additional processors, using Lemma 1.ii). his process yields a partitioning of the tasks into blocks B 1,...,B µ with the following properties. i) If p i and p j are periods of tasks in B i and B j with i < j, then (1/ε) p i p j. ii) he number of different periods of tasks in one block B i is bounded by ((1/ε) 1) log 1+ε (1/ε) 1/ε 3 which is a constant. 3 Real-ime scheduling is harder than bin packing Due to its relation to bin packing, a natural question to ask at this point is whether realtime scheduling can be approximated as well as bin packing. he algorithm of Karmarkar and Karp [8] computes a solution to the bin packing problem in polynomial time, which has an additive approximation guarantee. More precisely, given an instance I the algorithm computes a solution AP X (I ) with AP X (I ) OP (I ) O(log 2 (OP (I )). An analogous result cannot hold for real-time scheduling unless P = N P. heorem 2. If P N P, there is no ε>0 such that there exists a polynomial algorithm which computes an approximate solution AP X ( ) for each instance with AP X ( ) OP ( ) 1 ε. Proof. he proof of this theorem is by reduction from 3-PARIION. An instance of 3-PARIION is a multiset of 3 n numbers a 1,..., a 3n R +. he problem is to decide, whether this set can be partitioned into triples, such that the sum of the numbers of each triple is exactly one. 3-PARIION is strongly NP-complete see [6]. he idea is now to construct a set of tasks = 1 k such that the following holds. a) All tasks in j have the same period and j consists of 3n tasks with utilization a 1,...a 3n respectively. 5

b) If a subset contains 3 tasks and the periods of the tasks in are not all equal, then is infeasible. With such a construction at hand one needs k n processors if 3-PARIION has a solution while one needs at least n k+ k/2 processors if 3-PARIION does not have a solution. If there exists an algorithm which computes a solution AP X ( ) with AP X ( ) OP ( ) (3 k n) 1 ε for some ε>0, then one could use it to test whether 3-PARIION has a solution, since (3 k n) 1 ε < k/2 for k =Ω(n 1/ε ). What remains to show, is how to construct such an instance = 1 k as above. If we define new weights a i = m/3+a i m+1, then this new instance of 3-PARIION is equivalent to a 1,..., a 3n, since three new weights sum up to one if and only if the corresponding old weights sum up to one. his shows that we can assume that the weights a 1,..., a 3n are between 1/3 1/m and 1/3+1/m for an arbitrary m Z +. Next we consider the periods p j = 1+ j /(4 k) for j = 1,...,k. hose periods are between 1+1/(4 k) and 1+1/4. he group j consists now of tasks having period p j and utilization a 1,..., a 3n respectively, which implies a). o show b), consider a set = { 1, 2, 3 } of three tasks, where the period of 3 is strictly larger than the period of 1. We argue that 3 is infeasible, if is scheduled on one processor. Consider a fix-point r of the response function of 3 r = c( 3 )+ r p( 1 ) c( 1 )+ r p( 2 ) c( 2 ). (3) Since c( 3 )=util( 3 ) p( 3 ) one has r c( 3 )/(1 util{ 1, 2 }) which implies that r p( 3 )(1 9/(m+6)). Notice that p( 3 ) p( 1 )+1/(4k), thus p( 3 )/p( 1 ) 1+1/(4k p( 1 )) 1+1/(5k). r If one chooses m = 90k, then r /p( 1 )>1 and it follows that p( 1 ) in (3) is at least 2. his means that r c( 3 )+2c( 1 )+c( 2 ) 4(1/3 1/m) which is larger than 5/4 p( 3 ). his implies that 3 is infeasible. Corollary 3. Unless P = N P, there does not exist an asymptotic FPAS for real-time scheduling. Proof. An asymptotic FPAS [7] is an algorithm, whose running time is polynomial in n and 1/ε and which yields a solution of cost at most (1+ε) OP + p(1/ε) for some polynomial p. Assume that such an asymptotic FPAS exists. We assume w.l.o.g. that p(1/ε)=ε α for a fixed exponent α>0. hen with ε=(1/n) 1/(2α) the algorithm computes a solution with AP X OP ε OP + (1/ε) α n 1 1/(2α) + n 1/2, which is a contradiction to heorem 2. 6

4 Local feasibility and an algorithm to schedule large tasks Consider the response function (1) for a task. For local feasibility of, the tasks with p( ) ε p( ) contribute only with their utilization to the response function and the rounding operation in (1) is ignored. hus the local response function is defined as f local (r )=c( )+r util ( { : p( ) ε p( )} ) + \{ } ε p( )<p( ) p( ) r /p( ) c( ). he task is local feasible, if there exists a number p( )/2 r local p( ) with f (r ) r. In other words, the contribution of the rounding operation is only taken into account for tasks which are close or local to the task in consideration. he other tasks contribute only with their utilization. We now show that, if an assignment is locally feasible (each task is locally feasible), then it is feasible on processors of speed 1+2ε. We can therefore relax feasibility to local feasibility, which will later allow us to optimally distribute large tasks. Lemma 4. If a set of tasks is local feasible on one processor, then it is feasible on a processor of speed 1 + 2ε. Proof. Let r be the certificate for local feasibility of, i.e., one has p( )/2 r p( ) and f local (r ) r. It is enough to show that f (r local ) (1+2ε)f (r ) holds. he difference between f (r local ) and f (r ) can be bounded by c( ). : p( ) ε p( ) Since 1 2ε r /p( ) this difference is bounded by 2εr c( )/p( ) :p( ) ε p( ) 2ε f local (r ) and the result follows. 4.1 A dynamic program to schedule large tasks We describe now an algorithm which optimally distributes a set of tasks in in polynomial time if we additionally assume that each utilization is bounded from below by the constant ε and an increase of speed by 1+O(ε) is allowed. If we round all running times c( ) down such that the utilization of becomes the nearest integer multiple of ε 2, then due to the reason that each c( )/p( ) is at least ε, a feasible schedule for the new task system yields a feasible assignment for the original task system, if the machines have speed 1+ O(ε). herefore we can also assume that each task has utilization c( )/p( ) ε 2 Z. 7

Let B 1,...,B µ be the block-partitioning of the task system = { 1,..., n } (see section 2.0.1). How many different types of tasks, can be present in one block B i? he number of different periods of B i is bounded by 1/ε 3. he number of different utilization-values of tasks in is bounded by 1/ε 2. herefore, the number of different types of tasks in each block is bounded by a constant. he tasks are distributed with a dynamic programming algorithm to compute an optimal assignment of such that each task is locally feasible. his is done, block-wise. A vector a = (a 0,..., a 1/ε 2) with a i Z is called a configuration, whereby a i denotes the number of processors whose utilization is exactly i ε 2. We require that i a i = n. Consider the following table entries. A(a, l) = 1 if tasks in B 1,...,B l can be scheduled in a locally feasible way such that utilization bounds of configuration a are met 0 otherwise Note that a has fixed dimension, thus the table has a polynomial number of entries. We now describe, how to compute A(a,l) efficiently. Let b= (b 0,...,b 1/ε 2) be a processor configuration from a distribution of the tasks B 1,...,B l 1. hen LocalRS(B l,b, a) is defined to be 1, if the tasks in block B l can be additionally distributed among the processors, such that the bounds of configuration a are met. he base cases are A(a,1)=LocalRS(B 1,(n,0,...,0), a) For all l>1 note that A(a,l)=1 if and only if there exists a b Z 1/ε2 +1 with 0 b i a i for all i and A(b,l 1)=1 and LocalRS(B l,b, a)=1 After computing all entries, the optimal number of processors can be read out of the table. It remains to show, how to determine LocalRS efficiently. he block B l has only a constant number of different task-types, each having a utilization, which is lower-bounded by a constant. Suppose that B l has tasks, whose running-time and period are from the tuples (c 1, p 1 ),...,(c k, p k ). A pattern is a vector (x 1,..., x k ) N k 0 which represents a set of tasks with these types of total utilization at most 1 (the set, defined by the pattern, contains x i times task type (c i, p i )). here is only a constant number of patterns, which can be used to distribute the tasks in B l. his shows that LocalRS can be computed in polynomial time with integer programming in fixed dimension [9]. Details of the model are described in the appendix. We have the following result. heorem 5. Let = { 1,..., n } be a set of tasks and let ε> 0 be a constant such that c( )/p( ) ε for all. hen we can distribute the tasks using OP ( ) many processors in polynomial time, such that the tasks on each processor are feasible if the processors have speed 1+O(ε). 8

5 Small tasks he well known approximation algorithms for bin packing [4, 8] use the fact that small items of weight at most ε can first be discarded from the instance and then be added in a firstfit way after the larger items have been packed. If a new bin had to be opened to pack the small items, then the weight of each bin, except possibly the last bin, exceeds 1 ε. If m bins are then open, then (m 1)(1 ε) is a lower bound on OP (I ) which implies that m (1+2ε)OP (I )+1. For the real-time scheduling problem, an analogous approach to deal with tasks having small utilization does not work. his is again because a subset of tasks might be infeasible, even if its utilization only slightly exceeds ln(2). In this section we describe a tailored procedure to eliminate small tasks. It has two steps. I) In a first step, we discard tasks and re-set periods such that the utilization of each period is at least ε 6. Here, the utilization of a period p is the sum of the utilization of the tasks having period p. he total utilization of the discarded tasks is bounded by O(ε) util( ). II) In a second step we cluster small tasks of the same period into groups, each of which will be identified into one single task having utilization ε 6. After these discards, re-setting of periods and identification of small tasks, we obtain a new instance. If OP denotes the minimum number of processors to feasibly schedule, then can be scheduled using (1+ O(ε)) OP + 1 processors of speed 1+ O(ε). he next sections describe these two steps in detail. Periods with small utilization Let p be a period of a task in. he utilization of this period is the sum of the utilizations of tasks, having period p util(p) = c( )/p. :p( )=p Suppose now that B 1,...,B µ is the partitioning of into blocks and let B i be the first block having utilization ε 2. Let j be minimal such that util(b i B j ) ε 2. If this utilization is larger than ε, then we discard B i,...,b j 1 from. Otherwise, we re-set the period of each task to an arbitrary value sandwiched between the smallest and the largest period of a task in B i B j. hereby the utilization of this period is at least ε 2. We repeat this procedure until such a block B i having utilization ε 2 cannot be found anymore. he utilization of the tasks which are discarded with this procedure is bounded by ε util( ). With first-fit, these tasks can be scheduled on O(ε) OP + 1 additional processors. Define p min ( ) = min{p( ) } and p max ( ) = max{p( ) }. he next lemma shows that re-setting the periods of the tasks in B i B j to an arbitrary period in [p min (B i B j ), p max (B i B j )] is a feasible operation, if we are to run the tasks 9

on machines of speed 1+O(ε). More precisely, the lemma implies that, if the tasks could be scheduled on k machines before the re-setting operation, then they can be scheduled on k machines of speed 1+O(ε) after the re-setting operation. Lemma 6. Suppose that 1 k is a feasible task system with the property that p max ( i ) ε p min ( j ) whenever i < j. Let I {1,...,k} be a set of indices i with util( i ) ε and let be an instance emerging from 1 k by assigning for each i I to each task i an arbitrary period in [p min ( i ), p max ( i )] while keeping the utilization of the tasks invariant. he tasks are feasible on a processor with speed 1+O(ε). Proof. By Lemma 4 it is enough to show that each such changed task is locally feasible on a processor of speed 1+ O(ε). For this purpose, suppose that i and let be the task stemming from by changing its period. Furthermore let be the changed tasks i i. Lemma 1.iii) shows that ( \ i ) is feasible on a processor of speed 1+ O(ε). hus, i after changing the periods in i only, the system is feasible on a processor of speed 1+O(ε). In particular is local feasible on a processor of speed 1+ O(ε). Scaling the periods in the other sets j, j i leaves the local response function for unchanged. his shows the claim. After applying the procedure described above, the situation is now as follows. Each block of the task system has utilization at least ε 2. Choose γ = ε 6 and remove the tasks of all periods having utilization less than γ. Recall that the number of periods in each block is bounded by 1/ε 3, thus we remove a utilization of at most γ/ε 3 = ε 3 from each block. Comparing this to the total utilization of each block, one observes that this removed tasks can be scheduled, using again O(ε) OP + 1 many extra processors. Periods with large utilization Each period has now a utilization of at least γ=ε 6. Next, we partition into large, 1,..., q such that large contains all tasks with utilization at least γ, the tasks in i have the same period p i and γ util( i ) 3 γ. he idea is now to treat the tasks in the sets i with period p i as one single task having period p i and utilization util( i ). By doing so, we lose some flexibility to distribute small tasks. hose belonging to one group must be assigned to the same processor. he next theorem establishes that we do not loose too much in terms of optimality, if we again allow processors of speed 1+O(ε). he theorem is proved by applying a Chernoff-type argument. heorem 7. Let γ = ε 6 and let be a set of tasks which can be partitioned into subsets large, 1,..., q such that the following conditions hold. a) large contains all tasks with utilization at least γ. b) he tasks in i have the same period p i and γ util( i ) 3 γ. 10

If denotes the instance stemming from identifying each set i as one task with period p i and running time i c( ), then for ε 1 3 one can schedule on machines of speed 1+O(ε). (1+O(ε)) OP ( )+1 Proof. We have to show that there exists a solution which uses at most (1+O(ε)) OP ( )+ 1 processors of speed 1+ O(ε), in which the tasks of each i are scheduled together on one processor. o do so, consider an optimal schedule for which uses the processors P 1,...,P k. Clearly, we can identify the tasks S i which are assigned to the same processor P j into one task with period p i and processing time S c( ). herefore, we can assume that each processor contains at most one task from each set i. In the new solution the tasks in each set i are scheduled on one processor. his is done using randomization. If a processor does not contain a task from i, then i will not be assigned to it. Otherwise suppose that i is assigned to the processor P. he probability that all tasks in i are assigned to P will be util( )/util( i ). For a task let E be event that f (r ) exceeds (1+2ε) r. We next show that the probability of E is bounded by ε. his means that the expected utilization of the tasks which exceed their deadline even on the faster processors is bounded by ε util( ). By removing those tasks and by scheduling them on a set of new processors in a first-fit manner, we only require an additional number of at most (2/ln 2) ε OP ( )+1 processors and the result follows. We show this first for a task large. Suppose large is assigned to processor P. Let I {1,..., q} be the set of indices corresponding to the sets i whose tasks i on P have higher priority than. Let large be the set of tasks in large that lie on P and have higher priority than. o bound Pr[E ] we inspect the response function f (r )=c( )+ r p( c( p i r )+r ) r large large i I p i c( i )/p i. Since meets its deadline, there exists a number r with p( )/2 r p( ) and f (r ) r. From this, we can conclude that the number a i = p i r r /p i satisfies 1 a i 2. After randomly redistributing the tasks in 1,..., q the evaluation of the response function at r is a random variable of the form c( )+ r p( c( )+r a i X i ) where the X i {0,util( i )} are independent random variables. For X := a j X j one has E[X ] 1. It is sufficient to show that Pr[X E[x]+ε] ε. his can be done with a variant of the Chernoff bound. Choose i I α := max{a i util( i )} 2 3ε 6 = 6ε 6. i 11

A Chernoff-type argument (see heorem 10 in the appendix) yields, that [ ( Pr[X E[X ]+ε]=pr X 1+ ε ) ] E[X ] e 1 ε 2 6ε 6 3E[X ] 2 E[X ] ε, E[X ] where the last inequality follows from E[X ] 1 and ε 1/3. If i for some i, then the above analysis can be applied after the observation that c( ) grows at most up to 3 γ p( ). his can be bounded by 6 γ r which is bounded by ε r. By combining the treatment of periods with small utilization and periods with large utilization, we obtain the main result of this section. heorem 8. Let be a set of tasks and ε<1/3. here is a polynomial time algorithm which discards a subset with util( ) O(ε) util( ), constructs an instance such that each task of has utilization of at least ε 6 and can be scheduled on (1+ O(ε)) OP ( )+1 processors of speed 1+O(ε). Furthermore, each feasible packing of on k processors of speed 1+O(ε) yields a feasible packing of the original task set on k processors of speed 1+O(ε). Notice that we had to discard tasks of utilization O(ε) util( ) processors three times in this paper. If we collect all discarded tasks and then schedule this tasks once in a first-fit manner, this requires at most O(ε) OP +1 processors. hus by combining heorem 8 with heorem 5, we obtain the main result of this paper. heorem 9. For each ε>0 there exists a polynomial time algorithm, which partitions a set of tasks into 1,..., k such that each i is feasible on a processor of speed 1+O(ε) and k (1+O(ε)) OP + 1. References [1] Sanjoy Baruah and Joël Goossens. Scheduling real-time tasks: Algorithms and complexity. In Joseph Y-. Leung, editor, Handbook of Scheduling Algorithms, Models, and Performance Analysis, chapter 28. Chapman & Hall/CRC, 2004. [2] Sadegh Davari and Sudarshan K. Dhall. On-line algorithms for allocating periodictime-critical tasks on multiprocessor systems. Informatica (Slovenia), 19(1), 1995. [3] Sudarshan K. Dhall. Approximation algorithms for scheduling time-critical jobs on multiprocessor systems. In Joseph Y-. Leung, editor, Handbook of Scheduling Algorithms, Models, and Performance Analysis, chapter 32. Chapman & Hall/CRC, 2004. [4] W. Fernandez de la Vega and G. S. Lueker. Bin packing can be solved within 1+ε in linear time. Combinatorica, 1(4):349 355, 1981. 12

[5] Nathan Fisher and Sanjoy Baruah. A fully polynomial-time approximation scheme for feasibility analysis in static-priority systems with arbitrary relative deadlines. In ECRS 05: Proceedings of the 17th Euromicro Conference on Real-ime Systems (ECRS 05), pages 117 126, Washington, DC, USA, 2005. IEEE Computer Society. [6] M. R. Garey and D. S. Johnson. Computers and Intractability. Freeman, San Francisco, 1979. [7] David S. Johnson. he NP-completeness column: an ongoing guide. J. Algorithms, 13(3):502 524, 1992. [8] Narendra Karmarkar and Richard M. Karp. An efficient approximation scheme for the one-dimensional bin-packing problem. In 23rd annual symposium on foundations of computer science (Chicago, Ill., 1982), pages 312 320. IEEE, New York, 1982. [9] H. W. Lenstra. Integer programming with a fixed number of variables. Mathematics of Operations Research, 8(4):538 548, 1983. [10] Jörg Liebeherr, Almut Burchard, Yingfeng Oh, and Sang H. Son. New strategies for assigning real-time tasks to multiprocessor systems. IEEE rans. Comput., 44(12):1429 1442, 1995. [11] C. L. Liu and James W. Layland. Scheduling algorithms for multiprogramming in a hard-real-time environment. J. ACM, 20(1):46 61, 1973. [12] Yingfeng Oh and Sang H. Son. Allocating fixed-priority periodic tasks on multiprocessor systems. Real-ime Syst., 9(3):207 239, 1995. [13] Petra Schuurman and Gerhard Woeginger. Approximation schemes a tutorial. In R.H. Möhring, C.N. Potts, A.S. Schulz, G.J. Woeginger, and L.A. Wolsey, editors, Lectures on Scheduling. o appear, 2007. [14] M. Mitzenmacher and E. Upfal. Probability and Computing. Cambridge University Press, 2005. 13

Appendix Chernoff bound Given a sum X := X 1 +...+ X n of independent random variables X i {0,1}, it is well known that X is distributed sharply around its mean. More precisely for each µ E[X ] one has Pr[X (1+δ)µ] e δ2 µ/3 for 0<δ<1. A similar result holds for weighted sums, if the weights do not differ too much. heorem 10. Let X 1,..., X n independent random variables with X i {0,b i } for b i > 0. Consider the sum X := a 1 X 1 +...+ a n X n with a i > 0. hen for α := max i {a i b i } and 0<δ<1 one has Pr[X (1+δ)E[X ]] e δ 3α E[X ] Proof. Initially we have Pr[X (1+δ)E[X ]] = Pr[e t X e t (1+δ)E[X ] ] E[e t X ] e t (1+δ)E[X ] whereby we first used monotonicity of f (x)=e t x for all t > 0 and Markov inequality as second. Denote Pr[X i = b i ]=p i. Multiplicativeness of the expectation of independent random variables then gives E[e t X ] = E[e n t a i X i ] (4) = n E[e t a i X i ] = = 1+x e x n (p i e t a i b i + (1 p i )e t a i 0 ) n (1+ p i (e t a i b i 1)) Now choose t = ln((1+δ) 1/α ). hen (4) equals n e p i (e t a i b i 1) n ( ) exp p i ((1+δ) a i b i α 1) (5) Now Bernoulli inequality δ 1 : x [0,1] : (1+δ) x 1+δx can be applied since a i b i α 1. 14

hus (5) can be bounded by n ( exp p i (1+δ a ) i b i α 1) = ( n exp p i δ a ) i b i α n p i a i b i = e δ α = e δ α E[X ] hereby recall that E[X ]= n a i E[X i ]= n a i p i b i. We continue the bound on Pr[X (1+δ)E[X ]] (equation (4)) E[e t X ] e t (1+δ)E[X ] = e δ α E[X ] (1+δ) 1+δ ( α E[X ] ) e δ E[X ]/α (1+δ) 1+δ e δ2 3α E[X ] whereby inequality holds for all 0 δ 1. e δ (1+δ) 1+δ e δ2 /3 comes from an elementary calculus, see, e.g. [14] and he ordinary Chernoff bound is contained as special case for a i = b i = α=1. It is possible to define a i := a i b i and b i := 1. hen X could be assumed to be 0/1-distributed. It is i not difficult to see that this is an equivalent view, since a i X i is either 0 or a i b i, but the same holds for a i X i. he IP-model We are now going to show, how LocalRS(B l,b, a) can be computed for configurations a,b Z 1/ε2 +1. Call tasks different, if either their running times or their periods differ. Let (c 1, p 1 ),...,(c k, p k ) be different task types in block B l, ordered by periods, whereby task (c i, p i ) has multiplicity d i. Consider a pattern x Z k, containing task type (c i, p i ) precisely x i times. If pattern x may be put on a processor, having already tasks from blocks B 1,...,B l 1 with utilization α ε 2, without violating local feasibility and increasing the total utilization of this processor to β ε 2 (α,β Z), then this pattern shall be contained in the set P α,β. More formally spoken, P αβ consists of all x such that j 1 r 0 r p j : x j c j + αε 2 + p i k x i c i r j = 1,...,k 15 x i c i p i = βε 2

Since the number of periods per block is bounded by 1/ε 3 and the number of utilizations is bounded by 1/ε 2, we have k 1/ε 5 = O(1). hus this conditions can be checked efficiently via integer programming in fixed dimension [9]. Each pattern may occur in several P αβ s, thus we ideally think of several copies of x, each assigned to precisely one P αβ. Due to the lower bound on the utilization, the number of tasks per pattern cannot exceed 1/ε. But then the number of feasible patterns is again a (quite huge) constant. Let λ x be the number of times, that pattern x is used, to distribute tasks B l. hen we have LocalRS(B l,b, a)=1 if and only if the following system has a solution λ x x x = d λ x = a j j i x P i j λ x = b i i j x P i j λ x Z + x Again we use [9] to solve this integer program with a fixed number of variables. 16