1 Feasibility Analysis under Fixed Priority with Limited Preemptions Gang Yao, Giorgio Buttazzo and Marko Bertogna Scuola Superiore Sant’Anna, Pisa, Italy {g.yao, g.buttazzo, m.bertogna}@sssup.it

Abstract—Preemptive scheduling often generates a significant depends on the specific point in which occurs runtime overhead that may increase task worst-case execution and on the number of preemptions experienced by the times up to 40%, with respect to a fully non preemptive execution. task [1], [15], [22]. In small embedded systems, such an extra cost results in longer and more variable response times that can significantly affect the Moreover, to avoid unbounded priority inversion when overall energy consumption, as well as the system predictability. accessing shared resources, preemptive scheduling requires Limiting preemptions is often possible without jeopardizing the implementation of specific concurrency control protocols, schedulability. Although several authors addressed schedulability analysis under different forms of limited preemptive scheduling, such as Priority Inheritance, Priority Ceiling [27], or Stack current results exhibit two major deficiencies: (i) The maximum Resource Policy [2], which introduce additional overhead and lengths of the non-preemptive regions for each task are still complexity, whereas non-preemptive scheduling automatically unknown under fixed priorities; (i) The exact response time prevents unbounded priority inversion. analysis for tasks with fixed preemption points is too complex. On the other hand, fully non-preemptive scheduling is too This paper presents the schedulability analysis of real-time tasks with non preemptive regions, under fixed priority assign- inflexible for certain applications and could introduce large ments. In particular, two different preemption models are consid- blocking times that would prevent guaranteeing the schedula- ered: the floating and the fixed preemption point model. Under bility of the task set. each model, the feasibility analysis is addressed by deriving To overcome such difficulties, different scheduling ap- simple and effective schedulability tests, as well as an algorithm proaches have been proposed in the literature to avoid arbitrary for computing the maximum length of the non-preemptive regions for each task. Finally, simulation experiments are presented to preemptions while limiting the length of non-preemptive exe- compare the two models in terms of schedulability. cution. 1) Fixed Preemption Points (FPP). According to this model, each task is divided into a number of non- I.INTRODUCTION preemptive chunks (also called subjobs) by inserting Most of the schedulability tests available for periodic task predefined preemption points in the task code. If a higher sets have been derived under a fully preemptive model, where priority task arrives between two preemption points of every task can be suspended in any point, and at any time, the running task, preemption is deferred until the next in favor of a task with higher priority. When context switch preemption point. overhead is ignored in the analysis, as done in most scheduling 2) Floating Non-Preemptive Regions (NPR). Another ap- papers, a fully preemptive scheduler is often more efficient proach consists in considering for each task τi a number max in terms of achievable processor utilization. In practice, how- of NPRs, with a maximum length qi , whose location ever, arbitrary preemptions can introduce a significant runtime is unknown. In this model, NPRs can be considered to overhead and may cause high fluctuations in task execution be floating in the task code. times, so degrading system predictability. In particular, three 3) Preemption Thresholds (PT). A different approach for different types of cost need to be taken into account at each limiting preemptions is based on the concept of pre- preemption [15]: emption thresholds, proposed by Wang and Saksena [30] • a scheduling cost σ, due to the time taken by the under fixed priority systems. This method allows a task scheduling algorithm to suspend the running task, insert to disable preemption up to a specified priority, which it into the ready queue, switch the context, and dispatch is called preemption threshold. Each task is assigned the new incoming task; a regular priority and a preemption threshold, and the • a pipeline cost π, due to the time taken to flush the preemption is allowed to take place only when the processor pipeline when the task is interrupted and the priority of arriving task is higher than the threshold of time taken to refill the pipeline when the task is resumed; the running task. This work has been later improved by • a cache-related cost γ, due to the time taken to reload Regehr in [26]. the cache lines evicted by the preempting task. This time It is worth noting that, in the FPP model, the length of the final non-preemptive chunk plays a crucial role for reducing This work has been partially supported by the European Community’s Seventh Framework Programme FP7/2007-2013 under grant agreement no. the task response time. In fact, all higher priority jobs arriving 216008. during the execution of the final chunk of the running task do 2 not cause a preemption, and their execution is postponed at the thus reducing the task response time. However, a long non- end of the task. In the floating NPR model, instead, the exact preemptive region can cause large blocking to higher priority location of each non preemptive region is not known a priori, tasks, possibly jeopardizing the system feasibility. so that a task could be preempted even an arbitrarily small The same example also shows that, under fixed priority amount of time before the end of the execution, increasing assignments, limiting preemptions may also improve schedu- the resulting response time. lability, with respect to fully preemptive scheduling. In fact, From a practical point of view, using fixed preemption if the relative deadline of task τ3 is set to D3 = 7, the points allows achieving higher predictability. In fact, by prop- fully preemptive schedules illustrated in figures 1(a) and erly selecting the preemption points in the code, it is possible 1(b) become infeasible, while the one shown in Figure 1(c), to reduce cache misses and context switch costs, therefore generated by FPP, is still feasible (for any task phase). improving the estimation of preemption overheads and worst- case execution times [15]. In this paper, a simple and effective schedulability test is A. Contributions of the paper derived for both the FPP and the floating NPR models, and an efficient algorithm for computing the maximum length of This work provides multiple contributions. First, a schedula- the non-preemptive regions for each task is also illustrated. bility test is provided for fixed priority systems scheduled with a) Motivating example: Let us consider a task set con- limited preemptions, under the floating NPR model. Using this sisting of three periodic tasks, with relative deadlines equal result, an efficient algorithm is derived to compute, for each to periods. The task set is described as T = {τ1, τ2, τ3} = task, the maximum NPR length that allows all deadlines to be {(1, 4), (1, 6), (4, 12)}, where the first number represents the met. This information can be used with a proper scheduler to task computation time and the second the period. decrease the number of preemptions of each task. Under the FPP model, a new task interface is proposed to τ1 capture the relevant timing parameters that affect schedulabil- 0 4 8 12 ity. A simplified feasibility test is presented for task systems τ2 0 6 12 complying with this interface, by identifying the conditions τ3 under which the feasibility check of a fixed-priority task set 0 12 can be limited only to the first instance of each task. This (a) Fully preemptive case with zero preemption cost. allows deriving a simpler and effective schedulability test, which does not require checking multiple task instances within τ1 0 4 8 12 a certain period, as done in the general case proposed by Bril τ2 et al. [8]. Based on this result, an algorithm for computing a 0 6 12 bound on the NPR length for each task is presented, discussing τ3 0 12 how such a bound varies as a function of the length of the final (b) Fully preemptive case with preemption cost. NPR. This work integrates two previous preliminary results ob- τ1 tained by the same authors for the floating NPR model [31] and 0 4 8 12 τ2 for the FPP model [33]. Moreover, it extends the schedulability 0 6 12 analysis by introducing preemption costs. However, for the τ3 sake of clarity the analysis is first presented without overhead, 0 12 and then extended by introducing preemption costs. (c) Fixed preemption case with final subjob of τ3 long 3.

Fig. 1. Fully preemptive vs. FPP scheduling. B. Paper Organization Assuming a synchronous activation of the task set, the schedule produced by Rate Monotonic in a fully preemptive The rest of the paper is organized as follows. Section II mode (with zero preemption cost) is shown in Figure 1(a). As presents some related work. Section III describes the task clear from the figure, τ3 is preempted twice and has a response model and the methodology adopted in the paper. Section IV time equal to 8 units of time. When the preemption cost is not presents the schedulability analysis for the floating NPR negligible, the response time of τ3 in fully preemptive mode model. The FPP model is analyzed in Section V, deriving is higher than 9, since the increased execution time causes τ3 a set of conditions under which the response time analysis to experience an additional preemption from the third instance of fixed priority tasks with given subjob division can be of τ1, as shown in Figure 1(b). However, if the last 3 units of simplified. Section VI illustrates, for both the floating and the τ3 are executed non preemptively, the two preemptions do not fixed preemption point model, the algorithm for computing take place and the response time reduces to 6, as illustrated the maximum NPR length for each task without violating in Figure 1(c). the system feasibility. Considerations regarding the differences This simple example clearly shows that the last chunk between both preemptive models are presented in Section VII. of a task, when executed in non-preemptive mode, can sig- Section VIII reports some simulation results. Finally, Sec- nificantly reduce the interference from higher priority tasks, tion IX states our conclusions and future work. 3

II. RELATED WORK select the preemption points, under the assumption of a fixed preemption cost at each preemption point. Most work on non-preemptive scheduling has typically focused on single- models, where tasks have precedence III. TASK MODEL AND METHODOLOGY relations, are invoked only once, and must be completed before a deadline [13], [14]. Non-preemptive tasks were considered in In this section, we present the task model and the terminol- the Spring Kernel [28], where a heuristic algorithm was used ogy used throughout the paper. to find a feasible schedule or reduce the number of deadline misses. A more general characterization of periodic tasks has A. Task model been considered in [18], [21]. In this model, tasks may have a We consider a set T = {τ , τ ,...,τ } of n periodic or deadline smaller than or equal to the next release time. For this 1 2 n sporadic tasks that have to be executed on a uniprocessor under more general model, Mok [24] has shown that the problem of fixed priority scheduling. Each task τ is characterized by a deciding schedulability of a set of periodic tasks with mutually i worst-case execution time (WCET) C , a relative deadline D , exclusive sections of code is NP-hard. i i and a period (or minimum inter-arrival time) T between two Jeffay et al. [17] showed that non-preemptive scheduling i consecutive releases. Each task consists of an infinite sequence of concrete periodic tasks1 is NP-hard in the strong sense. of jobs τ (k =1, 2,...) with arrival time r and absolute George et al. [16] provided comprehensive feasibility analysis i,k i,k deadline d = r +D . Tasks can be scheduled by any fixed- on non-preemptive scheduling, however, the authors assumed i,k i,k i priority assignment and are indexed by decreasing priority, either a completely non-preemptive or a fully preemptive meaning that τ is the highest priority task. In particular, the model. Davis et al. [12] considered typical applications of 1 following notation is used in the paper: non-preemptive fixed priority scheduling on a CAN bus, and presented the analysis to bound worst-case response times of hp(i)= {τj | ji} lowed only at some predefined points inside the task code, has Tasks can be preempted, but contain a set of non-preemptive been proposed and investigated by Burns [10], who however regions (NPRs) where preemption is disabled and deferred did not address the problem of computing the maximum length until the end of the region. Two kinds of non-preemptive of non-preemptive chunks. Bril et al. [8] further improved regions are considered: the response time analysis under this model. The authors • Floating Non-Preemptive Regions. With this model, the identified a critical situation that may occur in the presence of position of each NPR inside the task code is unknown. non-preemptive regions, deriving the analysis to take such a The only available information is the length qmax of phenomenon into account. In particular, in certain situations, i the longest NPR inside each task. This model has been the execution of the last non-preemptive chunk of a task τ i adopted for instance in [3] for EDF scheduling. can delay the execution of one or some higher priority tasks, • Fixed Non-Preemptive regions. With this model, the exact which can later interfere with the subsequent invocations of τ . i location of each NPR is known, so that the schedulability Identifying such a situation, later referred to as self-pushing analysis can potentially take advantage of it, as done phenomenon, requires a more complex test, since the analysis in [9], [10]. cannot be limited to the first job of each task, but it must be performed on multiple task instances within a certain period. It is worth noting that the first model is more constraining in terms of schedulability, meaning that a feasible task set with Under the floating NPR model, Baruah [3] computed the floating NPRs is also feasible when the NPRs are located in longest non-preemptive interval for each task that does not fixed positions. jeopardize the schedulability of the task set under EDF. Yao The main objective of this work is to compute for each et al. [31] addressed the same problem, but under fixed priorities. Later, Yao et al. [33] extended the analysis under task the longest non-preemptive region that preserves the schedulability with respect to the fully preemptive case. The the FPP model and presented a comparative study to evaluate following notation is used throughout the paper: the impact on schedulability of different limited preemptive max methods [32]. qi denotes the duration of the longest non-preemptive When taking preemption overhead into account, the schedu- region of task τi. max lability analysis becomes more complex, because cache-related Qi denotes the maximum possible value of qi that preemption delays (CRPDs) significantly increase worst-case preserves the feasibility of the task set with respect execution times [19], [29], which in turn affect the total to the fully preemptive case. number of preemptions [25], as clearly illustrated in Figure Bi denotes the blocking time of task τi due to the non- 1(b). Under the FPP model, however, the negative influence preemptive regions of lower priority tasks. Utot denotes the total utilization of the task set, that is, of CRPDs can be alleviated by appropriately selecting the n potential preemption points. In [4], a method is proposed to the sum of all tasks utilizations: Utot = i=1 Ci/Ti. Tasks may access shared resources, provided that each P 1A concrete periodic task is a periodic task that comes with an assigned critical section is confined within an NPR. Preemption cost is initial activation. considered in the schedulability analysis by properly inflating 4 task execution times. For the sake of clarity, however, the possible span of time from the release until the time at which analysis is first presented without overhead and later extended the task starts or resumes its execution after the completion by introducing preemption costs. of Ci units of computation time. The following relation holds, The analysis for the floating model is presented in Sec- by taking the limit from the left-hand side: tion IV, while the analysis for the FPP model is reported in W Ri(Ci) = lim W Oi(x). (6) Section V. The rest of this section briefly recalls the main x↑Ci elements used to perform the analysis. + where W Oi(x) is the smallest t ∈ R that satisfies t B. Request bound function t = x + +1 Cj . (7) Tj Schedulability analysis is performed using the request τj ∈Xhp(i)    bound function RBF(τi,t), defined as the maximum cumulative Notice that, in Equation (7), the only difference with respect execution request that can be generated by jobs of τi within to the worst-case response time is that the ceiling function an interval of length t. In [20], it has been shown that is replaced by the floor plus one. This essential difference t indicates that the response time is computed when the job RBF(τi,t)= Ci. (1) finishes its execution, regardless of whether other higher Ti   priority tasks are released at the end, whereas the occupied The cumulative execution request of a task τi and all higher time also accounts for the higher priority jobs arriving at the priority tasks over an interval of length t is therefore bounded end of the current job’s execution. by: For example, in the schedule illustrated in Figure 1, the W (t)= C + RBF(τ ,t). (2) i i j worst-case response time of τ3 is 8 in Figure 1(a) and 6 in τj ∈Xhp(i) Figure 1(c), whereas its worst-case occupied time is 9 in both A necessary and sufficient schedulability test for fixed cases. priority preemptive tasks was derived by Lehoczky et al. [20], by checking whether for every task τi there exists a value D. Blocking factor t ≤ Di such that Wi(t) ≤ t. This is stated in the following In the presence of non-preemptive regions, Lemma 1 has to lemma [20]. be modified to take into account the additional blocking factor Lemma 1. A fixed-priority task set is feasible under fully Bi that must be considered for each task τi. This blocking factor is equal to the longest NPR belonging to lower priority preemptive scheduling if and only if ∀τi ∈ T , ∃t ≤ Di, such that tasks.

Wi(t) ≤ t. (3) Definition 1. For each task τi, the subjob allowance αi is the length of the longest subjob belonging to lower priority tasks where Wi(t) is defined in Equation (2). in lp(i). That is, The smallest t ∈ R+ that satisfies Equation (3) corresponds α = max qmax. (8) to the worst-case response time W Ri(Ci) of τi. The inequality i k τk∈lp(i) does not need to be evaluated at every t ∈ (0,Di], but only where max for completeness. at those values of t at which RBF has a discontinuity, i.e., qn+1 =0 N {t ∈ [Ci,Di] | t = k · Tj , k ∈ and ∀Tj , j ≤ i}. Moreover, Therefore, the maximum blocking time that τi may experi- Bini and Buttazzo further reduced the number of points to be ence is: + checked to the following set [5]: Bi = lim(αi − ǫ) (9) . ǫ↓o T S(τ ) = P (D ) (4) i i−1 i where ǫ is an arbitrary small number to guarantee that subjob where Pi(t) is defined by the following recurrent expression: from lp(i) actually starts before τi. The downarrow in the equation denotes the right-hand limit and the notation x+ P (t)= {t} 0 stands for max{x, 0}, indicating that the blocking time cannot t (5) Pi(t)= Pi−1 Ti ∪Pi−1(t). ( Ti be negative. The above set T S(τ ) isj referredk  to as the testing set i IV. FLOATING NON-PREEMPTIVE REGIONSMODEL for task τi. The size of T S(τi) is pseudo-polynomial in the parameters of the task set [5]. In the remainder of this paper, The schedulability analysis in the presence of blocking factors has been extended by Bini and Buttazzo in [5], where T S(τi) is used to compute the longest NP region for each task. Theorem 4 can be restated as follows by considering floating NPRs:

C. Worst-case occupied time Theorem 1. A task set T with floating NPRs is schedulable with a fixed priority algorithm if and only if ∀τ ∈ T there As shown by Bril et al. [8], the worst-case response time i exists t ∈ T S(τi) such that W Ri(Ci) of a task τi can be also computed by considering the worst-case occupied time W Oi(Ci), which is the longest Wi(t)+ Bi ≤ t. (10) 5

Notice that condition (10) is necessary and sufficient for the first job of each task, as done in fully preemptive systems, guaranteeing the schedulability when considering floating but it must be checked for multiple jobs within a certain time NPRs, whereas it becomes only sufficient when the regions interval, which introduces significant computation complexity. are fixed. The result of Theorem 1 can be used to determine the maximum amount of blocking a task τi can tolerate without B. Simplifying Conditions missing any of its deadlines. This amount will be called the In this section, we prove that, under the FPP model, the blocking tolerance of task τi and will be denoted with βi. feasibility test can be restricted to the first job of each task, Thus, activated at its critical instant, if the following conditions hold: βi = max {t − Wi(t)}. (11) t∈T S(τi) A1. (Constrained deadlines) Di ≤ Ti . A2. (Preemptive feasibility) The task set is feasible under Computing β with Equation (11) requires the evaluation of i a fully preemptive model. all points in the testing set T S(τi), and has therefore pseudo- polynomial complexity. Notice that these conditions are not restrictive and are ver- ified for most real-time applications. Burns and Wellings also Before showing how the blocking tolerance βi can be used to compute the maximum allowed non-preemptive chunk recognize their relevance in the analysis of non-preemptive length of each task, the following section introduces a sim- tasks [11], although they are not formally used to derive the plified schedulability analysis for the FPP model. Then, the results. information on the length of the last NPR is used to derive a In the following, we formally prove that conditions A1 and larger blocking tolerance than the one given by Equation (11). A2 allow simplifying the feasibility test by restricting the analysis to the first job of each task under the critical instant. We first introduce the concept of Self-Pushing phenomenon V. FIXED PREEMPTION POINTSMODEL and derive a number of properties under such a condition, In the FPP model, each task τi consists of mi non- then we prove the main theorem. preemptive chunks (subjobs), obtained by inserting mi − 1 preemption points in the code. Thus, preemptions can only C. Properties of the self-pushing scenario occur at the subjobs boundaries. The kth subjob has a worst- mi Definition 2. Under fixed-priority scheduling, a self-pushing case execution time qi,k, hence Ci = k=1 qi,k. In particular, phenomenon on a task τi is defined as the condition in which the last subjob of job τi,k is denoted as Fi,k, and its length last P there exists a job τi,k, with k> 1, such that its response time with qi = qi,mi . last is larger than the first job under the critical instant, that is: For task τi, the length qi of the final subjob directly affects its response time. In fact, all higher priority jobs F P P F P P ∃k> 1, Ri,k > Ri,1 . (12) arriving during the execution of τ ’s final subjob do not cause i F P P a preemption, since their execution is postponed at the end of Notice that Ri,k denotes the generic response time of one job while RF P P is the one under critical instance. Now, τi (see the example in Figure 1(c)). i,1 In the schedulability analysis, there is no need to consider assume that there exists a self-pushing phenomenon in task τi F P P F P P last max and let τi,k, k> 1 be the first job such that R > R . the length of all NPRs, but just qi and qi . Therefore, each i,k i,1 task is assumed to be characterized by the following 5-tuple: Let si,k and si,k−1 be the start times of final subjob Fi,k and Fi,k−1, respectively. Such a scenario is illustrated in Figure 2, last max {Ci,Di,Ti, qi , qi }. where the final subjobs are depicted in gray. The following In the following, the superscript P and FPP will be used properties can be derived on time interval [si,k−1,si,k]. to denote that a specific parameter or function refers to the τi,k−1 τi,k preemptive and FPP model, respectively.

T T A. Critical instant i i τi The feasibility check to determine whether a given task τi is ri,k−1 t schedulable under a certain scheduling policy is done under the ri,k worst-case scenario that leads to the largest possible response si,k−1 si,k time. The activation times of the tasks causing the worst-case response time of τi is defined as the critical instant for τi [23]. Fig. 2. The self-pushing phenomenon. When tasks have non-preemptive regions, Bril [7] showed that the critical instant of τi occurs when it is released simul- Property 1. The start time si,k−1 cannot coincide with the taneously with all higher priority tasks, and the longest non- arrival time of tasks from hp(i). preemptive subjob of lower priority tasks starts an infinitesimal Proof: Since Fi,k−1 cannot be preempted during its time before the release of τi. execution, let us consider the start time si,k−1 of Fi,k−1. Bril et al. [8] also showed that, when tasks have non- If a higher priority job arrives when the final subjob Fi,k−1 preemptive regions at the end of their code, the worst-case is about to start, then preemption will take place before the response time may not occur in the first job. Hence, the execution of Fi,k−1; that is, Fi,k−1 will start executing after feasibility of a task set cannot be checked by analyzing only that higher priority job. Hence, the property holds. 6

Property 2. The interval [si,k−1,si,k] is larger than Ti, that τi is t ri,k−1 ri,k si,k − si,k−1 >Ti. Proof: According to the definition of self-pushing, we have F P P last F P P si,k−1 si,k−1+Ti R = si,k + q − ri,k > R . (13) ∗ i,k i i,1 τi,s

Since τ is the first job experiencing self-pushing, for τ ∗ i,k i,k−1 Fig. 3. Synthetic task instance τ . we have i,s F P P last F P P Ri,k−1 = si,k−1 + qi − ri,k−1 ≤ Ri,1 . (14) Under the FPP model, high-priority tasks arriving during Combining Equations (13) and (14), and noticing that ri,k ≥ the execution of the final subjob are deferred to the end of ri,k−1 + Ti, we have the running task. Since their start times are aligned with the

si,k − si,k−1 > ri,k − ri,k−1 ≥ Ti finish time of the current task, the occupied time under the FPP model takes such interferences into account. And since, from which proves the property. Property 3, in [si,k−1,si,k] the processor is executing only Property 3. The processor is always executing jobs from ∗ tasks from hep(i), job τi,s suffers no blocking from lp(i). hep(i) in [si,k−1,si,k]. Therefore, the occupied time for this job under P and FPP ′ Proof: This can be proved by contradiction. Let t ∈ model will be the same, that is: [s ,s ] be the first time instant in which the processor i,k−1 i,k P F P P is not executing tasks from hep(i). Clearly, t′ cannot be Oi (Ci)= Oi (Ci). (16) last in [si,k−1,si,k−1 + q ], since Fi,k−1 starts executing non- i Now, from Property 1, we know that si,k−1 cannot coincide preemptively at si,k−1. Also, since in [ri,k,si,k] τi,k has re- with the arrival of tasks from , hence, the worst-case for ′ hp(i) maining execution to be completed, t cannot be in [ri,k,si,k]. job ∗ is that all tasks from arrive at the same time ′ last τi,s hp(i) Hence, t must be within (si,k−1 + qi , ri,k). All tasks from P ǫ(ǫ ↓ o) after si,k−1 and function W O (x) is left-continuous hp(i) arriving before t′ must get finished before that time, by i at Ci. Using Equation (6), we have: definition of t′. If at or after time instant t′, some tasks from P P P hp(i) and lp(i) are activated or the processor becomes idle, the W Ri (Ci)= W Oi (Ci) >= Oi (Ci). (17) overall interference (including blocking) will certainly be no Now, combining Equations (15), (16) and (17) together: greater than the total delay experienced by the first job (which F P P F P P P is activated at the critical instant). Hence, Ri,k ≤ Ri,1 , W Ri (Ci) >Ti. which contradicts the self-pushing assumption and proves the property. which means that a job with the same parameters as task τi will have response time larger than Ti. This contradicts the assumptions and proves the lemma. D. Simplified feasibility analysis Using Lemma 2, we can prove the following theorem. The following lemma uses the previous properties to show Theorem 2. Given a preemptively feasible task set with that no self-pushing can occur when conditions A1 and A2 constrained deadlines, the task set is feasible under fixed are verified. priority scheduling with FPP, if the first job of each task is Lemma 2. If the task set has constrained deadlines (A1) and is feasible under the critical instant. preemptively feasible (A2), then no self-pushing phenomenon Proof: From Lemma 2, we know that there is no self- can occur under the fixed-priority FPP model. pushing phenomenon when tasks are preemptively feasible

Proof: By contradiction. Assume τi experiences a self- and have constrained deadlines. Hence, for each task τi, the F P P response time of any job τi,k will be no greater than the one pushing and let τi,k (k > 1) be the first job with Ri,k > F P P of the first job at the critical instant. That is, RF P P ≤ RF P P . Ri,1 . We show that this contradicts the preemptive feasibility i,k i,1 or the constrained deadline assumption. Hence, if the first job of each task under the critical instant ∗ is feasible, then all the forthcoming jobs will also be feasible. Consider a “synthetic” job τi,s, consisting of the final subjob ∗ . The theorem follows. Fi,k−1 and job τi,k excluding its final subjob Fi,k, i.e., τi,s = ∗ It is worth pointing out that in the proof of Theorem 2 the Fi,k−1 ∪ (τi,k − Fi,k). Obviously, τi,s has the same execution ∗ value of qlast is never used, meaning that the theorem holds time Ci. Job τi,s is illustrated in Figure 3. We assume this job i independently of the value qlast. arrives at time si,k−1. Since at this time all tasks from hp(i) i are finished and subjob Fi,k−1 can start, the synthetic job will also start upon arrival. E. Sufficient schedulability test for the FPP model From Property 2, the occupied time of this job, denoted as In this section, the result stated in Theorem 2 is used to OF P P (C ), can be expressed as i i derive a test for checking the feasibility of a set of fixed F P P Oi (Ci)= si,k − si,k−1 >Ti. (15) priority tasks under the FPP model. 7

Since the final subjob of each task cannot be preempted by deadline and, from Theorem 2, we conclude the entire task is any other tasks, it will continue to completion once started. feasible under FPP model. Hence the theorem follows. Hence, checking the feasibility of a job is equivalent to Condition (19) does not need to be evaluated at every t ∈ last last checking whether the final subjob can start at least qi units (0,Di − qi ], but only at those values of t at which RBF last of time before the deadline. has a discontinuity, i.e. {t ∈ (0,Di − qi ] | t = k · Tj, k ∈ Taking into account these two effects, the cumulative ex- N and ∀Tj , τj ∈ hp(i)}. Moreover, as we did for Lemma 1, F P P the number of points can be further reduced to the following ecution request under the FPP model, denoted as Wi (t), can be represented as: set [5]: ′ . last T S (τi) = Pi−1(Di − q ). (23) F P P last i Wi (t) = (Ci − qi )+ RBF(τj ,t). (18) where P (t) is defined in Equation (5). τj ∈hp(i) i X Theorem 3 allows finding the maximum length that subjobs last Notice that the execution request of τi’s final subjob (qi ) is of tasks in lp(i) can have without jeopardizing the feasibility F P P excluded in Wi (t). The feasibility condition for the task of τi. Thus, from Equation (19), the blocking tolerance βi for F P P set using Wi (t) and αi is stated in the next theorem. each task τi results Theorem 3. A preemptively feasible task set with constrained F P P (24) βi = max′ {t − Wi (t)}. deadlines and given subjob division is schedulable under fixed t∈T S (τi) priority with FPP, if for each task τi there exists t ∈ (0,Di − As we will prove in Section VII, the value of βi given by last qi ] such that Equation (24) is greater than or equal to the one given by F P P Wi (t)+ αi ≤ t. (19) Equation (11). This means that the blocking tolerances in the floating case cannot be larger than in the FPP case. As where W F P P (t) and α are defined in Equation (18) and (8), i i expected, the FPP model can take advantage of the smaller respectively. response time allowed by the deterministic location of the last

Proof: We first prove the theorem for tasks with αi =0. If NPR, reducing the interference from higher priority tasks. αi =0, e.g., for the lowest priority task τn, the blocking time Similarly to the floating case, the computation of βi requires due to lower priority tasks is zero. Since the non-preemptive the evaluation of a pseudo-polynomial number of points in the execution of subjobs will only possibly reduce the interference testing set. and the blocking time is always zero, hence the feasibility can be verified as in the fully preemptive case, which is feasible VI. LONGEST NON-PREEMPTIVE REGIONS by assumption, independently of Equation (19). Starting with a fully preemptive task set T , which is ∗ When αi > 0, let t be the earliest time that satisfies schedulable with a fixed priority algorithm, this section shows ∗ last Equation (19). Hence, there ∃t ≤ Di − qi and: how to determine, for each task τi, the largest possible NPR preserving system schedulability, both for the floating and the W F P P (t∗)+ α = t∗. i i FPP model. Using Equation (1) and (18), this can be written as: Let Qi be the maximum possible length that any NPR ∗ belonging to τi can have, without jeopardizing the system last t ∗ (Ci + αi − qi )+ Cj = t . feasibility under limited preemption scheduling with fixed Tj τ ∈hp(i) priority. Note that Q is derived without considering the j X   i limitation of the worst-case execution time, hence it can be which is equivalent to: Qi > Ci. P last ∗ W Ri (Ci + αi − qi )= t . (20) Since τ1 is the highest priority task, its longest NPR can be arbitrarily large without making the system unschedulable. Since in this proof all W R and W O functions refer to the Therefore, preemptive model, we omit the P superscript to simplify the Q1 = ∞. notation. The start time of the final subjob of τi is given by last W Oi(Ci + Bi − qi ), where Bi is the actual blocking time The next theorem shows how to derive Qi for the other tasks. given by Equation (9). Hence, we have: Theorem 4. Given a preemptively feasible task set with last last W Oi(Ci + Bi − qi )=lim W Oi(Ci + αi − ǫ − qi ) (21) constrained deadlines, the task set is feasible under fixed ǫ↓0 priority with a limited preemption scheduler if ∀τi,i> 1 According to Equation (6), we have: max . qi ≤ Qi = min {βk}, (25) last last τk∈hp(i) lim W Oi(Ci + αi − ǫ − qi )= W Ri(Ci + αi − qi ) (22) ǫ↓0 where βk is given by Equation (11) in the floating NPR case, Combining Equations (20), (21) and (22) together: and by Equation (24) in the FPP case. last ∗ W Oi(Ci + Bi − qi )= t . Proof: The blocking time experienced by a task τk is ∗ ∗ bounded by Therefore, the final subjob will start at t and finish at t + max last ∗ last Bk = max {qi }. qi . Since t ≤ Di − qi , the first job of τi meets its τi∈lp(k) 8

Since βk is the blocking tolerance of τk, the schedulability of Equation (27) can be rewritten as the task set can be expressed as follows: Qi = min{βi−1,Qi−1} ∀k | 1 ≤ k 1 : qi ≤ min {βk} = Qi, 5 Qi = min{Qi−1,βi−1}; τk∈hp(i) max 6 if qi >Qi then proving the theorem. 7 return “false”

Another way to derive Qi is given by the following corol- 8 Calculate βi using Equation (11) or (24); lary. 9 return “true”;

Corollary 1. Given a preemptively feasible task set with constrained deadlines, the maximum NPR length of each task τi, 2 ≤ i ≤ n, that guarantees feasibility under fixed priority VII. CONSIDERATIONS with floating or fixed preemption points is given by This section presents some considerations on the different

Qi = min{βi−1,Qi−1}, (26) preemption models analyzed in this paper. where Q = ∞, and β can be computed by Equation (11) 1 i−1 A. Maximum allowed NPR lengths in the floating NPR case, and by Equation (24) in the FPP case. As mentioned in the previous sections, the maximum al- lowed non-preemptive chunk length in the FPP case is larger Proof: From Theorem 4, the upper bound on the maxi- than in the floating NPR case. It is worth pointing out that the value of Q for task τ only depends on β (τ ∈ hp(i)), mum NPR length of τi is given by i i j j as expressed in Equation (25). In the FPP case, according to Qi = min {βk}. (27) Equation (18) and (24), the blocking tolerance βi is a function τk∈hp(i) last last of qi . However, qi does not directly affect Qi, but only Noting that the value of βi, which is used to compute Qj (τj ∈ lp(i)). Depending on the knowledge we have on the length of the min {βk} = min βi−1, min {βk} last subjob, three cases can be distinguished: τk∈hp(i) τk∈hp(i−1)   1) The value of qlast is not available. In this case, the guar- and that i antee has to be performed in the worst-case scenario in Qi−1 = min {βk}, τk∈hp(i−1) which τi can be preempted arbitrarily near the end of its 9

last code. This is equivalent of considering qi = limǫ↓0 ǫ, similarly to what is done for a fully preemptive scheduler. as done in the floating non-preemptive model. In this However, since a task can only be preempted at a limited case, the upper bound on the subjob length will be subset of points, a complex analysis is needed to find the float denoted as Qi . worst-case combination of preemption points that leads to last 2) The value of qi is given. In this case, the upper bound, the largest preemption overhead. To simplify the analysis, g denoted as Qi , is computed as described in Section VI. a pessimistic upper bound is typically computed taking the last 3) The value of qi is the maximum possible one. This largest preemption cost ξi among all the instructions, and ∗ is the best case, and the upper bound, denoted as Qi , multiplying it by the maximum number νi of preemptions results to be the highest. a task τi can experience. As mentioned in Section I, ξi last must take into account the cost related to the scheduler ( ), In practice, qi might be limited to a certain value, because σ preemption points cannot be placed at arbitrary positions for to the pipeline flushing (π) and to the cache (γi), hence a number of reasons, depending on the task structure, the ξi = σ + π + γi. presence of critical sections, or the presence of non-preemptive Without further information, the maximum number of pre- ∗ kernel primitives. As a consequence, Qi represents a best- emptions that τi can experience under the floating NPR model max case upper bound for qi , computed to have a reference can be as pessimistic as the one derived in the fully preemptive ∗ max value in the evaluation. In particular, Qi is computed using case. Remember that for the floating model qi is just an Algorithm 2. upper bound on the maximum NPR length, so that a task could even execute in a fully preemptive way. However, if ∗ the scheduler can be modified to disable preemptions at the Algorithm 2: Qi compute occurrence of a preemption request, the following variation of Input: {D , C ,T }, ∀τ ∈ T preemptively feasible and i i i i the floating NPR model can be defined to bound the number Di ≤ Ti ∗ of preemptions independently of the other tasks. Output: Qi , ∀τi ∈ T 1 begin Definition 3 (Preemption-triggered NPR model). Each task 2 β1 = D1 − C1; can run in two modes: Normal and Non-preemptive. When a ∗ 3 Q1 = ∞; task τi starts executing, it runs in Normal mode. As soon as a 4 for i ← 2 to n do higher priority job arrives, the running task switches to Non- ∗ ∗ 5 Qi = min{Qi−1,βi−1}; preemptive mode for at most Qi time-units from the preemption last ∗ 6 qi = min{Qi , Ci}; request. If after this amount of time τi has not finished its 7 Calculate βi using Equation (24); execution, a preemption takes place, and the highest priority task is scheduled for execution. When the preemption cost is not considered, it is easy to Observation 1. Given a preemptively feasible task set with prove that the number of preemptions under the preemption- constrained deadlines, in the FPP model we have that triggered NPR model is upper bounded by ⌈Ci/Qi⌉ − 1. Note that this estimation is independent of the number of ∗ g float Qi ≥ Qi ≥ Qi ≥ 0. tasks in the system, which might be rather large in some Proof: This can be proved by considering the length of practical applications. As showed in [31], under fixed priority ∗ last scheduling, the average value of Qi/Ci is usually greater than the final subjob. For the case of Qi , qi has the largest possible value; for Qfloat, qlast is an arbitrary small number; 0.5 for a ten-tasks system, even under high system utilizations i i 2 g last (90%) . Thus, the number of preemptions can be significantly whereas for Qi , qi has an intermediate value between the two extreme cases. Now, a larger final subjob reduces decreased with this method. the interference from higher priority tasks, allowing a larger When considering preemption costs, the number of preemp- tions νi experienced by a task τi is more difficult to compute, blocking time from lower priority tasks. Since the maximum np subjob length is equal to the minimum blocking tolerance from because the task execution time depends on νi. If Ci denotes hp(i), the observation follows. the WCET of the task when executed non preemptively, then the WCET in the presence of preemption is: np B. Preemption overhead Ci = Ci + νi × ξi. Another difference between the floating and the fixed NPR But, since νi also depends on Ci, there is a circular depen- model is in the impact they have on overall WCET of dency between both parameters. Such a dependency can be each task. The FPP model allows better timing predictability, treated using the following recurrent relation: because the number of points at which a task can be preempted Cnp is fixed and known at compile time. The preemption cost ν0 = i − 1 i Qi can then be upper bounded using suitable timing analysis  l m np s−1 tools that take into account cache-related preemption delays.  C +ξiν  νs = i i − 1 In the floating NPR model, instead, a preemption can take i Qi place anywhere in the task code, so the timing analysis needs l m  to consider the preemption cost at each single instruction, 2In [31], all results are derived ignoring preemption cost. 10

where ξi is the maximum preemption overhead related to task then Ti was computed as Ti = Ci/Ui. The relative deadline Di s s−1 τi. When the iteration converges, νi = νi is the was generated as a random integer in [Ci +0.5·(Ti −Ci),Ti] worst-case estimation. Notice the value Qi is calculated from and the unfeasible task sets under fully preemptive mode were hp(i), hence, it is available if the computation is performed discarded. In all the graphs, each plotted point represents the in decreasing priority order. average value over 1000 randomly generated task sets. Under the FPP model, the maximum number of preemptions is much easier to compute and is equal to the number of A. Experiment 1: maximum NPR length preemption points (mi−1) in the code. A more difficult related problem is instead selecting the fixed preemption points when A first experiment was carried out to evaluate how the length they are not given a priori. The selection can be made at design of the final NPR affects the maximum subjob length for each time based on the information on the preemption overhead task. The test was performed on a set of 10 tasks with total given by timing analysis tools. Suppose the preemption cost utilization Utot =0.9. Figure 4 plots the average ratio Qi/Ci at each program point is known. The designer would like achieved for each task under the three conditions on the last to select the preemption points in an optimal way, so that NPR explained at the beginning of Section VII-A. the chances of finding a feasible solution are maximized. One preliminary result is presented in [4] to select the least number of preemption points, under the assumption of a fixed 2.5 qlast = Max preemption cost at each point. i qlast = Given 2 i qlast = Min C. Increasing schedulability i

This paper considered task sets that are preemptively 1.5 schedulable with fixed priorities, and analyzed the feasibility under limited preemptive scheduling with given NPRs. An interesting question is whether there is a dominance of the 1

limited preemption model with respect to fully preemptive and Average Value of Q over C fully non-preemptive scheduling, when NPRs can be freely 0.5 assigned. It is easy to see that a preemptively feasible task set 0 is also feasible with a limited preemption scheduler, using 1 2 3 4 5 6 7 8 9 10 max Task Index qi = 0, ∀i. Similarly, a task set that is feasible under fully non-preemptive scheduling is also feasible with a limited preemption scheduler, using qmax = C , ∀i. Moreover, there Fig. 4. Average value of Qi/Ci for each task and for different length of i i the final NPR. exist fixed priority task sets that are unfeasible under both fully preemptive and fully non-preemptive scheduling, but can be Simulations were performed under different workloads, successfully scheduled under a limited preemption model. For however, the values obtained under the three conditions re- instance, consider the following example. sulted to be very similar for low utilizations. Note that, Example 1. A task system is composed of two sporadic tasks since Q1 was set to infinity in all the three cases, the g {τ1 = {2, 4}, τ2 = {3, 6}}. It can be easily verified that this curves start from i=2. The value of Qi (intermediate curve) last task set is unfeasible under fixed priority fully preemptive and was computed with Algorithm 1, by setting qi equal to non-preemptive scheduling. However, the task set is feasible min{Ci/2, minj

15 tasks whose total utilization Utot was varied from 0.5 to no information is available on the location of the preemption 0.95 with step 0.05. points, and (ii) the FPP model, in which the location of each Under the floating condition, task τi switches to non- preemption point is specified a priori. The feasibility analysis float preemptive mode for Qi units of time when a higher pri- under FPP has been simplified with respect to the existing ority task arrives, as in the preemption-triggered NPR model. literature, proving that, under given conditions (i.e, preemptive ∗ Under the Qi condition, task τi executes non-preemptively if feasibility and constrained deadlines) guaranteeing the first job ∗ Ci ≤ Qi , otherwise, preemption points are inserted from the of each task is sufficient for the entire task set. Based on ∗ end of task code to the beginning, with intervals long Qi (i.e., this result, an efficient feasibility test was presented. Another ∗ all the subjobs, except the first one, have length equal to Qi ). contribution of this work was the development of an algorithm g For the sake of comparison, in the case of Qi , preemption for computing the maximum subjob length for each task, under ∗ points are inserted in the same way as in the case of Qi , but both the floating and the FPP preemption model. Specific float g float with interval length equal to Qi (Qi = Qi ). Figure 5 analysis has been carried out to investigate how such a value reports the average number of preemptions with respect to the changes as a function of the final subjob length. Experimental fully preemptive case, for the three different scenarios, as a simulations on randomly generated task sets validated the function of the system utilization Utot. proposed approach and provided more quantitative results. As a future work, we plan to exploit the exact preemption position to better estimate the cost of each preemption and 0.35 task worst-case execution time, thus making the system design qlast = Given i more predictable. 0.3 qlast = Min i qlast = Max REFERENCES 0.25 i [1] S. Altmeyer and G. Gebhard. Wcet analysis for preemptive scheduling. In 8th Int. Workshop on Worst-Case Execution Time Analysis, pages 0.2 105–112, Prague, Czech, July 2008. [2] T. P. Baker. Stack-based scheduling of real-time processes. Real-Time 0.15 Systems, 3(1):67–100, March 1991. [3] S. Baruah. The limited-preemption uniprocessor scheduling of sporadic systems. In ECRTS ’05: Proc. of Euromicro Conf. on Real-Time Systems, 0.1 pages 137–144, July 2005. Ratio of Number Preemptions [4] M. Bertogna, G. Buttazzo, M. Marinoni, G. Yao, F. Esposito, and 0.05 M. Caccamo. Preemption points placement for sporadic task sets. In Proceedings of 22nd Euromicro Conference on Real-Time Systems (ECRTS’10), Bruxelles, Belgium, 2010. 0 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 [5] E. Bini and G. C. Buttazzo. Schedulability analysis of periodic fixed Total Utilization priority systems. IEEE Trans. on , 53(11):1462–1473, 2004. [6] E. Bini and G. C. Buttazzo. Measuring the performance of schedulability tests. Real-Time System, 30(1-2):129–154, 2005. Fig. 5. Ratio of number of preemptions with respect to the fully preemptive [7] R. Bril. Specification and Compositional Verification of Real-Time case. Systems. PhD thesis, Technische UniversiteitEindhoven (TU/e), 2004. [8] R. Bril, J. Lukkien, and W. Verhaegh. Worst-case response time As clearly showed in the figure, the size of the last subjob analysis of real-time tasks under fixed-priority scheduling with deferred preemption. Real-Time System, 42(1-3):63–119, 2009. is not a crucial parameter for reducing the number of preemp- [9] R. J. Bril, J. J. Lukkien, and W. F. J. Verhaegh. Worst-case response tions when the task set utilization is low, whereas its influence time analysis of real-time tasks under fixed-priority scheduling with becomes more relevant for higher workloads. In this condition, deferred revisited. In ECRTS ’07: Proc. of Euromicro Conf. on Real- last Time Systems, pages 269–279, 2007. setting qi to the maximum value achieves the least number [10] A. Burns. Preemptive priority based scheduling: An appropriate engi- of preemptions. neering approach. S. Son, editor, Advances in Real-Time Systems, pages It is interesting to point out the subtle differences between 225–248, 1994. g float [11] A. Burns and A. Wellings. Real-Time Systems and Programming Qi and Qi . Under the floating model, each preemption Languages: Ada, Real-Time Java and C/Real-Time POSIX (Fourth float is deferred by Qi units of time, unless the remaining Edition). Addison Wesley Longmain, 2009. execution time of the running task is less than Qfloat. In [12] R. I. Davis, A. Burns, R. J. Bril, and J. J. Lukkien. Controller area i network (CAN) schedulability analysis: Refuted, revisited and revised. the other case, instead, preemption points are inserted at fixed Real-Time System, 35(3):239–272, 2007. g intervals of Qi , hence, each preemption is deferred to the next [13] G. Frederickson. Scheduling unit-time tasks with integer release times g and deadlines. Information Processing Letters, 16(4):171–173, May point and the average deferred time is only around Qi /2. Since g float g 1983. task computation time is fixed and Qi = Qi , the Qi case [14] M. Garey, D. Johnson, B. Simons, and R. Tarjan. Scheduling unit- float time tasks with arbitrary release times and deadlines. SIAM Journal of generates more preemptions than the Qi case, which is validated by the simulation results. Computing, 10(2):256–269, 1981. [15] G. Gebhard and S. Altmeyer. Optimal task placement to improve cache performance. In Proc. of the ACM-IEEE Int. Conf. on Embedded IX. CONCLUSIONS Software, pages 259–268, Salzburg, Austria, 2007. [16] L. George, N. Rivierre, and M. Spuri. Preemptive and non-preemptive In this paper, we considered the problem of analyzing the real-time uniprocessor scheduling. Research Report RR-2966, INRIA, feasibility of a task set with limited preemptions under fixed France, 1996. [17] K. Jeffay, D. Stanat, and C. Martel. On non-preemptive scheduling of priority scheduling. Two different preemption models have period and sporadic tasks. In Proc. of Real-Time Systems Symposium., been considered in detail: (i) the floating NPR model, in which pages 129–139, Dec 1991. 12

[18] E. Lawler and C. Martel. Scheduling periodically occurring tasks on multiple processors. Information Processing Letters, 12(1):9–12, 1981. [19] C.-G. Lee, J. Hahn, Y.-M. Seo, S. L. Min, R. Ha, S. Hong, C. Y. Park, M. Lee, and C. S. Kim. Analysis of cache-related preemption delay in fixed-priority preemptive scheduling. IEEE Trans. on Computers, 47(6):700–713, 1998. [20] J. Lehoczky, L. Sha, and Y. Ding. The rate monotonic scheduling algorithm: Exact characterization and average case behavior. In Proc. of the Real-Time Systems Symposium, pages 166 – 171, CA, USA, Dec 1989. [21] J. Leung and J. Whitehead. On the complexity of fixed-priority schedul- ing of periodic real-time tasks. Performance Evaluation, 2(4):237–250, 1982. [22] C. Li, C. Ding, and K. Shen. Quantifying the cost of context switch. In Proc. of Workshop on Experimental Science, San Diego, California, 2007. [23] C. L. Liu and J. W. Layland. Scheduling algorithms for multiprogram- ming in a hard-real-time environment. Journal ACM, 20(1):46–61, 1973. [24] A.-L. Mok. Fundamental Design Problems of Distributed Systems for the Hard Real-Time Environment. PhD thesis, MIT, USA, 1983. [25] H. Ramaprasad and F. Mueller. Tightening the bounds on feasible preemption points. In RTSS ’06. Proc. of 27th Real-Time Systems Symposium, pages 212–222, Dec. 2006. [26] J. Regehr. Scheduling tasks with mixed preemption relations for robustness to timing faults. In Proc. of the 23rd IEEE Real-Time Systems Symposium, pages 315–326, 2002. [27] L. Sha, R. Rajkumar, and J. P. Lehoczky. Priority inheritance protocols: An approach to real-time synchronization. IEEE Trans. on Computers, 39(9):1175–1185, 1990. [28] J. A. Stankovic and K. Ramamritham. The spring kernel: A new paradigm for real-time systems. IEEE Softw., 8(3):62–72, 1991. [29] J. Staschulat and R. Ernst. Multiple process execution in cache related preemption delay analysis. In Proc. of ACM Int. Conf. on Embedded software, pages 278–286, Pisa, Italy, 2004. [30] Y. Wang and M. Saksena. Scheduling fixed-priority tasks with preemp- tion threshold. In Proc. of Conf. on Embedded and Real-Time Computing Systems and Applications, pages 328–335, 1999. [31] G. Yao, G. Buttazzo, and M. Bertogna. Bounding the maximum length of non-preemptive regions under fixed priority scheduling. In Proceedings of the 16th IEEE International Conference on Embedded and Real-Time Computing Systems and Applications (RTCSA 2009), pages 351–360, Beijing, China, August 24-26, 2009. [32] G. Yao, G. Buttazzo, and M. Bertogna. Comparative evaluation of lim- ited preemptive methods. In Proceedings of the 15th IEEE International Conference on Emerging Technology and Factory Automation (ETFA10), Bilbao, Spain, September 13-16, 2010. [33] G. Yao, G. Buttazzo, and M. Bertogna. Feasibility analysis under fixed priority scheduling with fixed preemption points. In Proceedings of the 16th IEEE International Conference on Embedded and Real- Time Computing Systems and Applications (RTCSA 2010), pages 71–80, Macau, China, August 23-25, 2010.