Chapter 4 Proposed Low Power Scheduling Algorithm
4.4 Proposed mechanisms: P-LCET and NP-LCET
Before describing our algorithm, we first define the scheduling priority as shown in equation (1): longer task CiDSP to have higher priority. The objective is that we want to find a scheduling solution of tasks with the shortest total execution time.
We propose two different scheduling algorithms: preemptive LECT (P-LCET) and non-preemptive LECT (NP-LCET) with/without consideration of the preemptive policy, which are shown in Fig. 8 and Fig. 9, respectively. In the P-LCET algorithm, a high priority task can preempt the running task with low priority. However, in the NP-LCET algorithm, we need to wait for all the tasks arrived before executing NP-LCET.
Table 2 Example task set.
Task C pre CDSP C post Period T1 10 ms 3 ms 1 ms 40 ms T2 5 ms 5 ms 1 ms 40 ms T3 2 ms 7 ms 1 ms 40 ms
14
(a). An example of P-LCET.
(b). An example of NP-LCET.
Fig. 6 Task scheduling for P-LCET and NP-NCET.
We use an example with three tasks, as shown in Table 2, to illustrate the P-LCET and NP-LCET algorithms. Fig. 6 (a) shows the scheduling result of the P-LCET algorithm. First, task 1 arrives and starts running at t = 0. When task 2 arrives at t = 6, task 2 has a higher priority (5/5) than task 1 (4/3) and it preempts task 1. When task 3 arrives, due to having a higher priority (2/7) than task 2 (3/5), task 2 will be preempted, and the total execution time is 25 ms. In Fig. 6 (b), because the NP-LCET algorithm needs to wait for all the tasks arrived, the execution order of the three tasks is, task 3, task 2 and task 1, based on their scheduling priorities 2/7, 5/5 and 10/3, and the total execution time is 21 ms.
Fig. 6 (b) shows that the scheduling result of NP-LCET has the shortest total execution time of CPU and DSP and the lowest total energy consumption. Although we know that the NP-LCET algorithm has the better scheduling result, it will increase the average waiting time due to waiting for the next task arrived. In embedded real-time
T3
systems, in order to ensure that each task can complete its work before its deadline and avoid having longer average waiting time, we use two different thresholds, called Task-Threshold (TTH) and Timer-Threshold (TTR), to solve these problems, as shown as Fig.
7, where TTH is the bound of tasks number which can wait and be scheduled in the ready queue and TTR is the time interval which can wait until the next task arrival.
Fig. 7 Two thresholds used in the ready queue.
NP-LCET :
Output: Total execution time (TET) and average waiting time (TWT) of tasks.
1. Set TTH and TTR.
16
Output: Total execution time (TET) and average waiting time (TWT) of tasks.
1. for ( i = 1 to n )
Before applying DVS to our proposed algorithms, NP-LCET and P-LCET, we first need to estimate the worst-case utilization Uworst, which can be computed by equation (2), as follows: NP-LCET algorithms, we use the total execution time (TET), average waiting time (TWT) and the worst-case execution time (
∑
= n
i
wi 1
) to derive a frequency adjustment ratio (far), as shown in equations (3) and (4), respectively:
In NP-LCET:
And the operating frequency (f) is set according to equation (5) fmax the task scheduling as shown in Fig. 6 (a), the total energy consumption is 26 mJ. If we use the minimum constant speed, f =Uworst × fmax, and 35/40
operating frequency f =35/40. Notice that by lowering the frequency, the total execution time of tasks will increase. So in Fig. 6 (a), the total execution will become 29.71 ms and the total energy consumption will become 22.75 mJ. Using our P-LCET in Fig. 6 (a), we can
get ( )/ 26/35
f . So the operating frequency can be changed to
40
f ar worst and the total execution time will become 40 ms. The total
energy consumption is 19.31 mJ. In Fig. 6 (b), our algorithm, NP-LCET, can get the shortest total execution time of 21 ms and the average waiting time of 11 ms (T1 = 15 ms, T2 = 10 ms, frequency, the total execution will become 26.25 ms and the total energy consumption will become 16.8 mJ.
18
Chapter 5
Simulation Results and Discussion
5.1 Simulation model
In the simulation, we assume the heterogeneous dual-core can change its operating frequency and supply voltage continuously within its operational ranges, [fmin,fmax] and
] ,
[Vmin Vmax , and all cores need to be execute at the same frequency [8]. The task sets were generated using random parameters with uniform distribution with the following characteristics [5] [6]:
z The number of tasks was chosen as a random variable from 10 to 50.
z Task periods were generated from 10 to 100 ms.
z Tasks which perform at most one DSP request needs to be executed.
z The worst-case execution times were selected in such a way that the worst-case utilization
∑
z CiDSP was generated to be a random variable with uniform distribution in the range of 10% to 80% of tasks.
z TTR was set to 10 ms.
z TTH was ranging from 2 to 6.
In the following discussions, we have normalized all the simulation results of total energy consumption to that of all tasks with the worst-case execution time
∑
=
5.2 Effects of worst-case utilization on total energy consumption
Fig. 10 compares the total energy consumption of NP-LCET under different TTH and of P-LCET under different worst-case utilization Uworst.
z P-LCET reduces the total energy consumption by an average of 8% compared with Kim et al. [6] using minimum constant speed.
z NP-LCET reduces the total energy consumption by an average of 16%, 25%, 20%, compared with Kim et al. [6] using minimum constant speed as TTH was set to be 2, 4, and 6, respectively.
z The result with TTH = 6 has the worse total energy consumption than that with TTH = 4 because higher average waiting time will affect the derivation of f . ar
0
Fig. 10 Total energy consumption under different worst-case utilization.
5.3 Effects of worst-case utilization on average waiting
time
20
z NP-LCET increased the average waiting time by an average of 40%, 71% and 113%, compared with Kim et al. [6], as TTR was set to be 2, 4, and 6, respectively.
z From simulation results, we know that NP-LECT will have more average waiting time due to that NP-LCET needs to wait until the number of arrival tasks is equal to TTR.
0
Fig. 11 Average waiting time under different worst-case utilization.
5.4 Effects of worst-case utilization on deadline miss
Fig. 12 compares the deadline miss of NP-LCET under different TTR and of P-LCET under different worst-case utilization Uworst.
z The percentage of tasks completed before the deadline using NP-LCET decreases slightly when the worst-case utilization increases. This is because that when TTH or the worst-case utilization increases, the average waiting time of each task will also increase. So it will result in the increase of deadline miss.
0.95 0.96 0.97 0.98 0.99 1 1.01
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Worst-Case Utilization
% of Tasks Completed Kim et al. [6]
P-LCET NP-LCET (2) NP-LCET (4) NP-LCET (6)
Fig. 12 Deadline miss under different worst-case utilization.
5.5 Effects of task number on total energy consumption
Fig. 13 compares the total energy consumption of NP-LCET under different TTR and of P-LCET under different task numbers. The worst-case utilization was set to 95%.
z We observed that the total energy consumption improvement of the Kim et al. [6] and P-LCET are almost no change when the number of tasks increases. It is because that the DVS algorithm relies on the worst-case utilization, but not on the task number.
z The total energy consumption improvement using NP-LCET decreases conspicuously when the number of tasks in a task set increases. It is because the task arrival frequency increases duo to lower average waiting time and a lower frequency used.
22
Normalized Total Energy Consumption Kim et al. [6]
P-LCET NP-LCET (2) NP-LCET (6) NP-LCET (4)
Fig. 13 Total energy consumption under different number of tasks.
5.6 Effects of task number on average waiting time
Fig. 14 compares the average waiting time of NP-LCET under different TTH and of P-LCET under different task numbers. The worst-case utilization was set to 95%.
z The average waiting time of NP-LCET algorithms decreased clearly when the number of task increases due to the increased task arrival frequency.
0
Fig. 14 Average waiting time under different number of tasks.
Chapter 6
Conclusions and Future Work
6.1 Concluding remarks
In this thesis, we have presented two efficient low power scheduling techniques, called P-LCET and NP-LCET, for heterogeneous dual-core embedded real-time systems.
Our design approach was motivated by the heterogeneous dual-core architecture, task scheduling and DVS techniques. The main contribution of the P-LCET and NP-LCET is that the two proposed scheduling algorithms for heterogeneous dual-core systems have better power saving and less total execution time than existing approaches. The proposed NP-LCET has better power saving and no preemptive overhead, but has higher average waiting time and deadline misses. The proposed P-LCET has less power saving than NP-LCET, but the average waiting time will be lower and no deadline miss. Besides, the overhead of P-LCET is an increase in the number of preemptions, which results in increased energy consumption and clock cycles. Fortunately, these overheads are usually small enough and can be neglected.
6.2 Future work
In this thesis, the proposed LCET has two different policies, preemptive LCET (P-LCET) and non-preemptive LCET (NP-LCET). We know that to have shorter total execution time and lower total energy consumption for all tasks is using NP-LCET. But it will have higher average waiting time. The other scheduling policy, P-LCET, may not have better power saving than NP-LCET, but the average waiting time will be lower. How to
24
consumption of the integrated approach deserve to further study.
Bibliography
[1] L. Miao, Y. Qi, D. Hou, C. I. Wu, Y. H. Dai, “Dynamic power management and dynamic voltage scaling in real-time CMP systems,” in Proceedings of International Conference on Networking, Architecture, and Storage, pp. 249 – 250, July 2007.
[2] B. Moyer, “Low-power design for embedded processors,” in Proceedings of IEEE, Volume 89, Issue 11, pp. 1576-1587, November 2001.
[3] W. Kim, D. Shin, H. S. Yun, J. Kim and S. L. Min, “Performance comparison of dynamic voltage scaling algorithms for hard real-time systems,” in Proceeding of the Eighth IEEE on Real-Time and Embedded Technology and Applications Symposium, pp. 219 – 228, Sept. 2002.
[4] “Intel dual-core”
http://www.intel.com/technology/itj/2006/volume10issue02/art03_Power_and_Therma l_Management/p02_intro.htm.
[5] P. Gai, L. Abeni and G. Buttazzo, ”Multiprocessor DSP scheduling in system-on-a-chip architectures,” in Proceedings of 14th Euromicro Conference on Real-Time Systems, pp.
231 – 238, June 2002.
[6] K. Kim, D. Kim and C. Park, “Real-time scheduling in heterogeneous dual-core architectures,” in Proceedings of 12th International Conference on Parallel and Distributed Systems, pp. 1 - 6, July 2006.
[7] P. Pillai and K.G. Shin. “Real-time dynamic voltage scaling for low-power embedded operating systems,” in Proceedings of 18th ACM symposium on Operating Systems, pp.
26
[8] Intel multi-core,
http://www.intel.com/technology/itj/2007/v11i4/9-process/6-linux-scheduler.htm.
[9] ACPI spec., http://www.acpi.info/DOWNLOADS/ACPIspec30a.pdf.
[10] M.T. Schmitz, B.M. Al-Hashimi and P. Eles, “Energy-efficient mapping and scheduling for DVS enabled distributed embedded systems,” in Proceedings of Europe Conference and Exhibition on Design, Automation and Test, pp. 514 – 521, March 2002.
[11] J. Luo and J. N, “Static and dynamic variable voltage scheduling algorithms for real-time heterogeneous distributed embedded systems,” in Proceedings of ASP-DAC 2002. 7th Asia and South Pacific and the 15th International Conference on VLSI Design, pp. 719 – 726, Jan. 2002.
[12] OMAP processor,
http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?templateId=6123&navig ationId=11991&contentId=4670.
[13] Freescale i.300-30 processor,
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.300-30&nodeId=
01J4Fsm6cyDbFf.
[14] J. M. Chen, K. Wang and M. H. Lin, “Energy efficient scheduling for real-time systems with mixed workload”, in Proceedings of International Federation for Information Processing, pp. 33–44, Dec. 2007.
[15] Y. Chen, Z. Shao, Q. Zhuge, C. Xue, B. Xiao and E.H.-M. Sha, “Minimizing energy via loop scheduling and DVS for multi-core embedded systems” in Proceedings of 11th International Conference on Parallel and Distributed Systems, pp, 2–6, July 2005.
[16] C. Yuan, S.M. Reddy, I. Pomeranz and B.M. Al-Hashimi, “Battery-aware dynamic voltage scaling in multiprocessor embedded system” in Proceedings of IEEE International Symposium on Circuits and Systems, pp. 616 – 619, May 2005.