battery aware dynamic scheduling for periodic task...

8
Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao 1 , Nicolas Navet 1 , Gaurav Singhal 2 , Anshul Kumar 3 , and G.S Visweswaran 4 1 LORIA-INRIA 2 University of Texas, Austin TRIO TEAM Dept. of Electrical and Computer Engineering {rao, nicolas.navet}@loria.fr [email protected] 3 Indian Institute Of Technology, Delhi 4 Indian Institute Of Technology, Delhi Dept. of Computer Science and Engineering Dept. of Electrical Engineering [email protected] [email protected] Abstract Battery lifetime, a primary design constraint for mobile embedded systems, has been shown to depend heavily on the load current profile. This paper ex- plores how scheduling guidelines from battery models can help in extending battery capacity. It then presents a ’Battery-Aware Scheduling’ methodology for periodi- cally arriving taskgraphs with real time deadlines and precedence constraints. Scheduling of even a single taskgraph while minimizing the weighted sum of a cost function has been shown to be NP-Hard [6]. The pre- sented methodology divides the problem in to two steps. First, a good DVS algorithms dynamically determines the minimum frequency of execution. Then, a greedy algorithm allows a near optimal priority function [5] to choose the task which would maximize slack recov- ery. The methodology also ensures adherence of real time deadlines independent of the choice of the DVS algorithm and priority function used, while following battery guidelines to maximize battery lifetime. Bat- tery simulations carried out on the profile generated by our methodology for a large set of taskgraphs show that battery life time is extended up to 23.3% as compared to existing dynamic scheduling schemes. 1. Introduction Mobile computing has seen a tremendous growth in the last decade. Due to the continuously increas- ing functionality and complex applications being inte- grated with handheld devices, their energy consump- tion has seen a major upswing. However, battery en- ergy densities have not improved as significantly over the years and this has made battery lifetime a major constraint in mobile embedded systems design. Over the last decade a lot of effort has been put in exploring Dynamic Voltage Scaling (DVS) as a solu- tion to the trade-off problem. In a DVS scheme, the supply voltage as well as the frequency of the processor is scaled at run time to minimize energy consumption, while satisfying the required speed constraints. Many hardware and software implementation of voltage scal- ing methods have been proposed. However, most of the early DVS techniques assumed the battery Subsys- tem to be an ideal source of energy which stores or delivers a fixed amount of energy at a constant out- put voltage. However, research has shown that this is not always true and designing to minimize average power consumption does not necessarily lead to opti- mum battery lifetime[13]. In reality, it may not be pos- sible to extract the energy stored in the battery to the full extent as the energy delivered by a battery heavily depends on the load current profile. Initial works in battery-aware scheduling were pri- marily voltage scaling algorithms trying to optimize a cost function derived from varied battery models. Both stochastic [9] and partial differential equation models [8] have been used. In [7] the authors discuss static scheduling for DAG’s in a battery operated multipro- cessor environment using Peukert’s law. [14] describes a high level analytical battery model which has been the basis for most of the works that have followed in this field. Approaches trying to optimize a cost func- tion derived from the battery model, however were not suitable for real time operations as they were compu- tationally intensive and cannot be used in a dynami- 1-4244-0054-6/06/$20.00 ©2006 IEEE

Upload: others

Post on 26-Mar-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Battery Aware Dynamic Scheduling For Periodic Task Graphspapers/ipdps06/pdfs/113-WPDRTS-paper-1.pdf · Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao1, Nicolas

Battery Aware Dynamic Scheduling For Periodic Task Graphs

Venkat Rao1, Nicolas Navet1, Gaurav Singhal2,Anshul Kumar3, and G.S Visweswaran4

1 LORIA-INRIA 2 University of Texas, AustinTRIO TEAM Dept. of Electrical and Computer Engineering

{rao, nicolas.navet}@loria.fr [email protected]

3Indian Institute Of Technology, Delhi 4Indian Institute Of Technology, DelhiDept. of Computer Science and Engineering Dept. of Electrical Engineering

[email protected] [email protected]

Abstract

Battery lifetime, a primary design constraint formobile embedded systems, has been shown to dependheavily on the load current profile. This paper ex-plores how scheduling guidelines from battery modelscan help in extending battery capacity. It then presentsa ’Battery-Aware Scheduling’ methodology for periodi-cally arriving taskgraphs with real time deadlines andprecedence constraints. Scheduling of even a singletaskgraph while minimizing the weighted sum of a costfunction has been shown to be NP-Hard [6]. The pre-sented methodology divides the problem in to two steps.First, a good DVS algorithms dynamically determinesthe minimum frequency of execution. Then, a greedyalgorithm allows a near optimal priority function [5]to choose the task which would maximize slack recov-ery. The methodology also ensures adherence of realtime deadlines independent of the choice of the DVSalgorithm and priority function used, while followingbattery guidelines to maximize battery lifetime. Bat-tery simulations carried out on the profile generated byour methodology for a large set of taskgraphs show thatbattery life time is extended up to 23.3% as comparedto existing dynamic scheduling schemes.

1. Introduction

Mobile computing has seen a tremendous growthin the last decade. Due to the continuously increas-ing functionality and complex applications being inte-grated with handheld devices, their energy consump-tion has seen a major upswing. However, battery en-ergy densities have not improved as significantly over

the years and this has made battery lifetime a majorconstraint in mobile embedded systems design.

Over the last decade a lot of effort has been put inexploring Dynamic Voltage Scaling (DVS) as a solu-tion to the trade-off problem. In a DVS scheme, thesupply voltage as well as the frequency of the processoris scaled at run time to minimize energy consumption,while satisfying the required speed constraints. Manyhardware and software implementation of voltage scal-ing methods have been proposed. However, most ofthe early DVS techniques assumed the battery Subsys-tem to be an ideal source of energy which stores ordelivers a fixed amount of energy at a constant out-put voltage. However, research has shown that thisis not always true and designing to minimize averagepower consumption does not necessarily lead to opti-mum battery lifetime[13]. In reality, it may not be pos-sible to extract the energy stored in the battery to thefull extent as the energy delivered by a battery heavilydepends on the load current profile.

Initial works in battery-aware scheduling were pri-marily voltage scaling algorithms trying to optimize acost function derived from varied battery models. Bothstochastic [9] and partial differential equation models[8] have been used. In [7] the authors discuss staticscheduling for DAG’s in a battery operated multipro-cessor environment using Peukert’s law. [14] describesa high level analytical battery model which has beenthe basis for most of the works that have followed inthis field. Approaches trying to optimize a cost func-tion derived from the battery model, however were notsuitable for real time operations as they were compu-tationally intensive and cannot be used in a dynami-

1-4244-0054-6/06/$20.00 ©2006 IEEE

Page 2: Battery Aware Dynamic Scheduling For Periodic Task Graphspapers/ipdps06/pdfs/113-WPDRTS-paper-1.pdf · Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao1, Nicolas

cally changing environment. In [11], the same authorsalso demonstrated static scheduling techniques usingvoltage scaling for one-time aperiodic tasks based onheuristics derived from their earlier works. [1] pro-poses the extension of the idea to multiprocessor en-vironment.

More recently, there have been attempts to useheuristics derived from battery model for dynamicscheduling of periodic tasks. [17] proposes a dynamictask scheduling algorithm darEDF that tries to main-tain a locally non-increasing current profile for bat-tery lifetime extension. [15] discusses the schedulingof taskgraphs with precedence constraints in multipro-cessor environment and compares the work with earlierapproach in [7].

This paper attempts to develop a better understand-ing of battery awareness by painting an intuitive pic-ture of how the heuristics from battery models ac-tually help in extending battery lifetime.It then ad-dresses a very generic form of battery aware schedulingproblem which aims at scheduling periodically arrivingtaskgraphs in a single processor environment.

The rest of the paper is organized as follows. Sec-tion 2 discusses the previous works in Dynamic Voltagescheduling. Section 3 discusses the battery models andthe guidelines that have been derived from them. Sec-tion 4 discusses the steps involved in scheduling of con-ditional taskgraphs ie frequency setting and decidingon the next task. Section 5 describes the results of thesimulations conducted to compare the various dynamicscheduling algorithms, and to highlight the utility ofthe proposed ”Battery-aware Scheduling” methodol-ogy. Section 7 concludes the paper.

2. Dynamic Voltage Scheduling

Dynamic Voltage Scaling (DVS) has been a key tech-nique in exploiting the hardware characteristics of pro-cessors to reduce energy dissipation by lowering thesupply voltage and operating frequency. A typical sys-tem configuration for a voltage scalable processor isdescribed in figure 1.

Figure 1. System Configuration for a SingleVoltage Scalable Processor

Assuming that the efficiency of the DC-DC con-verter is η and is constant over the range of voltages,

the following equation governs the voltage scaling :

η × Vbat × Ibat = Vproc × Iproc

With the scaling of Vproc by a factor of s, while Vbat isconstant, the current Ibat is scaled by a factor of s3 [1].Thus slack utilization by voltage scaling can greatlyaffect the load profile and battery lifetime.

Although there has been significant amount of workdone in the field of DVS, for an equally diverse rangeof problem definitions, we use this Section to discussthe algorithms we intend to integrate in our method-ology. [10] proposes ”cycle conserving” ccEDF and”lookahead” laEDF DVS algorithms. While ccEDF ad-justs the voltage and clock speed based on run-timevariation in processor utilization alone, laEDF aggres-sively reduces processor frequency and voltage by es-timating the minimum amount of work that needs tobe completed by the next deadline while ensuring allSubsequent deadlines. Both these algorithm returnfrequency fref which is the minimum frequency thesystem needs to be operated before the current dead-line so that no deadlines are violated later, but gen-erally voltage scalable processor can run on a selectedset of frequencies. So, running the processor at exactfref is not always possible. It has been shown thatusing a linear combination of two adjacent availablefrequencies(fi < fref < fi+1) is optimal for realizingthe running of processor at fref [4].

Although laEDF has been shown to perform betterthan ccEDF, we have used ccEDF in our discussiondue to its simplicity and ease of implementation. Inthe simulation Section we have simulated using bothlaEDF and ccEDF and compared their performances.

3. Battery Models and SchedulingGuidelines

Perhaps the most accurate method of modeling abattery is to model the electro-chemical processes thattake place within the battery. This is the approachdescribed in [3]. The result is a numerical solution toa system of partial differential equations. The maindrawbacks of this approach are the long simulationtimes required and the large number of parameters thatneed to be specified. Other approaches aimed at reduc-ing the time complexity of low-level simulation are gen-erally based on constructing an abstract representationof the battery like ([9],[13]).

This Section includes scheduling guidelines derivedfrom the analysis of two different battery models:namely the Kinetic Battery Model [8] and the Diffu-sion Model of [14]. In order to do so, it is necessary

Page 3: Battery Aware Dynamic Scheduling For Periodic Task Graphspapers/ipdps06/pdfs/113-WPDRTS-paper-1.pdf · Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao1, Nicolas

to prove that the battery models point in the same di-rection. The formal coherence of these battery modelshas been proved in [12] but has not been included inthis paper due to space limitation.

An intuitive proof follows: The kinetic batterymodel can be understood as a two well model, com-prising of an available charge well and a bound chargewell. The available charge well supplies to the load di-rectly while the bound charge well cannot do so. How-ever the bound charge well contributes in the replenish-ment (”Recovery Effect”) of the available charge well.The charge transfer between the two wells is governedby the difference in their heights and a rate constant.The battery is said to be discharged when the availablecharge well becomes empty.

(a) Charged State (b) Before recovery

(c) After Recovery (d) Discharged State

electrode electrolyte electroactive species

w

x=0

Figure 2. Diffusion Model from [14]Correspondingly, the diffusion model can be under-

stood as consisting of an infinite number of wells withelectrolyte being consumed by reduction at the elec-trode. Transfer occurs between each of these wells dueto diffusion and the battery is said to be dischargedwhen the well adjacent to the electrode is empty. Inboth the cases it is possible to have charge left in thebattery even though its discharged and its voltage hasfallen below cut off.

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �� � �

Electrode

� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �

� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �� � � �

� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �

� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �� � � � � � � �

� � � � � � � � � � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � � � � � � � � � � � �

infinite wells

c

h2

h1

Ik

ij

R0

Bound charge Available charge

1 − c

2di /dt = −I + k .(h − h )1

dj /dt = − k .(h − h )2 1

Figure 3. Diffusion Model Vs KiBaMSo in essence, the KiBaM is a coarse grain model

where the wells 2-∞ of the infinite well model, havebeen mapped to a single well i.e. the bound chargewell. Figure 3 illustrates the idea.Next, we discusshow the guidelines derived from the battery modelsallow us to achieve our goal. In most of our discussionon how the guidelines help, we would use the KiBaMmodel as it is easier to visualize.

Scheduling Guideline 1A non-increasing discharge current profile isoptimal for maximizing battery lifetime [14]

This guideline implies that a decreasing order ofdischarge current profile is optimal to maximize thecharge that can be extracted from the battery. Thiscan be better understood by taking a look at the 2-wellKiBaM. As mentioned earlier, the rate of the recov-ery phenomenon from bound charge well to availablecharge well is directly proportional to the difference inthe heights of the wells. A large load current leadsto greater difference in the heights and the rate of re-covery is higher. But if we begin with small currentsand successively increase the currents, small recoverytakes place initially. And with sudden large currentsin the end the available charge well is emptied withouttime for recovery while there is still having charge leftin the bound charge well. In the opposite order theinitial high currents lead to depletion of the availablecharge well but still charge remains, while there is rapidrecovery and transfer of charge from bound well. Thesmaller currents in the end give ample time to extractcharge from the bound well as well. In fact, exper-iments have shown that a constant infinitesimal loadcurrent would be able to extract the maximum chargeout of a battery (Rate Capacity Effect) [13].

In terms of voltage scaling, a non-increasing currentprofile implies that we must schedule in a non-increasing order of voltage/clock speed assignments.However such a schedule is not possible for a realtime periodic tasks as we always reduce voltages toutilize slack due to tasks not taking worst case butscale up once a fresh instance of tasks arrive in orderto meet deadlines in worst case. So the best thatcan be achieved is to have a locally non-increasingvoltage/clock speed, ie the voltage assignments andclock speed are non-increasing within one instance oftask arrival.

Scheduling Guideline 2Given a task t to be executed before a deadlined it is better to lower the frequency and executethe task than to leave an idle slot and executeat a higher frequency. [14]

Page 4: Battery Aware Dynamic Scheduling For Periodic Task Graphspapers/ipdps06/pdfs/113-WPDRTS-paper-1.pdf · Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao1, Nicolas

This guideline advocates for the use of any availableslack time for lowering the frequency as far as possi-ble and giving an idle slot only if it cannot be avoided.Any idle slot given would imply that later the pro-cessor would be required to run at a higher frequencyand would consume more energy. This result has beenproved in [14]. This can be understood by realizingthat for extending battery life, it is more important tominimize net charge consumed and secondary to opti-mize charge distribution within the wells.

4. Scheduling of taskgraphs with prece-dence constraints

This Sections deals with solving a general formula-tion of the scheduling problem for a single processorenvironment. The goal is to schedule periodicallyarriving taskgraphs while optimizing battery lifetime.Each taskgraph is a directed acyclic graph (DAG) inwhich each node is associated with a task and eachedge defines the precedence relation between the twotasks. Task graphs considered here are periodic withdeadlines equal to their periods, and all tasks withina taskgraph should be finished by the deadline of thetaskgraph. The problem can be defined as:

Problem Definition: To find a battery efficientschedule for a given a set of periodic tasks graphs(T1, T2, ....Tn) which have corresponding deadlines(D1, D2, .....Dn), where a taskgraph Ti comprises ofany m interdependent nodes, each of which are inthemselves tasks with given worst case computations(wci1, wci2, ......wcim).

In our methodology, we divide the problem into twoaspects. One deals with the global frequency selec-tion (which also determines the current profile) andthe other deals with choosing the local order of tasksso as to optimize the slack recovery, while maintainingthe precedence constraints and deadlines.

The following subsections discuss the individual as-pects of the problem and the choice of solution.

4.1. Selecting Frequency

There are many algorithms based on EDF that canbe employed to select the frequency that would ensuremeeting of all Subsequent deadlines. For the currentdiscussion we have chosen ccEDF from [10] as its an ef-ficient algorithm that is simple and ensures locally non-increasing voltage(and hence current) assignments.

The ccEDF works by initially calculating the utiliza-tion U by summing up the WCi/Di’s for all releasedtaskgraphs. These WCi’s are themselves a sum of allwcj ’s of the nodes of the ith taskgraphs. A frequencyfref is selected such that fref = U × fmax. At thearrival of new taskgraph or at the end of a node inthe running taskgraph the WCi’s are updated, U isrecalculated and a corresponding frequency is selectedagain. The pseudocode for the algorithm is describedbelow.

Algorithm 1 Pseudocode for Frequency setting usingccEDFupon release( Taskgraph Ti )1: WCi =

∑wcij

2: select frequency()upon endofnode( Taskgraph Ti, τij )1: WCi = WCi + acij − wcij

2: select frequency()select frequency ()1: U =

∑WCi/Di

2: fref = U × Fmax return fref

In cases where the jth node of a particular taskgraphTi takes less that worst case computation we updatethe WCi by removing the worst case wcij componentand replacing it by the actual computation taken acij

so as to utilize the knowledge of actual arrival to allowfurther lowering of the frequency. This is done as longas the new instance of the taskgraph Ti is not released,whereupon we switch back to the worst case specifi-cation. Although the algorithms in [10] were meantto schedule individual tasks with no precedence con-straint, we have extended them to handle taskgraphswith precedence constraints.

4.2. Choice of order within EDF

Preemptive Earliest Deadline First(EDF) is an effi-cient scheduling policy for real time periodic tasks thatensures a feasible schedule even up to 100% processorutilization. However given tasks with identical dead-lines, like in the taskgraphs, its possible to have betterslack recovery and utilization for a specific order of ex-ecution. Fig 4 describes a motivational example of thesame. The example describes the execution trace oftwo tasks with identical deadline=10. Task1 has wc=4whereas task2 has wc=6. In the case 1 (A and B) theactual computation is 40% and 60% of wc specificationsfor tasks 1 and 2 respectively. And in case 2 (A andB) they are 60% and 40% of wc specifications respec-tively. The traces set A and B compare the Largest

Page 5: Battery Aware Dynamic Scheduling For Periodic Task Graphspapers/ipdps06/pdfs/113-WPDRTS-paper-1.pdf · Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao1, Nicolas

Task First(LTF) and Shortest Task First(STF) heuris-tics. In case 1 STF gives better slack recovery andutilization, while in case 2 LTF is better.

Figure 4. Example of order affecting slack re-covery

Many such heuristics exist that try to solve thisproblem. [5] describes a near optimal UBS heuristicthat allows the choosing of the order of tasks to min-imize energy cost function for independent tasks withcommon deadline and given worst case specifications.

However, scheduling becomes much more complexfor tasks graphs. Scheduling of even a single task-graph with precedence constraints while minimizingthe weighted sum of a cost function is known to be NP-Hard [6]. In order to simplify, its possible to solve theproblem without taking into account interdependen-cies. Our reduced problem now is to find the schedulefor some m tasks having specified worst case compu-tations with a common deadline minimizing the totalamount of energy consumed. This problem reduces tothe one in [5] which defines a pubs priority functionand the task having the least value of this function isscheduled next.

pubs(o, τk) =Xk

s2o − s2

o,k

where Xk is the estimate of the amount of CPU cyclesthat task(τk) is actually going to require, so is the speedafter the given partial order and so,k is the speed afteradding task τk at the end of the partial order o. Thepartial order o at any point is order of tasks that havebeen executed up till now.

Xk is used to calculate the priority function, andeven if the estimate is wrong no deadlines are violated.However, the accuracy of the estimate, definitely de-termines the optimality of the schedule. If the esti-mate is very accurate then the schedule obtained willbe near optimal (less than 1% of optimal [5]) , but ifthe estimate is bad then the schedule will be more likea random schedule. One can use various techniquesfor accurate estimates of Xk, one of which is to keephistory of previous instances of each task.

After scheduling near optimally for independenttasks with a simple priority function, the idea can beextended to handle tasks with interdependencies. Itwould be optimum to run the various tasks of a singletaskgraph according to the above mentioned pubs, butsince all tasks are not ready to be scheduled, findingan optimum schedule would be a very hard problem.One option is to use this priority function only on theready list of tasks. So, when selecting the next task tobe executed out of tasks in the ready list, we choosethe task having the minimum value of pubs.

This is brings us to the issue of what tasks shouldcomprise of the ready list.Ready list comprising of nodes of one graphonlyA trivial option is to populate the ready list with tasksfrom a single taskgraph with the most imminent dead-line (which have no precedence constraint or whoseconstraints have been satisfied). In other words, theReady list at any point in time would comprise of theindependent tasks from the taskgraph with the earli-est deadline amongst all released taskgraphs. The taskthat has the smallest value of the UBS priority functionamongst the ones in Ready list is executed first. Af-ter the finishing of that task the Ready list is updated.This is a simple solution that allows all deadlines tobe met since we always follow EDF. Simulations showthat this solution yields good results besides being verysimple to implement. However this solution limits thechoice of tasks to be scheduled and is not optimumin slack recovery. A more greedy approach that allowsnodes from other released graphs also in the Ready listsis mentioned below.Ready list comprising of nodes of all releasedgraphsThis solution allows the independent tasks from alltaskgraphs which have been released, to be part of theReady list. The tasks are scheduled according to theUBS priority function like in the previous approach.However since the Ready list does no longer followsthe EDF policy, we need to introduce an additionalfeasibility check before scheduling any particular taskto ensure all deadlines are met. The number of condi-tions that are needed to be checked before schedulingany task out-of-EDF-order depends on its position inthe EDF order. For example no checks are required forscheduling a task that belongs to the taskgraph withthe most imminent deadline. And for a task that be-longs to taskgraph occupying kth position in the EDForder, k-1 conditions have to be checked. This canbe understood by considering the simple fact that exe-cuting a task that belongs to taskgraph occupying thekth position in the EDF order can only jeopardize the

Page 6: Battery Aware Dynamic Scheduling For Periodic Task Graphspapers/ipdps06/pdfs/113-WPDRTS-paper-1.pdf · Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao1, Nicolas

meeting of the deadlines of k-1 taskgraphs before it,since after them the kth taskgraph becomes most im-minent and hence would be executed even in case ofsimple EDF ordering. So k-1 checks are required toensure that the execution of this task would not violatethe deadlines for the taskgraphs which come before it.Each check is a condition that ensures that the amountof computations required to be completed in the worstcase to meet the next deadline is less than or equal tothe time left multiplied by the current fref .

The next task scheduled is the one with the mini-mum pUBS in the Ready list which satisfies the feasibil-ity check. The checks are conducted in the increasingorder of pUBS value and stopped as soon as a validcandidate is found. Use of fref in these checks ensurethat the we are not forced to run at higher frequen-cies even if tasks take their worst case (locally non-increasing voltage assignments). Described below isthe pseudocode for the feasibility check.

Algorithm 2 Pseudocode for the Feasibility Checkfeasibility-check(τi,j , timet, fref)1: flag ← true2: for j = 1 to edf-position(τi,j)-1 do3: sumWC ← 04: if sumWC + WCj + wcij > fref · (Dj − t) then

{tasks in the ready-list are indexed according tothe EDF order}

5: flag ← false6: return flag7: end if8: end for9: return flag

This solution allows more candidates to be reviewedfor the priority function, which in turns allows betterslack recovery and a more efficient schedule. An exam-ple is presented in figure 5. It compares the the exe-cution trace of a set of 3 taskgraphs where taskgraphsT1 has only a single task with wc=5 and D1=20, task-graph T2 also has a single task with wc=5 and D2=50,and taskgraph T3 has 3 tasks each having wc=5 andD3=100. All tasks are released at t=0. The utilizationis 0.5 and hence the fref is set to 0.5 fmax. All taskstake their wcet and hence the fref does not change dur-ing the trace. We assume that tasks from taskgraph3> taskgraph2 > taskgraph1 according the pUBS prior-ity function. The trace depicts how the methodologyallows the execution of released tasks according to pri-ority function without violating deadlines and exceed-ing fref by using the feasibility check. Although inthe example, we have assumed that all tasks take theirwcet, in reality the priority function chooses tasks that

are most likely to take much less than wcet and wouldallow maximum slack recovery and scope for energyminimization.

Figure 5. (a)Trace using Canonical EDF order-ing, (b)Trace using pUBS based ordering us-ing Feasibility check .

Throughout the discussion we have used ccEDF forfrequency setting and pUBS priority function for de-termining the optimal candidate in terms of slack re-covery. However, under certain conditions, other DVSschemes or priority function may be more suitable orefficient. The methodology presented here can be usedwith little or no changes with any frequency settingalgorithm and any priority function without deadlineviolation. The next Section discusses the simulationscarried out and results that underline the utility of ourmethodology.

5. Simulations

C simulations were conducted to compare the var-ious dynamic scheduling algorithms. The DVS en-abled processor simulated supports the following threefrequency-voltage tuples [(0.5GHz,3 V), (0.75GHz,4V),(1.0GHz,5V)]. Task graphs were generated from TGFF[2] with random dependencies and the worst case com-putation of each node was chosen randomly followinga uniform distribution. Utilization of the system waskept to 70%. Actual computation of a task is assumedto be chosen at random between 20% and 100% of theWCET. Different execution profiles for the taskgraphswere generated by the various scheduling algorithms.

Stochastic battery model from [13] was used to es-timate battery life for the profiles generated by var-ious scheduling algorithms. A 1.2V Panasonic AAANiMH battery with a maximum capacity of 2000 mAhwas considered for simulation. This maximum capac-ity also defines the theoretical bound on performanceof the battery and should not be confused with thenominal capacity (which is around 1600mAh for thisbattery).

The maximum capacity of the battery is defined asthe charge delivered by it under infinitesimal load [13].

Page 7: Battery Aware Dynamic Scheduling For Periodic Task Graphspapers/ipdps06/pdfs/113-WPDRTS-paper-1.pdf · Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao1, Nicolas

Similarly the charge in the available well (discussedin Section 3) is defined as the charge that would bedelivered if we were to draw infinite current. We canevaluate these values by plotting a load vs deliveredcapacity curve for the battery and extrapolating theends (see Figure 5).

The first set of simulations compare the performanceof PUBS priority function with the LTF based heuristicpresented in [16] in scheduling single DAG’s generatedfrom Princeton’s TGFF program [2]. The simulationalso compare random schedules, that were generatedby picking up a task randomly every time from theready list, and the optimal schedule (in terms of energyconsumption) calculated using exhaustive search. Theresults were averaged over a number of single DAG’swith varying number of nodes and have been presentedin Table 1.

# of tasks Random1 LTF1 pUBS1

5 1.32 1.25 1.056 1.41 1.29 1.147 1.33 1.27 1.178 1.56 1.44 1.259 1.52 1.26 1.2110 1.35 1.21 1.0911 1.66 1.53 1.2812 1.58 1.39 1.3113 1.57 1.51 1.2214 1.44 1.37 1.2915 1.55 1.51 1.32

Table 1. Energy consumption (normalizedw.r.t optimal schedule) by various schedul-ing policies for different number of tasks ina taskgraph

We have not considered taskgraphs with more than15 tasks because it takes prohibitively long time to findthe optimal schedule by exhaustive search on all feasi-ble schedules.

The second set of simulations are aimed at highlight-ing the utility of allowing independent tasks from allreleased taskgraphs to form the Ready list. They com-pare the resulting energy consumption of the variousordering schemes were tested in scheduling increasingnumber of taskgraphs with nodes varying from 5 to15. All schemes employed laEDF for frequency set-ting. The results have been normalized with respectto near optimal schedule obtained by removing prece-dence constraints within the taskgraphs. It can be seenfrom Figure 6 that as the number of taskgraphs wereincreased, the ordering schemes start diverging from

1Normalized w.r.t optimal schedule

the near optimal. However, the scheme selecting thenext task using pUBS on all released independent tasks,performs closest to the near optimal among all schemescompared.

Figure 6. Energy Consumption for OrderingSchemes Normalized wrt Near-Optimal

The final set of simulations compare the battery life-times and charged delivered by the combination of var-ious scheduling schemes. The scheduling schemes aredefined by the DVS algorithm used for frequency set-ting, the priority function used for choosing the nexttask and the Ready list used(ie if it is populated by in-dependent tasks of the most imminent taskgraph onlyor by all released taskgraphs). The table below de-scribes the schemes and EDF scheduling without anyDVS, laEDF and ccEDF 2 [10] both with random or-dering, ’Battery-aware Scheduling’(BAS-1) with theuse of a pUBS for ordering among independent tasksfrom the most imminent taskgraph and ’Battery-awareScheduling’(Bas-2) with the use of a pUBS for orderingamong independent tasks from all released taskgraphs.

Results were obtained by averaging performance ofthe various algorithms over a large number (100) ofrandom taskgraph sets. It can be observed from theresults in Table 2 that scheduling without any DVSalgorithm, consumes a lot of energy per task, there-fore battery finishes earlier giving very little efficiency.ccEDF and laEDF 2 [10], while being energy efficientare not able to fully utilize the battery capacity, there-fore results in low battery lifetime. The BAS-1 usesa better priority function making it more energy effi-cient, and hence is able to extract a larger amount ofcharge from the battery, extending battery lifetime andperformance. But BAS-2 allows more tasks to be avail-able for consideration for the priority function makingit more effective and resulting in the best battery per-formance.

2Extended to handle Task Graphs

Page 8: Battery Aware Dynamic Scheduling For Periodic Task Graphspapers/ipdps06/pdfs/113-WPDRTS-paper-1.pdf · Battery Aware Dynamic Scheduling For Periodic Task Graphs Venkat Rao1, Nicolas

Scheme DVS Algo. Priority fct Ready list Charge Delivered Battery Life(mAh) (min)

EDF None Random most imminent 1567 74Cycle Conserving ccEDF Random most imminent 1608 101

Look Ahead laEDF Random most imminent 1607 120BAS-1 laEDF pUBS most imminent 1723 137BAS-2 laEDF pUBS all released 1757 148

Table 2. Results of Simulations for different scheduling algorithms when utilization was kept at 70%

6. Conclusion

Energy-autonomous embedded systems have an at-tached finite-capacity energy source - a battery, thatmust be relatively small and light for the embeddedsystem to be mobile. Consequently, the system en-ergy budget is severely limited, and efficient energyutilization becomes one of the key problems in the con-text of battery-powered embedded computing. In thispaper we have presented a Battery-aware SchedulingMethodology that facilitates the combining of a goodDVS algorithm with a heuristic based priority func-tion for scheduling of conditional taskgraphs. Simula-tions carried out on random tasks graphs and the pro-files generated by various algorithms illustrate that ourmethodology performs up to 47% better than ccEDFand upto 23.3% better than laEDF scheduling schemesin terms of battery lifetime. It can result in up to 100%improvement in battery lifetime over systems with noDVS. Since the simulated taskgraphs are periodic, thisis also a good measure of the amount of work that wasdone by the system before the battery was discharged.The methodology presented has also been shown to begeneric, and can be used with little or no changes withany frequency setting algorithm and any priority func-tion without deadline violation.

References

[1] P. Chowdhury and C. Chakrabarti. Battery aware taskscheduling for a system-on-chip using voltage/clockscaling. IEEE Workshop on Signal Processing Systems(SIPS ’02), Oct. 2002.

[2] R. Dick and W. Wolf. Task graphs for free (tgff).http://helsinki.ee.princeton.edu/ dickrp/tgff/.

[3] T. F. Fuller, M. Doyle, and J. S. Newman. Modelingof galvanostatic charge and discharge of the lithiumpolymer insertion cell. J. Electrochem Soc., 140:1526–1533, 1993.

[4] B. Gaujal, N. Navet, and C. Walsh. Shortest pathalgorithms for real-time scheduling of fifo tasks withoptimal energy use. ACM Transactions on EmbeddedComputing Systems, 4(4), 2005.

[5] F. Gruian. Energy Centric Scheduling for Real-TimeSystems. PhD thesis, Lund University, Lund, Sweden,2002.

[6] E. L. Lawler. Sequencing jobs to minimize totalweighted completion time. Annals of Discrete Mathe-matics, pages 75–90, 1978.

[7] J. Luo and N. K. Jha. Battery-aware static schedul-ing for distributed real-time embedded systems. InDAC’01: Proceedings of the 38th conference on De-sign automation, 2001.

[8] J. F. Manwell and J. G. McGowan. Extension of thekinetic battery model for wind/hybrid power systems.Proceedings of EWEC, pages 284–289, 1994.

[9] D. Panigrahi, C. Chiasserini, S. Dey, R. Rao,A. Raghunathan, and K. Lahiri. Battery life estima-tion of mobile embedded systems. In Proceedings ofInternational Conference on VLSI Design, pages 55–63, January 2001.

[10] P. Pillai and K. G.Shin. Real time dynamic voltagescaling for low powered embedded systems. OperatingSystems Review, 35:89–102, October 2001.

[11] D. Rakhmatov and C. Chakrabarti. Battery conscioustask sequencing for portable devices including volt-age/clock scaling. DAC 2002., 2002.

[12] V. Rao and G. Singhal. Integrated power managementfor embedded systems. Bachelors Thesis, Indian In-stitute of Technology, Delhi, 2005.

[13] V. Rao, G. Singhal, A. Kumar, and N. Navet. Batterymodel for embedded systems. In Proceedings of Inter-national Conference on VLSI Design, pages 105–110,January 2005.

[14] S. Vrudhula and D. Rakhmatov. Energy managementfor battery powered embedded systems. ACM Trans-actions on Embedded Computing Systems, pages 277–324, August 2003.

[15] I. P. Y. Chai, S.M Reddy and B. Al-Hashimi. Bat-tery aware dynamic voltage scaling in multiprocessorembedded system. IEEE ISCAS, Japan., 2005.

[16] D. Zhu, R. Melhem, and B. Childers. Scheduling withdynamic voltage/speed adjustment using slack recla-mation in multi-processor real-time systems. IEEEtrans. on Parallel and Distributed Systems, pages 686–700, 2003.

[17] J. Zhuo and C. Chakrabarti. An efficient dynamic taskscheduling algorithm for battery powered dvs systems.In ASPDAC’05: Asia and South Pacific Design Au-tomation Conference, 2005.