10
Task Set Synthesis with Cost Minimization for Sporadic Real-Time Tasks Jian-Jia Chen Department of Informatics, Karlsruhe Institute of Technology (KIT), Germany E-mail: [email protected] Abstract By allowing users to specify multiple execution versions of a task with different amounts of worst-case execution time and costs, this paper explores how to minimize of the over- all system cost under the timing constraints for sporadic real-time tasks. One specific application is to minimize the requirement scratchpad memory size (system cost) to meet the timing constraint, while the worst-case execution time of a task depends on its allocated scratchpad memory size. This paper shows that the problem is NP -hard for approx- imation, if speed augmentation is not allowed. The algo- rithms proposed in this paper are analyzed based on (α, β)- approximation, in which a β speed augmentation factor is allowed and the system cost is at most α times of the optimal solution. For tasks with constrained deadlines, an efficient (1, 2 1η )-approximation algorithm based on dynamic pro- gramming is proposed for deadline-monotonic (DM) sche- duling, where 0 <η< 1 is a user-defined parameter for the rounding precision in dynamic programming. This is further extended to a (1, 1.6322 1η )-approximation algorithm for earliest-deadline-first (EDF) scheduling. A polynomial- time (1 + , 1+ η)-approximation scheme is also developed for EDF scheduling by considering 0 <, 0 <η< 1 when the ratio of the maximum relative deadline to the minimum relative deadline of tasks is a constant. This paper is con- cluded by considering the dual problem to maximize of the system profit by selecting execution versions with different amounts of worst-case execution time. Keywords: sporadic real-time tasks, task set synthesis, resource (speed) augmentation, approximation, schedula- bility analysis, memory allocation. 1 Introduction Maintaining the response time guarantee is an important non-functional property for achieving timing correctness, functional stability, or safety requirements for real-time sys- tems. Specifically, as embedded real-time systems are re- This work is supported in parts by the German Research Foundation (DFG) as part of the priority program “Dependable Embedded Systems” (SPP 1500 - spp1500.itec.kit.edu), and by Baden W¨ urttemberg MWK Juniorprofessoren-Program. placing control units in daily routines, real-time computing is becoming more and more important. Recurring task models, such as periodic tasks [18], spo- radic tasks [19], and events constrained by arrival curves [26], are considered in real-time systems. This paper con- siders sporadic task model, which also covers the periodic task model. A sporadic real-time task τ i is usually defined for infinitely recurring executions by its relative deadline D i and its minimum inter-arrival time T i . Any task instance (job) of a sporadic task τ i arriving at time t has to be finished no later than t + D i (called absolute deadline). Moreover, the arrivals of any two consecutive task instances of task τ i have to be separated by at least T i time units. A schedule is said feasible, if all the timing constraints can be satisfied. This paper considers preemptive scheduling policies with dynamic-priority scheduling and fixed-priority (FP) scheduling. For dynamic-priority scheduling, the earliest- deadline-first (EDF) policy has been shown to be optimal [18] by giving the highest priority to the job in the ready queue with the earliest absolute deadline. For fixed-priority scheduling, in which tasks are assigned with priority levels, it has been shown that deadline-monotonic (DM) schedu- ling policy [17], by giving higher priority to a task with a shorter relative deadline, is optimal when D i T i for each τ i in the task set. Here, the optimality is referred to the feasibility of the resulting schedule by satisfying the timing constraints. That is, if there exists a feasible schedule with dynamic-priority scheduling, EDF is also a feasible one. Moreover, when D i T i for every τ i in the given task set, if there exists a feasible schedule with fixed-priority sche- duling, deadline-monotonic scheduling is also feasible. It is essential to verify the satisfactions of the timing constraints of the sporadic real-time tasks. As a result, the worst-case execution time (WCET) of a sporadic real-time task is required to provide a safe upper bound of the execu- tion time by considering all possible input parameters, all possible hardware timing accidents, and all possible pro- gram flows. Deriving WCET of a program based on static timing analysis can be found in the survey paper [27]. With the known WCETs of the given sporadic tasks, the schedu- lability analysis can then be performed to verify whether a set of sporadic real-time tasks can meet their timing con- straints under a given scheduling policy. To improve the performance, on-chip static random- 2013 IEEE 34th Real-Time Systems Symposium 1052-8725/13 $26.00 © 2013 IEEE DOI 10.1109/RTSS.2013.42 350

[IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

Embed Size (px)

Citation preview

Page 1: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

Task Set Synthesis with Cost Minimization for Sporadic Real-Time Tasks∗

Jian-Jia ChenDepartment of Informatics, Karlsruhe Institute of Technology (KIT), Germany

E-mail: [email protected]

Abstract

By allowing users to specify multiple execution versionsof a task with different amounts of worst-case execution timeand costs, this paper explores how to minimize of the over-all system cost under the timing constraints for sporadicreal-time tasks. One specific application is to minimize therequirement scratchpad memory size (system cost) to meetthe timing constraint, while the worst-case execution timeof a task depends on its allocated scratchpad memory size.This paper shows that the problem is NP-hard for approx-imation, if speed augmentation is not allowed. The algo-rithms proposed in this paper are analyzed based on (α, β)-approximation, in which a β speed augmentation factor isallowed and the system cost is at most α times of the optimalsolution. For tasks with constrained deadlines, an efficient(1, 2

1−η )-approximation algorithm based on dynamic pro-gramming is proposed for deadline-monotonic (DM) sche-duling, where 0 < η < 1 is a user-defined parameter forthe rounding precision in dynamic programming. This isfurther extended to a (1, 1.6322

1−η )-approximation algorithmfor earliest-deadline-first (EDF) scheduling. A polynomial-time (1+ ε, 1+ η)-approximation scheme is also developedfor EDF scheduling by considering 0 < ε, 0 < η < 1 whenthe ratio of the maximum relative deadline to the minimumrelative deadline of tasks is a constant. This paper is con-cluded by considering the dual problem to maximize of thesystem profit by selecting execution versions with differentamounts of worst-case execution time.

Keywords: sporadic real-time tasks, task set synthesis,resource (speed) augmentation, approximation, schedula-bility analysis, memory allocation.

1 Introduction

Maintaining the response time guarantee is an importantnon-functional property for achieving timing correctness,functional stability, or safety requirements for real-time sys-tems. Specifically, as embedded real-time systems are re-

∗This work is supported in parts by the German Research Foundation(DFG) as part of the priority program “Dependable Embedded Systems”(SPP 1500 - spp1500.itec.kit.edu), and by Baden Wurttemberg MWKJuniorprofessoren-Program.

placing control units in daily routines, real-time computingis becoming more and more important.

Recurring task models, such as periodic tasks [18], spo-radic tasks [19], and events constrained by arrival curves[26], are considered in real-time systems. This paper con-siders sporadic task model, which also covers the periodictask model. A sporadic real-time task τi is usually definedfor infinitely recurring executions by its relative deadlineDi and its minimum inter-arrival time Ti. Any task instance(job) of a sporadic task τi arriving at time t has to be finishedno later than t +Di (called absolute deadline). Moreover,the arrivals of any two consecutive task instances of task τihave to be separated by at least Ti time units. A schedule issaid feasible, if all the timing constraints can be satisfied.

This paper considers preemptive scheduling policieswith dynamic-priority scheduling and fixed-priority (FP)scheduling. For dynamic-priority scheduling, the earliest-deadline-first (EDF) policy has been shown to be optimal[18] by giving the highest priority to the job in the readyqueue with the earliest absolute deadline. For fixed-priorityscheduling, in which tasks are assigned with priority levels,it has been shown that deadline-monotonic (DM) schedu-ling policy [17], by giving higher priority to a task with ashorter relative deadline, is optimal when Di ≤ Ti for eachτi in the task set. Here, the optimality is referred to thefeasibility of the resulting schedule by satisfying the timingconstraints. That is, if there exists a feasible schedule withdynamic-priority scheduling, EDF is also a feasible one.Moreover, when Di ≤ Ti for every τi in the given task set,if there exists a feasible schedule with fixed-priority sche-duling, deadline-monotonic scheduling is also feasible.

It is essential to verify the satisfactions of the timingconstraints of the sporadic real-time tasks. As a result, theworst-case execution time (WCET) of a sporadic real-timetask is required to provide a safe upper bound of the execu-tion time by considering all possible input parameters, allpossible hardware timing accidents, and all possible pro-gram flows. Deriving WCET of a program based on statictiming analysis can be found in the survey paper [27]. Withthe known WCETs of the given sporadic tasks, the schedu-lability analysis can then be performed to verify whether aset of sporadic real-time tasks can meet their timing con-straints under a given scheduling policy.

To improve the performance, on-chip static random-

2013 IEEE 34th Real-Time Systems Symposium

1052-8725/13 $26.00 © 2013 IEEE

DOI 10.1109/RTSS.2013.42

350

Page 2: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

access memory (SRAM) has been adopted in the form ofcache or scratchpad memory (SPM). However, the cachemisses or the SPM misses increase timing variability. Thetiming predictability for adopting cache and SPM have beenstudied for real-time systems, e.g., [23]. When SPM isadopted, it is users’ (system designers’) responsibility todecide how the SPM is utilized. For a given SPM size, theWCET C Compiler [10] based on the static WCET analyzeraiT [1] or the WCET centric data allocation [7, 24] can beadopted to minimize the worst-case execution time of a pro-gram (task). When considering multi-tasking in real-timesystems, it is also essential to decide how the SPM is sharedamong the real-time tasks in uniprocessor systems [13, 14]and in multiprocessor systems [4, 25].

However, the above heuristics [13, 14] for uniprocessorsystems do not provide fundamental results about the worst-case quality of the resulting schedule. Essentially, the SPMmemory allocation problem for real-time tasks can be mod-eled abstractly by considering that a task has a specifiedworst-case execution time under a specified cost (i.e., SPMmemory usage in this example).Contributions: This paper explores the synthesis of real-time tasks by selecting the proper version for each of thetasks to minimize the overall system cost, while satisfyingthe timing constraints for sporadic real-time tasks in unipro-cessor systems. In the above example for SPM, the objec-tive is to minimize the required memory SPM size to meetthe timing constraint. This paper shows that the problem isNP-hard for approximation, if speed augmentation is notallowed. The quality of the proposed algorithms is analyzedbased on (α, β)-approximation, in which a β speed aug-mentation factor is allowed and the system cost is at mostα times of the optimal solution. The contributions of thispaper are as follows:

• When considering DM scheduling, for a user-specifiedparameter 0 < η < 1, this paper develops an efficient(1, 2

1−η )-approximation algorithm in Section 3, whenDi ≤ Ti for all tasks τi in the given task set. This isfurther extended to a (1, 1.6322

1−η )-approximation algo-rithm for EDF scheduling in Section 4. The specifiedη is used for the rounding precision, while building thedynamic programming table. The required time andspace complexity is polynomial of O(( 1η )

2).

• Moreover, in Section 5, a polynomial-time (1 + ε, 1 +η)-approximation scheme is further presented for EDFscheduling by considering 0 < ε, 0 < η < 1 whenthe ratio of the maximum relative deadline to the min-imum relative deadline of tasks is a constant and 1

η isconsidered as a constant.

A natural extension is to consider its dual problem to max-imize of the system profit (or quality) when different exe-cution versions have different system profits with differentamounts of worst-case execution time. Such a maximiza-tion version is similar to Q-RAM (QoS-based Resource Al-

location Model) [21], which was defined when Di = Ti

for each τi in the task set. The corresponding results arepresented in Section 6.

2 System Model and Problem Definition

This section presents the system and task models. Theproblem definition is then provided, along with the analysisof the computational complexity. The definition of speed(resource) augmentation is given at the end of the section.

2.1 System Model

This paper considers a set T = {τ1, τ2, . . . , τN} ofN in-dependent sporadic real-time tasks, as defined in Section 1,in which τi is characterized by its relative deadline Di andits minimum inter-arrival time Ti. Based on the relations be-tween the relative deadlines and the minimum inter-arrivaltime, the input task set T can be classified to be with

• implicit deadlines, in which the relative deadline of atask is equal to its minimum inter-arrival time for eachsporadic task in T, i.e., Di = Ti, ∀τi ∈ T,

• constrained deadlines, in which the minimum inter-arrival time is no less than the relative deadline for ev-ery sporadic task in T, i.e., Di ≤ Ti, ∀τi ∈ T, and

• arbitrary deadlines, otherwise.

This paper considers that a task τi may have differentversions in its implementations, in which each version hasits own worst-case execution time (WCET). Suppose thatCj

i > 0 is the worst-case execution time of task τi when itrequires (at most) j units of cost from the system.

For example, for systems with a shared scratchpad mem-ory (SPM), Cj

i is worst-case execution time of task τi when(at most) j memory blocks in the SPM are allocated forexecuting task τi. Due to the different access latencies tothe main memory and the SPM, the execution time (also ofcourse WCET) of a task depends on the number of memoryblocks allocated to the task. To derive Cj

i , for example, theWCET-aware C compiler presented in [10] can be adopted.The WCET-aware C compiler tries to capture the currentworst-case execution path and perform optimizations for re-ducing the worst-case execution time by utilizing the allo-cated SRAM efficiently. Another example is to considerdifferent source code implementations or compilation opti-mizations with different reliability levels (e.g., by using thevulnerability indexes as in [22] by considering the worst-case execution times) or memory footprint costs.

For the rest of this paper, it is assumed that the WCETs ofeach task are given with different cost values. The analysisand optimization are both based on the given WCETs. Bythe definition, Cj

i ≥ Cki , for any k ≥ j. Each task τi has wi

(with wi ≥ 1) different versions with different costs, whereθi(k) is the cost for the k-th version of task τi. Without lossof generality, θi(1) < θi(2) < · · · < θi(wi).

351

Page 3: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

For notational brevity, we define Uθi(k)i =

Cθi(k)

i

Tias the

utilization of task τi by choosing the k-th version. More-over, without loss of generality, the worst-case executiontime for any version of task τi should be less than or equalto the relative deadline and the minimum inter-arrival time,i.e., C

θi(1)i ≤ Di and C

θi(1)i ≤ Ti. Any version with

Cθi(1)i > Di or C

θi(1)i > Ti can be removed by pre-

processing.

2.2 Problem Definition

Given a task set T, in which each task τi in T has wi ver-sions, a feasible task set synthesis on a uniprocessor systemis to select one version mi among the wi implementationsfor task τi such that T be feasibly scheduled to meet thetiming constraints. Clearly, from the optimization perspec-tives, the minimum cost task set synthesis is a feasible taskset synthesis in which

∑τi∈T θi(mi), defined as the system

cost, is the minimum.We define the above problem as the minimum cost task

set synthesis for sporadic real-time tasks problem. Forbrevity, for the rest of the paper, the above problem is ab-breviated as the minimum cost synthesis problem. The deci-sion version of the problem is to verify whether there existsa feasible task set synthesis such that the total cost of all thetasks is no more than a given upper bound.

2.3 Hardness and Speed Augmentation

When considering EDF scheduling for task sets withimplicit deadlines, the feasibility of the resulting versionselection m1,m2, . . . ,mN can be easily verified by test-

ing whether∑

τi∈TC

θi(mi)

i

Tiis less than or equal to 100%

[18]. Therefore, for the minimum cost synthesis problem fortask sets with implicit deadlines, the minimum cost synthe-sis problem is equivalent to the minimum multiple-choiceknapsack problem: Given a set of items, each with wi ver-sions and each version has a weight and a value, the objec-tive is to choose one version in each item such that the totalweight is no more than a given limit and the total value isas small as possible. There have been several approxima-tion algorithms for the multiple choice knapsack problemfor the maximization version (to maximize the profit), e.g.,[12, 15]. These results can be extended/modified to handlethe task sets with implicit deadlines.

For the general cases by considering task sets with con-strained deadlines or arbitrary deadlines or by consideringfixed-priority (FP) scheduling, the minimum cost synthe-sis problem becomes more challenging. Even though EDFis optimal for dynamic-priority systems, verifying the fea-sibility of EDF for a task set with constrained or arbitrarydeadlines, in general, is coNP -hard [8]. Similarly, verify-ing the feasibility of FP scheduling for a task set is alsoNP -hard [9].

Theorem 1 Unless P = NP , there is no polynomial-timealgorithm, which guarantees to derive a feasible task setsynthesis with EDF scheduling or FP scheduling.

Proof. This comes directly from the hardness of the verifi-cation of feasibility for EDF and FP scheduling for sporadicreal-time tasks.

Therefore, for sporadic real-time tasks, some relax-ation and approximation are needed to allow efficient, i.e.,polynomial-time, algorithms. Here, the speed (resource)augmentation by speeding up, as done in [6, 11], is adoptedto relax the hardness to derive a feasible task set synthesis.Suppose that an algorithm A for the minimum cost syn-thesis problem has a β speed augmentation factor. Then,A guarantees that the resulting task set synthesis for T de-rived from algorithm A can be feasibly scheduled by thecorresponding scheduling policy by speeding up the plat-form to β times as fast as in the original platform speed ifthere exists a feasible task set synthesis for T. Moreover,suppose that the system cost of the minimum cost task setsynthesis is B∗(I) for an input instance I . An algorithmis said to have an α-approximation for the minimum costsynthesis problem if it guarantees to have at most α ·B∗(I)system cost for any input instance I with the existence of afeasible task set synthesis for T.

According to the above definitions, an algorithm is saidto have (α, β)-approximation for the minimum cost synthe-sis problem if it guarantees to have at most α ·B∗(I) systemcost with a β speed augmentation factor. With the aboveterminology of (α, β)-approximation, it can be proved thatspeed augmentation is needed for allowing any approxima-tion in polynomial time.

Theorem 2 Unless P = NP , there is no polynomial-time(α, 1)-approximation algorithm for the minimum cost syn-thesis problem for any α ≥ 1 when considering EDF or FPscheduling.

Proof. This comes from a simple L-reduction from theuniprocessor schedulability problem for sporadic real-timetasks. The uniprocessor schedulability problem for sporadicreal-time tasks is to verify whether a given task set T∗ canbe feasibly scheduled with EDF [8] or with FP [9], in whichtask τ∗i ∈ T∗ has worst-case execution time C∗

i , minimuminter-arrival time T ∗

i and relative deadline D∗i . Such a prob-

lem is coNP -hard [8] for EDF and NP -hard [9] for FP.Suppose that there exists an (α, 1)-approximation algo-

rithm A∗ for the minimum cost synthesis problem withα ≥ 1 for contradiction. For each task τ∗i in T∗ inthe uniprocessor schedulability, we construct a task τi forthe minimum cost synthesis problem by specifying Di =

D∗i , Ti = T ∗

i , Cθi(1)i = C∗

i , Cθi(2)i = min{C∗

i

2 , ε}, where

0 < ε <minτi∈T Di

N . Moreover, θi(1) is set to 1 and θi(2)is set to (α− 1)N +1+ ε. Clearly θi(2) > θi(1) due to the

fact that α ≥ 1 and ε > 0 and Cθi(1)i > C

θi(2)i .

352

Page 4: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

It is clear that there is a feasible task set synthesis forT with system cost equals to N by spending cost θi(1)for each task τi under EDF (FP, respectively) schedulingif there is a feasible EDF (FP, respectively) scheduling forT∗. Moreover, if there is no feasible EDF (FP, respectively)scheduling for T∗, a feasible task set synthesis for T un-der EDF (FP, respectively) scheduling must require at leastαN + ε system cost.

Since Algorithm A∗ is a polynomial-time (α, 1)-approximation algorithm, (a) when the solution derived byA∗ for the task set T is less than or equal to αN , we knowthere is a feasible EDF (FP, respectively) scheduling for T∗,and (2) when the solution derived by A∗ for the task set Tis larger than αN , we know there is no feasible EDF (FP,respectively) scheduling forT∗. As a result, A∗ can be usedto verify the coNP -hard [8] problem for EDF scheduling orthe NP -hard problem [9] for FP scheduling in polynomialtime, which contradicts to the assumption P �= NP .

As a result, speed augmentation is needed for provid-ing (α, β)-approximation in polynomial time, There are twoforms with respect to the speed augmentation. (a) (α, β)-approximation with respect to slowing down the originalplatform: the resulting solution is at most α times of theoptimal solution by slowing down the system by a 1

β factor,and (b) (α, β)-approximation with respect to speeding up inthe platform: the resulting solution is feasible by speedingup the system by a β factor and is with at most α times ofthe optimal solution in the original platform.

These two forms are equivalent. For the former formwith respect to slowing down, the resulting task set syn-thesis can still be feasible in the original platform, whereasthe optimization in the system cost is evaluated by com-paring to a slow-down platform. For the latter form withrespect to speeding up, the feasibility of the resulting taskset synthesis can only be guaranteed by the speeding up fac-tor, whereas the optimization in the system cost is evaluatedby comparing to the original platform. Any of the proposedalgorithms can be easily modified from one form to handleanother form. For the rest of this paper, the algorithms inSections 3 and 4 are respect to slowing down, and the algo-rithm in Section 5 is respect to speeding up.

3 Task Set Synthesis for DM Scheduling

This section presents a polynomial-time algorithm forthe minimum cost synthesis problem under fixed-priority(FP) scheduling for task set T with constrained deadlines.As it is known that the deadline-monotonic (DM) priorityassignment is optimal (for satisfying the timing constraints)for such a case [17], this section focuses on DM scheduling.For brevity, the tasks are ordered according to the prioritylevels, i.e., Di ≤ Dj if i < j.

Suppose that when considering task τi, the version se-lection m1,m2, . . . ,mi−1 for τ1, τ2, . . . , τi−1 has been al-ready decided. The feasibility of task τi by selecting version

mi can be verified by the exact (necessary and sufficient)response time analysis [16]. That is, if and only if

∃t, 0 < t ≤ Di with t = Cθi(mi)i +

i−1∑j=1

⌈t

Tj

⌉C

θj(mj )

j , (1)

then task τi can be feasibly scheduled by the DM schedu-ling.

Fisher and Baruah [11] present how to approximately an-alyze the test in (1) in polynomial time by utilizing the re-source augmentation factor. The trick in [11] is to take lin-ear approximation of the ceiling function in (1) when t

Tjis

larger than a predefined constant. A very safe upper bound

to approximate the analysis for (1) is to replace⌈

tTj

⌉with

(1 + tTj). As a result, if

∃t, 0 < t ≤ Di with t =

i∑j=1

Cθj(mj)j +t·

i−1∑j=1

Uθj(mj)j , (2)

then task τi can be feasibly scheduled by the DM schedu-ling. Even though the approximation in (2) is only a suffi-cient condition for the feasibility of the resulting schedule,the analysis in [11] shows that such an approximation has aspeed (resource) augmentation factor equals to 2.

Moreover, as this section considers only tasks with con-strained deadlines, it is assumed that Di ≤ Ti for ev-

ery task τi in T, and, hence, Cθi(k)

i

Di≥ U

θi(k)i for any

k = 1, 2, . . . , wi. Therefore, it is not difficult to verify that∑ij=1 C

θj(mj)j

Di+

i−1∑j=1

Uθj(mj)j ≤ 1 (3)

if and only if there exists t with 0 < t ≤ Di and t =∑ij=1 C

θj(mj)j + t · ∑i−1

j=1 Uθj(mj)j in (2). Based on the

above schedulability analysis, the following lemma holds.

Lemma 1 For task τi, if∑ij=1 C

θj(mj)j

Di+

i−1∑j=1

Uθj(mj)j > 1,

then the version selection m1,m2, . . . ,mi cannot be fea-sibly scheduled if the system is slowed down to 0.5 of theoriginal speed.

Proof. The infeasibility by slowing down can be verifiedas for all 0 < t ≤ Di,

2Cθi(mi)i + 2

i−1∑j=1

⌈t

Tj

⌉C

θj(mj)j

≥ Cθi(mi)i +

i−1∑j=1

(t

TjC

θj(mj)j + C

θj(mj)j )

= (

∑ij=1 C

θj(mj)j

t+

i−1∑j=1

Uθj(mj)j )t

> t.

353

Page 5: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

Suppose that G(i, δ, u) is the minimum system cost, rep-resented by a version selection m1,m2, . . . ,mi, for the firsti tasks such that

• the total utilization for the first i tasks is equal to u,

• the total execution time for the first i tasks is equal toδ ·Di, and

•∑k

j=1 Cθj(mj )

j

Dk+

∑k−1j=1 U

θj(mj)j ≤ 1 for any k =

1, 2, . . . , i.

For notational brevity, G(i, δ, u) is defined as ∞ if δ oru is less than 0. Clearly, the initial condition for G(1, δ, u)with δ ≤ 1 is as follows:

G(1, δ, u) = mink≤w1

{θ1(k), if Uθ1(k)

1 = u, andC

θ1(k)1D1

= δ,

∞, otherwise.

(4)

The value G(i, δ, u) for 2 ≤ i ≤ N can be obtained bythe following recursive function:

G(i, δ, u) =

mink≤wi

⎧⎨⎩∞, if δ + u− U

θi(k)i > 1

θi(k) +G(i− 1,δDi−C

θi(k)i

Di−1, u− U

θi(k)i ), otherwise.

(5)

That is, if δ + u − Uθi(k)i > 1, selecting the k-th version

for task τi is not feasible by using the schedulability testin (3); otherwise, it is feasible (due to the satisfactions of(3)) by selecting the k-th version for task τi. The follow-ing lemma shows the sub-optimal structure for building thetable G(i, δ, u) based on (5).

Lemma 2 Suppose that G(i − 1, δ′, u′) is known for any0 ≤ δ′ ≤ 1 and 0 ≤ u′ ≤ 1, in which G(i − 1, δ′, u′) isdefined as ∞ if δ′ or u′ is less than 0. The recursive functionin (5) correctly constructs G(i, δ, u) for the given δ and u.

Proof. This lemma can be proved by contradiction. Thedetails are omitted.

Therefore, based on Lemmas 1 and 2, we have the fol-lowing theorem.

Theorem 3 The minimum G(N, δ, u) for 0 ≤ δ ≤ 1 and0 ≤ u ≤ 1 has a (1, 2)-approximation factor (with respectto slowing down the original platform) for the minimum costsynthesis problem under the DM scheduling by building thetableG() recursively by for all possible values of 0 ≤ δ ≤ 1and 0 ≤ u ≤ 1.

Proof. Suppose that the minimum G(N, δ, u) for 0 ≤ δ ≤1 and 0 ≤ u ≤ 1 happens when δ is equal to δ∗ and u isequal to u∗. Moreover, let G(N, δ∗, u∗) be B†. In case B†

is ∞, based on Lemma 1, there is no feasible solution byslowing down to run at 0.5 times of the original speed.

Let’s consider the case B† �= ∞. Assume for contradic-tion that there exists a version selection m1,m2, . . . ,mN

in which (a)∑N

i=1 θi(mi) < B† and (b) the tasks can befeasibly scheduled by the DM scheduling by slowing downthe platform to run at half of the original speed. Therefore,when considering task τN , according to Lemma 1, we have∑i

j=1 Cθj(mj)

j

Di+

∑i−1j=1 U

θj(mj)j ≤ 1 for i = 1, 2, . . . , N .

Moreover, due to the feasibility by slowing down, it is also

known that∑i−1

j=1 Uθj(mj)j ≤ 0.5 and

∑ij=1 C

θj(mj )

j

Di≤ 0.5

for i = 1, 2, . . . , N . Clearly, by Lemma 2,

G

⎛⎝N,

∑Nj=1 C

θj(mj )

j

DN,

N∑j=1

Uθj(mj )

j

⎞⎠ ≤

N∑j=1

θj(mj)

< B† = G(N, δ∗, u∗) ≤ G

⎛⎝N,

∑Nj=1 C

θj (mj)

j

DN,

N∑j=1

Uθj (mj )

j

⎞⎠ ,

in which the contradiction is reached. Therefore, the cor-responding version selection for G(N, δ∗, u∗) has a (1, 2)-approximation factor.

However, to successfully find the minimum G(N, δ, u),it is required to build all possible values of δ and u in therange of [0, 1]. Now, let’s build the table by a user-specifiedgranularity σ. That is, suppose that we only consider thepossible values of δ and u in the integer multiples of σ. Forthe simplicity of presentation, 1

σ is considered as an integernumber.

Therefore, it is only needed to build ( 1σ )2 entries for

G(i, f1σ, f2σ) with f1, f2 ∈ {0, 1, 2, . . . , 1σ}. For nota-

tional brevity, we use Rσ(y), defined as⌈yσ

⌉σ, to represent

any value y with Rσ(y)− σ < y ≤ Rσ(y).The initial condition with δ ≤ 1 in (4) is revised as fol-

lows:

G′(1, δ, u) = mink≤w1

⎧⎨⎩θ1(k), if Rσ(U

θ1(k)1 ) = u, and Rσ(

Cθ1(k)1D1

) = δ,

∞, otherwise.

(6)

The recursive representation in (5) with δ ≤ 1 is revisedas follows:

G′(i, δ, u) = mink≤wi{

∞, if δ + u− Rσ(Uθi(k)i ) > 1

θi(k) +G′(i− 1, δ∗k , u−Rσ(Uθi(k)i )), otherwise,

(7)

where δ∗k is Rσ(δDi−Rσ(C

θi(k)

i )

Di−1).

Algorithm 1 presents the above dynamic programmingunder a user-specified parameter σ. Based on the definitionof G′(), the following lemmas show the error made by therounding procedure.

Lemma 3 Suppose that 1 − 3Nσ > 0. For any ver-sion selection m1,m2, . . . ,mN with

∑ij=1 C

θj(mj)j +∑i−1

j=1 Uθj(mj)j > (1 − 3Nσ)Di for a certain i =

1, 2, . . . , N , this version selection is not feasible by DMscheduling if the system is slowed down to run at 1−3Nσ

2of the original speed.

354

Page 6: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

Proof. This comes by (a) first slowing down the system by

the slowing down factor 1 − 3Nσ so that∑i

j=1

Cθj(mj )

j

1−3Nσ +∑i−1j=1

Uθj (mj)

j

1−3Nσ > Di for a certain i = 1, 2, . . . , N , and (b)further slowing down the system by a factor 1

2 to adopt theresult in Lemma 1 for the infeasibility.

Lemma 4 Suppose that 1 − 3Nσ > 0. For any ver-sion selection m1,m2, . . . ,mN with

∑ij=1 C

θj(mj)j +∑i−1

j=1 Uθj(mj)j ≤ (1 − 3Nσ)Di for every i = 1, 2, . . . , N ,

there exist f1 ∈ {0, 1, 2, . . . , 2i} and f2 ∈ {0, 1, 2, . . . , i}such that

G′(i, f1σ +

⌊δiσ

⌋σ, f2σ +

⌊ui

σ

⌋σ) ≤

i∑j=1

θj(mj),

where δi is Rσ(∑i

j=1

Cθj(mj )

j

Di) and ui is

Rσ(∑i

j=1 Uθj(mj)j ).

Proof. Due to space limitation, only a sketched proof ispresented. This can be proved by an induction on i. Thisholds clearly when i is 1. The error comes from the round-ing to the next value in the scale of σ. For the error relatedto u, when considering a task, the increased error is at mostσ. For the error related to δ, when considering a task, the in-creased error is at most 2σ as the rounding is applied twice.

The following theorem concludes this section with thetime complexity and approximation factor of Algorithm 1.

Theorem 4 Algorithm 1 is a (1, 21−η )-approximation algo-

rithm (with respect to slowing down the original platform)with time complexity O((Nη )

2∑N

i=1 wi) for the minimumcost synthesis problem under the DM scheduling by settingσ to 1

3Nη � for any 0 < η < 1.

Proof. The time complexity is equal toO(( 1σ )

2∑N

i=1 wi) = O((Nη )2∑N

i=1 wi), as for each

task τi there are O(( 1σ )2) entries to be filled with time

complexity O(wi) for each entry. The approximation factor(1, 2

1−η ) comes directly from Lemmas 3 and 4.

4 Task Set Synthesis for EDF

This section presents the task set synthesis algorithm forEDF scheduling for task set T with arbitrary deadlines.Without loss of generality, the tasks are ordered accordingto the relative deadlines, i.e., D1 ≤ D2 ≤ . . . ≤ DN .

If the version selection for τ1, τ2, . . . , τN has been al-ready decided, the feasibility of the solution can be verifiedby the exact (necessary and sufficient) demand bound func-tion analysis [3]. That is, if and only if

∀t > 0,

N∑i=1

max

{0,

⌊t−Di

Ti

⌋+ 1

}× C

θi(mi)i ≤ t, (8)

Algorithm 1 Dynamic Programming for DM Scheduling

Input: set T of N tasks with fixed priority ordering, σ;1: build G′(1, f1σ, f2σ) with f1, f2 ∈ {0, 1, 2, . . . , 1

σ} by adopting

(6);2: for i = 2 to N do3: for each f1, f2 ∈ {0, 1, . . . , 1

σ} do

4: build G′(i, f1σ, f2σ) by adopting (7);5: end for6: if G′(i, f1σ, f2σ) is∞,∀f1, f2 ∈ {0, 1, . . . , 1

σ} then

7: return “ no feasible solution was found”;8: end if9: end for

10: find f∗1 and f∗

2 such that f∗1 , f

∗2 ∈ {0, 1, 2, . . . , 1

σ} and

G′(N, f∗1 σ, f

∗2 σ) is the minimum;

11: backtrack the dynamic programming table G′() to find the versionselection mi for each task τi;

12: return the synthesized task set as a “feasible solution”;

then the tasks can be feasibly scheduled by EDF scheduling.Specifically, the demand bound function dbf(τi, t, k), as in[3], of a task τi within any time interval with length equalto t with the k-th implementation can be defined as

dbf(τi, t, k) = max

{0,

⌊t−Di

Ti

⌋+ 1

}× C

θi(k)i , (9)

to provide an upper bound of the maximum demand re-leased from task τi that must be finished in the interval.

Similar to the linear approximation, proposed by Albersand Slomka [2], we define the approximate demand boundfunction as follows:

dbf∗(τi, t, k) =

{0 if t < Di(

t−Di

Ti+ 1

)C

θi(k)i otherwise.

(10)A very safe upper bound to approximate the analysis for

(8) is to use the approximate demand bound function. As aresult, if

∀t > 0,

N∑i=1

dbf∗(τi, t,mi) ≤ t, (11)

then resulting version selection m1,m2, . . . ,mN is a feasi-ble one. By adopting the approximate demand bound func-tion, the following condition gives a sufficient schedulabil-ity test for the selected versions m1,m2, . . . ,mN :

N∑j=1

Uθj(mj)j ≤ 1 and (12a)

∑ij=1 dbf∗(τj , Di,mi)

Di≤ 1,∀τi ∈ T. (12b)

Even though the approximation in (12) is only a sufficientcondition for the feasibility of the resulting schedule, theanalysis in [6] shows that such an approximation has a speedaugmentation factor 1.6322.

We can now use a similar way as in Section 3 to build adynamic programming table. Suppose that H(i, δ, u) is theminimum system cost, represented by the version selectionm1,m2, . . . ,mi, for the first i tasks such that

355

Page 7: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

• the total utilization for the first i tasks is equal to u and

• the total approximate demand function for the alloca-tion at time t for the first i tasks is equal to δ ·Di.

The initial condition to build H(1, δ, u) is the same asG(1, δ, u) presented in (4). Now, the value H(i, δ, u) for2 ≤ i ≤ N can be obtained by the following recursivefunction:

H(i, δ, u) = mink≤wi

{θi(k) +H(i− 1, δ∗k, u− U

θi(k)i )

}(13)

where δ∗k is defined as δDi−(u−Uθi(k)

i )·(Di−Di−1)−Cθi(k)

i

Di−1

and H(i − 1, δ′, u′) is defined as ∞ if either δ′ or u′ isless than 0. The rationale behind (13) is to analyze theimpact by selecting the k-th version for task τi to satisfy(12b), i.e., the first i − 1 tasks should have total utilizationat most u− U

θi(k)i and the total approximate demand func-

tion for the first i − 1 tasks at time Di−1 must be at mostδ∗kDi−1 = δDi − (u− U

θi(k)i ) · (Di −Di−1)− C

θi(k)i .

Similar to the results in Theorems 3 and 4 for DM sche-duling, the following theorems also hold for EDF schedu-ling.

Theorem 5 The minimum H(N, δ, u) for 0 ≤ δ ≤ 1 and0 ≤ u ≤ 1 has a (1, 1.6322)-approximation factor (withrespect to slowing down the original platform) for the min-imum cost synthesis problem under the EDF scheduling bybuilding the table H() recursively by for all possible valuesof 0 ≤ δ ≤ 1 and 0 ≤ u ≤ 1.

Proof. The proof strategy is very similar to the proof inTheorem 3, whereas the speed augmentation factor 1.6322is due to the analysis for adopting the sufficient test in (12)in [6].

Theorem 6 The minimum cost synthesis problem under theEDF scheduling admits a (1, 1.6322

1−η )-approximation algo-rithm (with respect to slowing down the original platform)with time complexity O((Nη )

2∑N

i=1 wi) for any 0 < η < 1.

Proof. Due to the space limitation, the details are omitted.This is based on the same rounding methodology as in Al-gorithm 1 by only building ( 1σ )

2 entries for G(i, f1σ, f2σ)with f1, f2 ∈ {0, 1, 2, . . . , 1

σ} with approximations by set-ting σ to 1

3Nη � . Similar to the analysis in the proof of The-

orem 4 (based on similar arguments in Lemmas 3 and 4), byadopting the speed augmentation factor 1.6322 for the testin (12) the speed augmentation factor can be proved.

5 Polynomial-Time Approximation Schemefor EDF

The algorithms in Section 3 and Section 4 force a con-stant resource augmentation factor for speeding up. Ac-cording to Theorem 2, speed augmentation is needed foradmitting polynomial-time approximation algorithms. For

several special cases, this section presents a polynomial-time approximation scheme (PTAS) by augmenting thespeed by a user-specified factor 1 + η with η > 0, with asystem cost with at most (1+ ε)B∗(I) with a user-specifiedfactor ε > 0 for input instance I . Throughout this section,the algorithm and the analysis for (α, β)-approximation willbe presented with respect to speeding up in the platform.

The result is built based on the d-dimensional represen-tative vectors for the given task set T, as defined similarlyin [5]. That is, instead of verifying the feasibility of EDFby checking all t > 0 in (8), only d representative pointsare selected for verifying the feasibility. Therefore, eachtask has d representative points, says t1, t2, . . . , td, for eval-uating the corresponding demand bound functions. For thek-th version of task τi, a vector

vi,k =

(dbf(τi, t1, k)

t1,

dbf(τi, t2, k)t2

, . . . ,dbf(τi, td, k)

td

)(14)

is constructed to represent the density of the d representativepoints.

For notational brevity, we define the j-th element in vec-tor vi,k as qi,k,j . The quantity ||vi,k||∞ denotes the stan-dard �∞ norm, in which ||vi,k||∞ = maxj{qi,k,j}. Aversion selection is denoted by M = (m1,m2, . . . ,mN)for the given N tasks. Moreover, for a set VM ={v1,m1 , v2,m2 , . . . , vN,mN} of vectors, ||VM||∞ is thestandard �∞ norm for the sum of the vectors in the set, inwhich ||VM||∞ = maxj{

∑�vi,mi

∈V qi,mi,j}.Suppose that ΔM is the maximum density, i.e.,

maxt>0

∑Ni=1 dbf(τi,t,mi)

t when the version selection isM = (m1,m2, . . . ,mN ). By sampling only d points,it is clear that ΔM ≥ ||VM||∞. Moreover, the d-dimensional vectors for task set T are called representa-tive with an error factor η (with 0 < η) if, for any VM ={v1,m1 , v2,m2 , . . . , vN,mN},

ΔM ≥ ||VM||∞ ≥ (1

1 + η)ΔM. (15)

Therefore, the d-dimensional representative vectors forthe given task set T, as described in (15), provide a (1 + η)speed augmentation factor by verifying ||VM||∞ ≤ 1. Forthe rest of this section, a polynomial-time approximationscheme will be first presented in Section 5.1 based on the d-dimensional representative vectors, describe in (15), whend is a constant. Then, in Section 5.2, two special cases willbe presented for obtaining (1 + ε, 1+ η)-approximation forthe minimum cost synthesis problem.

5.1 Version Selection Based on d-DimensionalRepresentative Vectors

This subsection presents an algorithm for the minimumcost synthesis problem for EDF scheduling when the prop-erty in (15) holds for the d-dimensional representative vec-tors with a constant d. Throughout this section, we will

356

Page 8: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

only consider vi,k, in which each vector vi,k has θi(k) sys-tem cost. Moreover, it is implicitly assumed that the so-lution is feasible by selecting the best implementation wi

in the d sampling points, i.e.,∑N

i=1 xi,kqi,wi,j ≤ 1 forj = 1, 2, . . . , d; otherwise, there is no feasible solution forthe d-dimensional representative vectors.

Suppose that xi,k is a binary variable to representwhether the k-th version is selected for task τi. If xi,k is 1,the k-th version is selected for τi; otherwise, if xi,k is 0, thek-th version is not selected for τi. Therefore, the minimumcost synthesis problem based on the d-dimensional repre-sentative vectors is defined as the following integer linearprogramming (ILP):

minimizeN∑i=1

wi∑k=1

xi,k · θi(k) (16a)

s.tN∑i=1

wi∑k=1

xi,k · qi,k,j ≤ 1, ∀j = 1, . . . , d (16b)

wi∑k=1

xi,k = 1, ∀τi ∈ T (16c)

xi,k ∈ {0, 1}, ∀τi ∈ T, k = 1, 2, . . . , wi. (16d)

The solution here is extended from the polynomial-timeapproximation scheme (PTAS) [20], where the objective in[20] is to maximize the value of the selected items and eachitem can be selected with at most one version. The objectivefor the minimum cost synthesis problem is different fromthe standard multiple choice knapsack problem in [20], aswe have to choose exactly one version to minimize the sys-tem cost.

For a user-specified error ε > 0, we define Z =min{N,

⌈dε

⌉}. The PTAS for (16) works by (a.) enumerat-ing the combinations to select the versions forZ large tasks,(b.) selecting the versions of the other N − Z light taskswith a linear programming relaxation of (16), in which thecost of the selected version for each of these Z large tasksis no less than the other N − Z light task, (c.) rounding thefractional variables to yield a feasible solution for (16), and(d) returning the best found feasible solution as the result.

The detailed procedure for the PTAS is as follows:

• Among the N tasks, we enumerate all possible casesby selecting Z tasks, says task set TZ , to be the largetasks. The number of combinations for selecting TZ

is O(NZ) = O(Ndε ). Then, for each combination of

TZ , all possible combinations of the versions are enu-

merated with time complexityO(WZmax) = O(W

dεmax),

whereWmax is the maximum number of versions of allthe tasks, i.e., Wmax = maxτi∈T{wi}. Suppose thatVZ is the version selection for a specific task set TZ ,i.e., vi,k is in VZ if the k-th version is selected for taskτi. There are, hence, in total O((WmaxN)

dε ) combi-

nations for VZ in this step, which is polynomial in theinput size when d

ε is a constant.

• Now, for each specific combination VZ for TZ , werelax the ILP in (16) by (a.) selecting the k-th ver-sion for task τi in TZ if vi,k is in VZ , (b.) excludingthe versions in the other tasks in T \ TZ with highercosts than any of the selected versions in VZ , and (c.)allowing the other light tasks in T \ TZ to have frac-tional variables xi,k instead of binary variables. Thatis, for a given VZ for TZ , the relaxed linear program-ming (LP) for (16) is to relax (16d) into the followingconstraints:⎧⎪⎪⎪⎨

⎪⎪⎪⎩xi,k = 1 if vi,k ∈ VZ

xi,k = 0 if τi ∈ TZ , vi,k /∈ VZ

xi,k = 0 if τi ∈ T \TZ , θi(k) > BZ

0 ≤ xi,k otherwise,

(17)

where BZ is defined as min�vi,k∈VZ{θi(k)}.

• Then, for each specific combination VZ for TZ , wecan solve the above relaxed LP in polynomial time.If there is no feasible solution for the relaxed LP,this specific combination VZ for TZ has no fea-sible solution; otherwise, suppose that X†(VZ) ={x†i,k | τi ∈ T, 1 ≤ k ≤ wi

}is the optimal solution

(in an extreme point) in the above linear programming.Based on this, we greedily select the highest index kfor task τi with x†

i,k > 0 as the solution for the givenspecific combination of VZ , in which the solution is

stored as X ′(TZ) ={x′i,k | τi ∈ T, 1 ≤ k ≤ wi

}.

• Among the feasible solutions for all the given specificcombination of VZ for TZ , the best solution is re-turned as the final solution.

The above procedures are summarized in Algorithm 2,and the following theorem shows the approximation factor.

Theorem 7 Algorithm 2 has polynomial-time complexitywith respect to the input size when d

ε is a constant. Thesolution derived from Algorithm 2 is feasible and is at most(1 + ε) times of the optimal solution for (16).

Proof. There are in total O((WmaxN)dε ) combinations for

VZ , which is polynomial in the input size when dε is a con-

stant. Each iteration requires to solve a linear programminginstance in polynomial time of the input size. The roundingdecision from Step 7 to Step 15 in Algorithm 2 takes onlylinear time. Therefore, the algorithm is with polynomial-time complexity when d

ε is a constant.It is clear that if Algorithm 2 returns in Step 2, there is

no feasible solution. Before moving to the approximationanalysis, let’s analyze the linear programming in (16) by re-placing the variable constraint in (16d) with (17). In eachiteration, the linear programming has d+N−Z constraints(by excluding xi,k ≥ 0 and removing the constraints forthe known variables xi,k for τi ∈ TZ ). Therefore, by theextreme point theorem in linear programming, any optimal

357

Page 9: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

Algorithm 2 Polynomial-Time Approximation Scheme for(16)

Input: ε, T, �vi,k for d dimensions and θi(k) for τi ∈ T and k =1, 2, . . . , wi;

1: Z ← min{N,⌈dε

⌉}, V← {

�vi,wi

}, best←∑N

i=1 θi(wi);

2: return “there is no feasible solution” if ||V||∞ > 1;3: for each combination of Z tasks TZ in task set T do4: for each combination of VZ based on TZ do5: solve the LP in (16) by replacing the variable constraint in

(16d) with (17);

6: let x†(VZ ) ={x†i,k | τi ∈ T, 1 ≤ k ≤ wi

}be the optimal

solution in an extreme point for the above LP;7: if there is no feasible solution for the LP then8: continue;9: else

10: for each task τi ∈ T, set the highest index k for task τiwith x†

i,k > 0 to x′i,k ← 1 and others with x′

i,k ← 0;

11: if∑N

i=1

∑wik=1 x

′i,kθi(k) ≤ best then

12: best←∑Ni=1

∑wik=1 x

′i,kθi(k);

13: V←{�vi,k | x′

i,k = 1}

;

14: end if15: end if16: end for17: end for18: return the solution by selecting version k for task τi if �vi,k ∈ V;

solution X†(VZ), if feasible solutions for the linear pro-gramming exist, in an extreme point only has d + N − Znon-zero variables x†

i,k for τi ∈ TZ . As a result, there areat most 2d non-integral values in X†(VZ) if feasible so-lutions exist. In other words, there are at most d tasks withnon-integral values in X†(VZ). Clearly, due to the assump-

tion thatCθ(k)i decreases with respect to k and the feasibility

of the solution X†(VZ), we know that selecting the highestindex k for task τi with x†

i,k > 0 is also a feasible solutionfor the constraints in (16). Therefore, X ′(VZ) is a feasiblesolution for (16). As a result, if Algorithm 2 does not re-turn in Step 2, the resulting solution is guaranteed to be afeasible one for (16).

Suppose that the optimal solution for (16) is

X∗ ={x∗i,k | τi ∈ T, 1 ≤ k ≤ wi

}. That is,

B∗ =∑N

i=1

∑wi

k=1 x∗i,kθi(k) is the optimal solution

for (16). Now, based on X∗, we select Z vectors withthe highest cost to form vector set V∗

Z , in which tiesare broken arbitrarily. That is, V∗

Z has Z vectors andθi(k) ≥ x∗

j,k′θj(k′) for vi,k ∈ V∗

Z and vj,k′ /∈ V∗Z . By the

definition of Z and the feasibility of the solution X∗ for(16), it is always feasible to construct V∗

Z .Specifically, in Algorithm 2, in one of the iterations, V∗

Z

will be considered, since all possible combinations with Ztasks are enumerated. Now, let’s focus on this iterationwhen VZ is equal to V∗

Z . There are at most d tasks withnon-integral values in X†(V∗

Z) based on the extreme pointtheorem. Moreover, if 0 < x†

i,k < 1 for given i and k, wealso know that θi(k) ≤ BZ , according to the constructionof the linear programming in (17). Moreover, by the defini-

tion of BZ , it is clear that

BZ ≤∑

�vi,k∈V∗Zθi(k)

Z. (18)

Therefore, by rounding the solution from X†(VZ) toX ′(VZ), the system cost is increased by at most

d·∑

�vi,k∈V∗Zθi(k)

Z≤ d·

∑�vi,k∈V∗

Zθi(k)

≤ εN∑i=1

wi∑k=1

x∗i,k·θi(k)

(19)Based on (19) and the fact the

∑Ni=1

∑wi

k=1 x†i,k ·θi(k) ≤∑N

i=1

∑wi

k=1 x∗i,k · θi(k) due to the relaxation, we have

N∑i=1

wi∑k=1

x′i,k · θi(k) ≤ (1 + ε)

N∑i=1

wi∑k=1

x∗i,k · θi(k). (20)

As Algorithm 2 iterates all possible combinations of theZ large tasks, the solution derived from Algorithm 2 is fea-sible and is at most (1+ ε) times of the optimal solution for(16) due to (20).

5.2 Task Sets with PTAS

To achieve (15), there have been two special types of tasksets as presented in [5]:

• The ratio of the maximum relative deadline Dmax tothe minimum relative deadline Dmin of the sporadictasks is bounded by a constant.

• There are constant clusters with respect to the relativedeadlines, in which the maximum relative deadline ofthe tasks in a cluster divided by the minimum relativedeadline of the tasks in the cluster is a constant.

We conclude this section with the following theorem:

Theorem 8 If Dmax

Dminis a constant or there are constant

clusters with respect to the relative deadlines, there is apolynomial-time (1 + ε, 1 + η)-approximation scheme forsuch a task set T under ε > 0 and 1 > η > 0 for theminimum cost synthesis problem.

Proof. The factor 1 + ε comes from Theorem 7, and thefactor 1+η comes from the arguments for the satisfaction of(15) when Dmax

Dminis a constant or there are constant clusters

with respect to the relative deadlines in T. The proofs forthe speed up factor (1 + η) is very similar to the proofsof Lemmas 4 and 5 in [5] with very slight difference. Thedetails are hence omitted.

6 Conclusions

This paper presents the minimization of the overall sys-tem cost for the synthesis of sporadic real-time tasks byconsidering different WCETs under different system costs.

358

Page 10: [IEEE 2013 IEEE 34th Real-Time Systems Symposium (RTSS) - Vancouver, BC, Canada (2013.12.3-2013.12.6)] 2013 IEEE 34th Real-Time Systems Symposium - Task Set Synthesis with Cost Minimization

One specific application is to minimize the requirementof the scratchpad memory size or to minimize the vul-nerability indexes (system cost) to meet the timing con-straint. This paper presents the hardness and develops al-gorithms for achieving (α, β)-approximation for approxi-mating the system cost with an α factor with a β speed aug-mentation factor. An efficient (1, 2

1−η )-approximation al-gorithm is proposed for fixed-priority (FP) scheduling fortasks with constrained deadlines, where 0 < η < 1 isa user-defined parameter. This is further extended to a(1, 1.63221−η )-approximation algorithm for EDF scheduling. Apolynomial-time (1 + ε, 1 + η)-approximation scheme isalso developed for EDF scheduling by considering 0 < ε,0 < η < 1 when the ratio of the maximum relative deadlineto the minimum relative deadline of tasks is a constant.

A very straightforward extension for the minimum costsynthesis problem is to consider its dual version, in whicha sporadic real-time task τi is specified with its contri-bution to the system profit πi(k) and its worst-case exe-

cution time Cπi(k)i for its k-th implementation, in which

πi(1) < πi(2) < · · · < πi(wi) and Cπi(1)i > C

πi(2)i >

· · · > Cπi(wi)i . The objective for this dual version is to max-

imize the system profit for the selected versions under thegiven timing constraints. Such a maximization version issimilar to Q-RAM (QoS-based Resource Allocation Model)[21], which was defined when Di = Ti for each τi in thetask set. Based on the definition, it is very simple to defineθi(k) as πi(wi)−πi(k). Then, the system profit maximiza-tion problem with respect to π() is equal to the system costminimization problem with respect to θ(). As the results inSection 3 and Section 4 do not make any approximation forthe system cost, they can be directly applied with (1, 2

1−η )-

approximation for FP and (1, 1.63221−η )-approximation algo-rithm for EDF. Here, an (α, β)-approximation algorithmguarantees to derive a solution with system profit at leastα times of the optimal solution under a β speed augmen-tation factor. The polynomial-time approximation schemein Section 5 can also be applied directly (by changing theILP in (16) and the relaxation in (17) to the correspondingversions for profit maximization), and the analysis of theproof for Theorem 7 only requires some changes to achieve(1− ε, 1 + η)-approximation.

References

[1] AbsInt Angewandte Informatik GmbH. “aiT: worst-case executiontime analyzers”. In: http://www.absint.com/ait (2012).

[2] K. Albers and F. Slomka. “An Event Stream Driven Approximationfor the Analysis of Real-Time Systems”. In: ECRTS. 2004, pp. 187–195.

[3] S. K. Baruah, A. K. Mok, and L. E. Rosier. “Preemptively Schedu-ling Hard-Real-Time Sporadic Tasks on One Processor”. In: IEEEReal-Time Systems Symposium. 1990, pp. 182–190.

[4] C.-W. Chang, J.-J. Chen, W. Munawar, T.-W. Kuo, and H. Falk.“Partitioned scheduling for real-time tasks on multiprocessor em-bedded systems with programmable shared srams”. In: EMSOFT.2012, pp. 153–162.

[5] J.-J. Chen and S. Chakraborty. “Partitioned Packing and Schedu-ling for Sporadic Real-Time Tasks in Identical Multiprocessor Sys-tems”. In: ECRTS. 2012, pp. 24–33.

[6] J.-J. Chen and S. Chakraborty. “Resource Augmentation Boundsfor Approximate Demand Bound Functions”. In: RTSS. 2011,pp. 272–281.

[7] J.-F. Deverge and I. Puaut. “WCET-Directed Dynamic ScratchpadMemory Allocation of Data”. In: ECRTS. 2007, pp. 179–190.

[8] F. Eisenbrand and T. Rothvoß. “EDF-schedulability of Syn-chronous Periodic Task Systems is coNP-hard”. In: SODA. 2010,pp. 1029–1034.

[9] F. Eisenbrand and T. Rothvoß. “Static-Priority Real-Time Schedu-ling: Response Time Computation Is NP-Hard”. In: RTSS. 2008,pp. 397–406.

[10] H. Falk and J. C. Kleinsorge. “Optimal static WCET-aware scratch-pad allocation of program code”. In: DAC. 2009, pp. 732 –737.

[11] N. Fisher and S. K. Baruah. “A Fully Polynomial-Time Approxi-mation Scheme for Feasibility Analysis in Static-Priority Systemswith Arbitrary Relative Deadlines”. In: ECRTS. 2005, pp. 117–126.

[12] O. H. Ibarra and C. E. Kim. “Fast Approximation Algorithms forthe Knapsack and Sum of Subset Problems.” In: J. ACM (1975),pp. 463–468.

[13] S. Kang and A. G. Dean. “DARTS: Techniques and Tools for Pre-dictably Fast Memory Using Integrated Data Allocation and Real-Time Task Scheduling”. In: IEEE Real-Time and Embedded Tech-nology and Applications Symposium. 2010, pp. 333–342.

[14] S. Kang and A. G. Dean. “Leveraging both Data Cache andScratchpad Memory through Synergetic Data Allocation”. In: IEEEReal-Time and Embedded Technology and Applications Symposium(RTAS). 2012, pp. 119–128.

[15] E. L. Lawler. “Fast Approximation Algorithms for Knapsack Prob-lems”. In: Math. Oper. Res. 4.4 (1979), pp. 339–356.

[16] J. P. Lehoczky, L. Sha, and Y. Ding. “The Rate Monotonic Schedu-ling Algorithm: Exact Characterization and Average Case Behav-ior”. In: IEEE Real-Time Systems Symposium. 1989, pp. 166–171.

[17] J. Y.-T. Leung and J. Whitehead. “On the complexity of fixed-priority scheduling of periodic, real-time tasks”. In: Perform. Eval.2.4 (1982), pp. 237–250.

[18] C. L. Liu and J. W. Layland. “Scheduling Algorithms for Multipro-gramming in a Hard-Real-Time Environment”. In: Journal of theACM 20.1 (1973), pp. 46–61.

[19] A. K. Mok. FUNDAMENTAL DESIGN PROBLEMS OF DIS-TRIBUTED SYSTEMS FOR THE HARD-REAL-TIME ENVIRON-MENT. Tech. rep. Cambridge, MA, USA, 1983.

[20] B. Patt-Shamir and D. Rawitz. “Vector Bin Packing with Multiple-Choice”. In: 12th Scandinavian Symposium and Workshops on Al-gorithm Theory (SWAT). 2010, pp. 248–259.

[21] R. Rajkumar, C. Lee, J. Lehoczky, and D. Siewiorek. “A resourceallocation model for QoS management”. In: Real-Time SystemsSymposium, 1997. Proceedings., The 18th IEEE. 1997, pp. 298–307.

[22] S. Rehman, A. Toma, F. Kriebel, M. Shafique, J.-J. Chen, andJ. Henkel. “Reliable code generation and execution on unreliablehardware under joint functional and timing reliability considera-tions”. In: IEEE Real-Time and Embedded Technology and Appli-cations Symposium. 2013, pp. 273–282.

[23] J. Reineke, D. Grund, C. Berg, and R. Wilhelm. “Timing pre-dictability of cache replacement policies”. In: Real-Time Systems37.2 (2007), pp. 99–122.

[24] V. Suhendra, T. Mitra, A. Roychoudhury, and T. Chen. “WCETCentric Data Allocation to Scratchpad Memory”. In: RTSS. 2005,pp. 223–232.

[25] V. Suhendra, A. Roychoudhury, and T. Mitra. “Scratchpad alloca-tion for concurrent embedded software”. In: ACM Trans. Program.Lang. Syst. 32.4 (2010).

[26] L. Thiele, S. Chakraborty, and M. Naedele. “Real-time calculus forscheduling hard real-time systems”. In: Circuits and Systems, 2000.Proceedings. ISCAS 2000 Geneva. The 2000 IEEE InternationalSymposium on 4 (2000), pp. 101–104.

[27] R. Wilhelm, J. Engblom, A. Ermedahl, N. Holsti, S. Thesing,D. Whalley, G. Bernat, C. Ferdinand, R. Heckmann, T. Mitra, F.Mueller, I. Puaut, P. Puschner, J. Staschulat, and P. Stenstrom. “Theworst-case execution-time problem-overview of methods and sur-vey of tools”. In: ACM Trans. Embed. Comput. Syst. 7.3 (May2008), 36:1–36:53. ISSN: 1539-9087.

359