Real-Time Task Scheduling for Dynamically Variable Voltage Processors
∗Yi-Ping You, Chingren Lee, Jenq-Kuen Lee, Wei-Kuan Shih Department of Computer Science
National Tsing-Hua University Hsinchu, Taiwan
{ypyou, crlee}@pllab.cs.nthu.edu.tw, {jklee, wshih}@cs.nthu.edu.tw
Abstract
With the demands of power-constrained mobile ap- plications and devices, it becomes a crucial and chal- lenging issue to reduce the power consumptions of em- bedded systems. In this paper, we focus on the issue of scheduling problems with variable voltage processor core to optimize power consumption in real-time sys- tems. We model the problem with real-time and on- line problems, and our solution is to incorporate the reservation list scheme for variable voltage schedulings.
Our decision algorithm consists of a variety of selection criteria including the best effort, average computation time, average power consumption, average energy con- sumption, pre-defined threshold value, and weighted hy- brid schemes for scheduling task. We think our scheme gives a comprehensive study for the problem of schedul- ing real-time tasks to reduce energy consumptions.
1. Introduction and Related Work
The demands of power-constrained mobile and em- bedded computing applications increase rapidly. Re- ducing power consumption hence becomes a crucial challenge for today’s software and hardware develop- ers. In CMOS circuits, power is dissipated in a gate when the gate output changes from 0 to 1 or from 1 to 0. Minimization of power dissipation can be considered at algorithmic, architectural, logic and circuit levels [2].
Studies on low power design are abundant in the lit- erature in which various techniques were proposed to
∗ This work was supported in part by National Sci- ence Council under Grant No. NSC-89-2218-E-007-023 and NSC-89-2219-E-007-012 and by Computer & Communica- tions Research Labs, Industrial Technology Research Insti- tute under Grant No. 3XT1200.
synthesize designs with low transitional activities. In this paper, we focus the issue on scheduling problems with variable voltage processor core to optimize power consumption in real-time systems.
Scheduling problems in real-time systems have been largely issued by many researchers [9, 1, 14, 15]. Liu et al. [9] studied the periodic task scheduling and gave an elegant worst case utilization bound for the fa- mous ”rate monotonic” scheduling algorithm. Baruah et al. [1] gave the on-line real-time scheduling which has a nice upper bound. Shih et al. [15, 14] gave sev- eral on-line algorithms for scheduling real-time tasks in the imprecise computation model. However, power- aware real-time systems are addressed lately. En- ergy minimization by scaling voltage was first studied in [18]. Hong et al. [5, 6, 4] proposed several heuristics scheduling and synthesis techniques. Ishihara et al. [7]
presented a scheduling considering switching activties that affect power consumption a lot. Swaminathan et al. [17] presented a novel low-energy earliest-deadline- first(LEDF) scheduling algorithm and applied it to two real-life task sets. Childers et al. [11] integrated compiler-assisted techniques with power-aware systems and presented scheduling techniques. And other re- searchers [16, 10, 13] also presented their approach and gave experiments.
2. Preliminaries
In this Section, we describe the task model, power model, and variable voltage model for systems under- laying the assumptions.
2.1. Task Model
Given a set of n periodic tasks T = {T1, T2, . . . , Tn}. Each task Ti(ci, di, pi, αi) ∈ T is characterized by its computation time ci at reference voltage, hard
deadline di, period pi, and average switching activity αi. The ready (or arrival) time, ai, of the task oc- cur periodically with period pi. Mostly, the deadlines are assumed to be equal to the periods. The switch- ing activity of a task is related to its type and can be obtained by simulation. It acts as an important factor dominating power consumption.
For this paper, tasks are assumed to be non- preemptable so that once a task starts running, no other tasks can be executed until it completes execu- tion.
2.2. Power Model
It is indicated that power dissipation in digital CMOS circuits is composed of three major compo- nents: switching power, short-circuit power, and leak- age power. The switching power, which leads the total power consumption, is given by
P = αCLVdd2fclk,
where α is the switching activity, CL the load capac- itance, Vdd2 the supply voltage, and fclk the clock fre- quency [2]. The most effective way to reduce power consumption is to lower the supply voltage, which has a quadratic dependence on power. However, for any task Ti, reducing the supply voltage increases critical path delay τc and hence computation time ci, which is given by ci = siτc where si is the number of required control cycles. The critical path delay is strongly de- pended on the supply voltage by
τc(Vdd) = k0CL Vdd
(Vdd−VT)2,
where k0 is a constant and VT is the threshold volt- age [2].
For a set of n tasks, we can compute the aver- age power consumption and total energy consump- tion by Paverage=n1Pn
j=1αjCLVdd2
jfclkj and Etotal= Pn
j=1αjCLVdd2jsj, respectively.
2.3. Variable Voltage Model
With a DC-DC switching regulator, the voltage can be adjusted as varying as we want. However, using con- tinuously variable voltage is not feasible since it needs large cost to provide any kinds of stable supply volt- ages. In this paper, we assume that two supply volt- ages are allowed: high voltage VH and low voltage VL. Tasks can be scheduled either at high or low voltage, which is corresponding to different clock frequencies, to reduce the power consumption.
As indicated in [12], the time overhead for a DC- DC switching converter is about 6 micro-second per
transition of voltage. Also, the computation can still continue during the period of varying voltages. Hence, we assume the overhead to be ignored in the proposed scheduling.
3. Variable Voltage Scheduling
It has been known that the scheduling problem of a set of non-preemptable independent tasks on a fixed voltage processor is NP-complete [3]. With reduction techniques, we can easily see the same scheduling prob- lem on a variable voltage processor is NP-hard. To op- timize the power or energy consumption in real-time systems, we propose an heuristic algorithm scheduling tasks by deadlines with variable voltages.
The proposed scheduler maintains a list, called reservation list [15], in which tasks are sorted by dead- lines. Due to the characteristics of periodic tasks, tasks arrive periodically with certain periods, we have knowl- edge of the arrivals and deadlines of tasks in a given interval. In the beginning, all tasks are in the list and sorted by their deadlines. The task with the earliest deadline is then picked to schedule. The scheduler checks if the task is able to execute at a low voltage by deadline without influencing any unscheduled task, which is in the reservation list. It will schedule tasks at low voltage if possible. However, it is usually im- possible to schedule all tasks at low voltage by their deadlines since the computation regions extend while lower voltage being supplied. There are perhaps only some tasks that can be scheduled at low voltage. Thus, deciding which tasks to be scheduled at low voltage de- termines the efficency of processor utilization and the overall power consumption. A good decision derives a good scheduler and minimizes the power or energy consumption. We present several decision algorithms for reducing the power consumptions.
3.1. Scheduling Algorithm
The proposed scheduling algorithm is based on the well-known EDF (Earliest Deadline First) algorithm, which as the name implies always execute that task with earliest deadline [9]. Assume there are n periodic tasks to be scheduled. We first sort tasks in ascending order by deadlines, namely T1, T2, . . . , Tn, and put them in a list, i.e. the reservation list, which keeps unscheduled tasks. And then, extract tasks from the list one by one to schedule. The detailed description of scheduling algorithm is showed in Figure 1.
The slack time δi(V ) means the maximum time in- terval allowed for current task Ti to execute, while all the remaining tasks in the reservation list are sched- uled with supply voltage V . We compare the compu-
Real-Time Scheduling Algorithm with Variable-Voltage Reservation Lists
Input: n unscheduled periodic tasks
Output: Schedule of the n tasks with variable volt- ages
1. Sort tasks by deadlines in ascending order, i.e. T1, T2, ..., Tn.
2. Put them in a list, called reservation list.
Repeat 3-6 while the reservation list is not empty.
3. Remove the first task, namely Ti, which has the earliest deadline from the reservation list.
4. Update the slack time of tasks in the current list with both high and low voltage pseudo scheduler, i.e. δi(VH) and δi(VL).
5. Compute the computation time of Ti at high voltage and that of low voltage, i.e. ci(VH) and ci(VL).
6. Schedule Tiwith the following manners.
- If ci(VL) ≤ δi(VL), schedule Tiat low voltage if possible.
- If δi(VL) < ci(VL) ≤ δi(VH), call decision algo- rithm.
- If ci(VL) > δi(VH) and
- if ci(VH) ≤ δi(VH), schedule Tiat high volt- age.
- if ci(VH) > δi(VH), report possible failures of real-time scheduling.
Figure 1. Reservation list scheduling algo- rithm for variable voltage problems
tation time of task Ti at both high and low voltages, i.e. ci(VH) and ci(VL), with δi(VL) and δi(VH). There are only three conditions: 1) If ci(VL) is smaller or equal than δi(VL), we can schedule task Tiat low volt- age without affecting any task in the future because of no overlaps between task Tiand the unscheduled tasks while those tasks are assumed to be executed at low voltage. 2) ci(VL) is greater than δi(VL) and smaller or equal than δi(VH). If this happens, we call a deci- sion algorithm to decide if task Ti should be scheduled at low or high voltage. It weighs the alternatives to optimize the overall cost, such as power or energy con- sumption. 3) If ci(VL) is greater than δi(VH), it means that it is impossible for task Tito complete jobs at low voltage by its deadline, we can only schedule it at high voltage if the deadline is met. Figure 2 shows the three scenarios.
The computation of slack time of tasks and the deci- sion algorithm used in this algorithm will be described
: Ti at low voltage δi(VL)
δi(VH) (a)
δi(VL) δi(VH)
(b)
δi(VL) δi(VH)
(c)
Figure 2. Scenarios of scheduling taskTi.
shortly in Section 3.2 and 3.3.
3.2. Slack Computation
With the assumption in Section 3.1, suppose that we are now going to schedule task Ti, and hence there are still (n − i) unscheduled tasks, i.e., Ti+1, Ti+2, . . . , Tn, in the reservation list. Recall that the slack time δi(V ) is the maximum period allowed for Ti while the remaining (n−1) tasks are scheduled at supply voltage V . To obtain the information for Ti, we first build a pseudo schedule for the (n − i) tasks in the following behaviors. The (n−i) tasks are scheduled in a reversed way, treating the deadlines as arrivals and the arrivals as deadlines and starting from the point of the latest deadline, i.e. dn the deadline of Tn, by using EDF algorithm [9]. We then record the timing point of the beginning point of the pseudo schedule as λi(V ).
The slack time of the pseudo schedule with supply voltage V can be obtain by the following equation:
δi(V ) = λi(V ) − M ax(ai, fi−1),
where ai is the arrival time of Ti, fi−1 is the finished time of the last task Ti−1, and M ax(a, b) is a function that returns the maximum value between a and b. Fig- ure 3 gives an example of the slack computation. In Figure 3, there are four tasks in the reservation list. In the reservation list, one is done by a pseudo scheduler to schedule tasks by low voltage, and another is done by high voltage scheduler. The slack time δi(VH) or δi(VL) is the time from the finishing time of the last task to the beginning point of the reservation list by each voltage scheduler, respectively.
It should be noted that during the scheduling, we should call exception if any deadline cannot be met when scheduling at high voltage since the forward and backward scheduling are equivalent on the qualifica- tion of time-constrained tasks. If there is no backward schedule, there is also no forward schedule. However, when low voltage is supplied, we ignore deadline misses.
??
??
(a)
??
??
???
???
?
?
??
??
?
?
???
???
???
???
(b)
di+1 di+2 di+3 di+4
δi(VL) δi(VH)
??
Ti+1
??
Ti+2
?
Ti+3
?
Ti+4
Figure 3. Examples of slack computation while schedulingTi. (a) tasks at high voltage (b) tasks at low voltage
3.3. Decision Algorithm
Following the notations in the previous sections, as- sume that we are now scheduling task Ti and the com- putation time of Ti at low voltage, ci(VL), is greater than δi(VL) and smaller or equal than δi(VH). It looks as the finishing time of task Ti at low voltage falls into the region bounded by λi(VL) and λi(VH). To achieve the objective of power or energy optimization, we propose several algorithms to decide if tasks should be scheduled at low or high voltages when weighing trade-offs between tasks. Six approaches are described as follows.
1. RL-FFS (Reservation List with First-come First- serve Scheduling)
As the name implied, this approach provides no cost model for decision. It just schedule the task with the same behavior, scheduling it at low volt- age. Here, we just schedule Ti at low voltage if possible and hence someone behind Ti must be scheduled at high voltage. Since no further de- cision is made, it is efficient to run but may not optimal for power and energy reduction.
2. RL-ACT (Reservation List with Average Compu- tation Time)
When the computation time of Ti at low voltage, ci(VL), is in the case δi(VL) < ci(VL) ≤ δi(VH), we compare ci(VL) with the average computation time of all tasks. Comparing the computation times helps us to figure out if Ti occupies much more time than the others, which means requir- ing more energy. Recall that ci = siτc in Section 2.2. The computation time of Ti depends on si, the number of control cycles required by Ti, while
τc is constant when the supply voltage is fixed.
Therefore, comparing the computation time is just comparing the required control cycles. The av- erage computation time, on the order of average required control cycles, is given by
AV GCT ∼= AV Gs= Xn
j=1
²j sj
k ,
where ²jis 1 if cj(VL) ≤ pj, the period of Tj, and 0 otherwise and k is the number of the tasks whose value of ² is 1. If si > AV Gs, we schedule Ti at low voltage if possible.
3. RL-APC (Reservation List with Average Power Consumption)
As mentioned in Section 2.2, power consumption of a task is computed by αiCLVddi2 fi, where CL, Vddi2 , and fi are constants when comparing cost among tasks with a certain voltage and frequency while the task-dependent parameter, i.e. switch- ing activity αi, dominates the power consump- tion. Therefore, we can treat power consump- tion as switching activity while making compar- ison among tasks. Similarly to the RL-APC, the average power of the tasks is used to guide the scheduling policy. The average of power consump- tion, on the order of switching activity, is given by
AV GP ∼= AV Gα= Xn j=1
²j αj
k ,
where αj is the switching activity of task Tj. We schedule Ti at low voltage if possible while αi >
AV Gα.
4. RL-AEC (Reservation List with Average Energy Consumption)
It is similar to power consumption while the en- ergy consumption is computed by αiCLVdd2isi. The switching activity αi and the required con- trol cycles si determine the energy consumption.
We just compare the product of αi and si among tasks. The average energy consumption is given by
AV GE∼= AV Gα?s= Xn j=1
²j αj sj
k .
If (αi? si) > AV Gα?s, we schedule Ti at low volt- age if possible.
5. RL-PTV (Reservation List with Predefined Threshold Value)
This approach is based on computation time
of tasks with a predefined critical value which determines the supply voltage of tasks. If ci does not cross over the threshold, we schedule Tiat low voltage and high voltage otherwise. The critical value should be an arbitrary value between δi(VL) and δi(VH). We think that it will perform better results if the value is closer to δi(VL) since it may impact less tasks in future while high voltage is supplied to Ti.
6. RL-WHS (Reservation List with Weighted Hybrid Scheme)
In this approach, we use a weighted hybrid scheme that chooses parts of the previous five selectors as the decision maker to decide the supply voltage of task Ti. The scheme is done by voting schemes by running through parts or all of the previous sched- ulers to give the one with most votes for schedul- ing.
4. Experiments and Discussion
In this Section, we extracted the experimental re- sults from a series of more than one hundred tasks that are ones of a CNC(Computerized Numberical Control) machine controller [8]. Our simulated system is based on a microprocessor which can process with two modes:
high supply voltage and low supply voltage. The max- imum operating frequency is assumed as 100MHz at 5V supply voltage and the minimum is 50.8MHz at 3V, where the threshold voltage is 0.5V. The charac- ters of the CNC task set is showed in Table 1. We can easily get the computation time of both high and low voltage by the formular described in Section 2.
T ask ci(5V ) ci(3V ) di pi αi(%) Tsmpl 35µs 68µs 2400µs 2400µs 92
Tcalv 40µs 78µs 2400µs 2400µs 77 Tdist 180µs 350µs 4800µs 4800µs 15 Tstts 720µs 1400µs 4800µs 4800µs 7 Txref 165µs 321µs 2400µs 2400µs 69 Tyref 165µs 321µs 2400µs 2400µs 18
Txctrl 570µs 1108µs 4000µs 9600µs 67
Tyctrl 570µs 1108µs 4000µs 7800µs 34
Table 1. Summary of the CNC task set To evaluate the proposed RL-scheduling algorithm and the decision methods, tasks are periodically re- peated with periods without missing its deadline and the consumed power and energy are measured to eval- uate. The total power consumption is illustrated in Figure 4, where the X-axis represents the total num- ber of tasks to be scheduled. It says the variable volt- age scheduling is about 62% power reduction against
the fixed voltage system. The comparison of results among the six selectors is shown in Figure 5. It seems that the RL-APC algorithms made the better decisions while RL-ACT scheduling is the worst. This is because the RL-APC decides tasks to process at high or low voltage by determining their power consumption while RL-ACT only looks at their computation time. The PTV (Predefined Threshold Value) of RL-PTV is 0.9 (90%), which is considered the modest value according to the results in Figure 6. The value acts a threshold between the ending points of both reservation list to de- cide what voltages should tasks be scheduled. In this experiment, the RL-FFS, RL-APC, RL-AEC, and RL- PTV all shows good results. However, their scheduling resutls may be performed variantly due to the charac- ters of the task set. The RL-WHS, here, deals with the problem by combining those methods together and weighting their decisions. The RL-WHS takes the most used ones as its decision-maker every time it decides.
It almost results good power reductions.
0 200 400 600 800 1000 1200 1400 1600
100 200 400 800 1600 3200 6400 12800
Number of Tasks
Total Power (W)
Fixed Voltage Variable Voltage
Figure 4. Total power consumption of tasks.
0 10 20 30 40 50 60
100 200 400 800 1600 3200 6400 12800
Number of Tasks
Average Power (mW)
RL-FFS RL-ACT RL-APC RL-AEC RL-PTV(0.9) RL-WHS
Figure 5. Average power consumption of tasks.
In this paper, we proposed a heuristic algorithm
38 40 42 44 46 48 50 52 54
100 200 400 800 1600 3200 6400 12800
Number of Tasks
Average Power (mW)
PTV (0.1) PTV (0.2) PTV (0.3) PTV (0.4) PTV (0.5) PTV (0.6) PTV (0.7) PTV (0.8) PTV (0.9)
Figure 6. Average power consumption of tasks with different PTVs.
with incorporation of the reservation list scheme for real-time variable voltage scheduling and also a deci- sion algorithm consists of a variety of selection cri- teria focus on those scheduling problems including the best effort, average computation time, average power consumption, average energy consumption, pre- defined threshold value, and weighted hybrid schemes for scheduling task. We think our scheme gives a com- prehensive study for the problem of scheduling real- time tasks to reduce energy consumptions.
References
[1] S. Baruah, G. Koren, D. Mao, B. Mishra, A. Raghu- nathan, L. Rosier, D. hasha and F. Wang. “On the competitiveness of on-line real-time task scheduling”, Proc. of the 12th Real-Time Systems Symposium, San Antonio, Texas, pp. 106-115, December 1991.
[2] A.P. Chandrakasan, S. Sheng, and R.W. Brodersen,
“Low-Power CMOS Digital Design,” IEEE Journal of Solid-State Circuits, Vol. 27, No.4, pp. 473-484, April 1992.
[3] M. R. Garey and D.S. Johnson, “Computer and Intractability: A Guide to the theory of NP- Completeness,” W. H. Freeman & Co., New York, NY, 1979.
[4] I. Hong, M. Potkonjak, and M. Srivastava, “On-Line Scheduling of Hard Real-Time Tasks on Variable Volt- age Processor,” Proc. of the International Conference on Computer-Aided Design (ICCAD’98), Nov. 1998.
[5] I. Hong, G. Qu, M. Potkonjak, and M. B. Srivastava,
“Power Optimization of Variable Voltage Core-Based Systems,” Proc. of 35th DAC, pp. 176-181, 1998.
[6] I. Hong, G. Qu, M. Potkonjak, and M. B. Srivas- tava, “Synthesis techniques for low-power hard real- time systems on variable-voltage processors,” Proc. of Real-Time Systems Symposium, pp. 178-187, 1998.
[7] T. ISHIHARA, and H. YASUURA, “Voltage Schedul- ing Problem for Dynamically Variable Voltage Proces-
sors,” Proc. of International Symposium on Low Power Electronics and Design (ISLPED’98), August 1998.
[8] N. Kim, M. Ryu, S. Hong, M. Saksena, C.-H. Choi, and H. Shin, “Visual Assessment of a Real-Time System Design: A Case Study on a CNC Controler,” Real- Time Systems Symposium, 1996., 17th IEEE, pp.300- 310, 1996.
[9] C. L. Liu and J. Layland, “Scheduling Algorithms for Multiprogramming in a Hard Read-Time Environ- ment,” Journal of the ACM, vol. 20, pp. 46-61, 1973.
[10] A. Manzak and C. Chakrabarti, “Variable Voltage Task Scheduling for Minimizing Energy or Minimiz- ing Power,” Proc. of the International Conference on Acoustics, Speech and Signal Processing, June 2000.
[11] D. Mosse, H. Aydin, B. Childers, and R. Melhem,
“Compiler-Assisted Dynamic Power-Aware Scheduling for Real-Time Applications,” COLP (Workshop on Compiler and OS for Low Power), Philadelphia, Oct 19, 2000.
[12] Won Namgoong, Mengchen Yu, and Teresa Meng, “A High-Efficiency Variable-Voltage CMOS Dynamic DC- DC Switching Regulator,” IEEE International Solid- State Circuits Conference, pp. 380-381, 1997.
[13] T. Pering, T. Burd, R. Brodersen, “The Simulation and Evaluation of Dynamic Voltage Scaling Algo- rithms,” Low Power Electronics and Design, 1998.
Proceedings. 1998 International Symposium on, pp.76- 81, May 1998.
[14] Wei-Kuan Shih, Jane W. S. Liu, and Jen-Yao. Chung.
Algorithms for scheduling imprecise computations with timing constraints, SIAM J. on Computing, Vol. 20, No. 3. 1991.
[15] Wei-Kuan Shih, Jane W. S. Liu, On-line Algorithm for Scheduling Imprecise Computations, SIAM J. on Computing, Oct(1996). pp. 1105-1121.
[16] Y. Shin and K. Choi, “Power conscious fixed prior- ity scheduling for hard real-time systems,” Proc. De- sign Automation Conference (DAC), pp.134-139, June 1999.
[17] V. Swaminathan and K. Chakrabarty, “Real-time task scheduling for energy-aware embedded systems,”
IEEE Real-Time Systems Symposium W ork − In − P rogressSessions, 2000.
[18] F. Yao, A. Demers, and S. Shenker, “A scheduling model for reduced CPU energy,” Foundations of Com- puter Science, 1995. Proceedings., 36th Annual Sym- posium on, pp.374 -382, June 1995.