![Page 1: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/1.jpg)
Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems
Written by P. Pillai and K.G. Shin
Presented by Gaurav Saxena
CSE 666 – Real Time Systems
![Page 2: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/2.jpg)
Introduction
Energy consumption is an important issue in embedded systems Mobile and portable device
Laptops, PDA’s
Cellular phones, camcorders
Real Time Dynamic Voltage Scaling (RT-DVS) Reduces Energy consumption by lowering the supply voltage and operating
frequency.
Modify OS’s real-time scheduler and task management service to maintain real-time deadline
![Page 3: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/3.jpg)
Facts
High performance is needed for a small fraction of time, while for the rest of time, a low performance, a low power processor would suffice
Low performance is achieved by lowering the operating frequency of the processor when full speed is not needed.
Processors are based on CMOS Logic - has voltage dependent maximum operating frequency– V α f ( so at lower frequency, the processor can operate at lower voltage)
Energy dissipated per cycle E α V2 (Higher the frequency level, higher the energy consumption)
![Page 4: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/4.jpg)
RT-DVS Algorithms
Static Voltage Scaling EDF
Cycle conserving RT- DVS
Look Ahead RT - DVS
![Page 5: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/5.jpg)
Static Voltage Scaling EDF: Motivation
wc1 wc2 wc3 wc4
Holes in the pre-run schedule imply:
EDF Test:
∑(wci/pi) < 1 at frequency = Fmax
In other words, whenever ∑(wci/pi) < 1 there are holes in the EDF schedule
Next arrival of T1
WCi = worst case computation time @ Fmax
![Page 6: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/6.jpg)
Static Voltage Scaling EDF: exploiting holes
wc1 wc2 wc3 wc4
Next arrival of T1
Pre-run schedule with holes
WCi = worst case computation time @ Fmax
Processor typically idles during holes.
Instead, the holes can be exploited to slowdown the processor to save energy
![Page 7: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/7.jpg)
Static Voltage Scaling EDF
wc1 wc2 wc3 wc4
K*wc1 K *wc2 K * wc3 K * wc4
EDF Test:
∑(wci/pi) < 1 at maximum frequency = Fmax
Static-VS EDF Test:
K* [∑(wci/pi)] = 1 at frequency = Fmax/K
Next arrival of T1
![Page 8: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/8.jpg)
Static EDF: example
Available frequencies: 1.00, 0.75
DT1: 16DT2: 10DT3: 14
DT1: 24DT2: 20DT3: 28
DT1: 16DT2: 20DT3: 28
DT1: 16DT2: 20DT3: 14
3 7 8
4 8
![Page 9: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/9.jpg)
What if (Ci < WCi )??
K*c1 K *c2 K * c3 K * c4
Next arrival of T1
More holes left unexploited
Actual computation time
![Page 10: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/10.jpg)
What if (Ci < WCi )??
K*c1 K *wc2 K * wc3 K * wc4
Next arrival of T1
Actual computation time
Task T1 completes
Slow down all these tasks proportionally
Hole of size = (wc1 – c1)
![Page 11: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/11.jpg)
What if (Ci < WCi )?? (contd..)
K*c1 K’ *wc2 K’ * wc3 K’ * wc4
Next arrival of T1
CPU Cycles are conserved by slowing down the remaining tasks
![Page 12: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/12.jpg)
Cycle Conserving RT-DVS
When a task set completes its first release, compare real execution time with worst case specified initially.
Any idle time in that period can be used to conserve energy
Rescale frequency that avoid idle cycles, surplus time is used to run other remaining tasks at lower frequency
![Page 13: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/13.jpg)
Cycle conserving EDF: Example
Task set @ (Fmax): T1 = (3,6) and T2 = (6,12)U = 3/6 + 6/12 = 1 @ (Fmax)
T1
0 1 3
Frequenc
y
Fm
Time
T2
10
New utilization = 1/6 + 6/12 = 0.67
Finding the right “k”(1*k)/6 + (6*k)/12 = 1
K = (1/0.67)New freq = (0.67) Fmax
![Page 14: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/14.jpg)
DVS-RT Problem Definition
N Tasks each caracterized by: A fixed period Pi
A deadline Di
Worst-case Execution Time (WCET) Ci
Actual Execution Time ACi
Objective: Find the best task scheduling and clock
frequency in order to: Minimizing energy consumption. Meeting all the deadlines.
![Page 15: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/15.jpg)
Task set:
TaskWorst case
computation time
Period/Deadli
ne
Invocation 1
(ac1)
Invocation 2
(ac2)
1 3ms 8ms 2ms 1ms
2 3ms 10ms 1ms 1ms
3 1ms 14ms 1ms 1ms
At freq. : fm
![Page 16: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/16.jpg)
Look-Ahead EDF
Defer as much works as possible and set initially to the minimum possible frequency.
Hence at later stage if a task uses much less than it worst case, deferred work may never be needed.
It ensures that there are sufficient cycles available for each task to meet its deadline after reserving cycles for higher priority jobs.
Best saving of energy.
![Page 17: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/17.jpg)
(a)Plan to defer T3’s execution time until after D1 but, by D3
Look-ahead EDF step 1 of 6
5 10 15ms
D1
0.5
0.75
1.0
freq.
T3
D2 D3
Reservation for T1
Reservation for T2
![Page 18: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/18.jpg)
(b) Find u so as to finish T1 by D1 and T2 by D2
Look-ahead EDF step 2 of 6
5 10 15ms
T2
D1
0.5
0.75
1.0
freq.
T3
D2 D3
Reservation for T1
Reservation for T2T1
T2
![Page 19: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/19.jpg)
(c) u = 0.75, T1 finishes earlier, find new u for T2 to finish by D2
Look-ahead EDF step 3 of 6
5 10 15ms
T2
D1
0.5
0.75
1.0
freq.
T3
D2 D3
Reservation for T1
Reservation for T2T1
T2
t = 2.67
![Page 20: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/20.jpg)
Look-ahead EDF step 4 of 6
5 10 15ms
D1
0.5
0.75
1.0
freq.
T3
D2 D3
Reservation for T1
Reservation for T2T1
t = 4.67
T2
(d) α = 0.5, T2 finishes earlier, enough time until D1, but EDF is work conserving, launch T3 at u = 0.5
![Page 21: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/21.jpg)
Look-ahead EDF step 5 of 6
5 10 15ms
0.5
0.75
1.0
freq.
D2 D3
T1
t = 8.00
Reservation for T2
T1T2 T3
(e) Guess for T1 again,
![Page 22: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/22.jpg)
Look-ahead EDF step 6 of 6
5 10 15ms
0.5
0.75
1.0
freq.
D2 D3
T1
t = 8.00
T1T2 T3 T2 T3
(f) u= 0. 5, every task is dynamically scheduled successfully
![Page 23: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/23.jpg)
Relative performance
schemes
Energy savings Look Ahead EDF
Cycle Conserving EDF
Static Voltage Scaling EDF
![Page 24: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/24.jpg)
Implementation
Scheduler hooking in the kernel
![Page 25: Real- time Dynamic Voltage Scaling for Low- Power Embedded Operating Systems Written by P. Pillai and K.G. Shin Presented by Gaurav Saxena CSE 666 – Real](https://reader037.vdocuments.us/reader037/viewer/2022110319/56649c7b5503460f9492f49c/html5/thumbnails/25.jpg)
References and Credits
Real time dynamic voltage scaling for low power embedded operating systems, P. Pillai and K.G. Shin, in ACM SOSP, pages 89-201, 2001.
Dynamic Voltage Scaling Algorithms for Hard Real Time Systems, Andrea Romei, Università di Pisa
RT- DVS Algorithms by Sungwuk Jung
Energy aware real time systems by G. Sudha Anil Kumar, Iowa State University