NC STATE UNIVERSITY Feedback EDF Scheduling w Async
NC STATE UNIVERSITY Feedback EDF Scheduling w/ Async. DVS Switching on the IBM Embedded Power. PC 405 LP Frank Mueller North Carolina State University, Center for Embedded Systems Research (CESR) Departments of Computer Science 1
NC STATE UNIVERSITY Embedded Systems • Energy management – battery-constrained embedded systems – vital design constraint • Dynamic Voltage Scaling (DVS) 2
NC STATE UNIVERSITY Dynamic Voltage Scaling (DVS) • Processor core voltage ↑ or ↓ depending on computation demands – V↓ – f↓ • DVS in real time systems – calculate safe operation frequency – guarantee all tasks meet deadlines 3
NC STATE UNIVERSITY Why Power. PC 405 LP? Ø Hardware support for DVS Ø Software support to change voltage – via user-defined operating points • for e. g. , 266 MHz @ 1. 8 V to 33 MHz @ 1 V Ø Ability to execute instructions while frequency/voltage is changed – doesn’t enter sleep mode during frequency/voltage transitions 4
NC STATE UNIVERSITY PPC 405 LP Development Board Ø Embedded Linux variant Ø Fast DVS switching (≤ 200 μs) Ø Two DVS modes – synchronous (blocking) • conventional DVS-capable processors – asynchronous (non-blocking) fhigh flow exec sleep fhigh • execution may proceed during switch flow • unique feature in 405 LP exec 5
NC STATE UNIVERSITY Asynchronous Switching 2 voltage 1 3 current frequency System call for asynchronous switch 2 Voltage ramped up to max 1 – time to reach new voltage level is estimated 3 High-resolution timer interrupt triggered – power management unit reprogrammed – new processor frequency activated – voltage settles in a controlled manner to new operating point 6
NC STATE UNIVERSITY Dynamic Power Management (DPM) Ø Software and hardware components Ø Define stable operating points (freq. /voltage pairs) Ø Support both synchronous and asynchronous DVS 7
NC STATE UNIVERSITY EDF-DVS on PPC 405 LP Ø User-level threads package under Linux Ø Real-time earliest deadline first (EDF) scheduler Ø Several hard real-time software DVS techniques – – – static cycle-conserving look-ahead 1+2 Simple + PID feedback AGR-2 Pillai and Shin, 2001 Zhu and Mueller, 2002 Aydin et al. , 2002 Ø Voltage and current measurements – analog data acquisition board – oscilloscope 8
NC STATE UNIVERSITY Threads Library Ø Kernel-level threads – complex kernel modifications – error-prone – more control over execution Ø User-level threads – – – simplicity of design develop generic and portable threads library facilitate easier debugging less control over execution and resources however, OS background activity minimal 9
NC STATE UNIVERSITY Threads Library Implementation main () Spawn T 1 Spawn T 2 10
NC STATE UNIVERSITY EDF Scheduling period. A Task A A 1 A 2 release A 1 deadline A 1 release A 2 period. B Task B B 1 B 2 B 3 B 4 release B 1 deadline B 1 release B 2 EDF B 1 A 1 B 2 B 3 A 2 EDF schedulability test B 4 time 11
NC STATE UNIVERSITY Example Task Set Task Period WCET Actual Exec Time 1 10 2 1 3 10 4 2 U = α = 2/10+4/10 =0. 8 f = α x fmax = 0. 8 x fmax 12
NC STATE UNIVERSITY Static RT-DVS EDF fmax αfmax static slack α = WC utilization 0≤α≤ 1 dynamic slack 13
NC STATE UNIVERSITY Cycle-Conserving RT-DVS EDF fmax αfmax static slack α = WC utilization 0≤α≤ 1 dynamic slack 14
NC STATE UNIVERSITY Look-Ahead RT-DVS EDF fmax αfmax static slack α = WC utilization 0≤α≤ 1 dynamic slack 15
NC STATE UNIVERSITY Feedback RT-DVS EDF fmax αfmax static slack α = WC utilization 0≤α≤ 1 No remaining dynamic slack 16
NC STATE UNIVERSITY Experimentation Methodology Ø Need to measure voltage/current at a high rate û Multimeters – coarse-grained and low precision ü High frequency analog data acquisition board – current measured as voltage level over a resistor with 1 V drop per 360 m. A Ø Oscilloscope – visualizing voltages and currents – high precision 17
NC STATE UNIVERSITY Valid Frequency/Voltage Pairs Setting 0 1 2 3 4 CPU Frequency (MHz) 33 44 66 133 266 Bus Frequency (MHz) 33 44 66 133 Voltage (volts) 1. 0 1. 1 1. 3 1. 7 18
NC STATE UNIVERSITY DVS Overhead Activity Synchr. DVS Async. DVS Signal handler Overhead 117 -162 μs 8 -20 μs 0. 07 -0. 6 μs 19
NC STATE UNIVERSITY Scheduler Overhead DVS Sched. Static CPU Freq. 33 MHz 217 μs Cc Lookahead PIDfeedback 487 μs 2296 μs 3612 μs 44 MHz 170 μs 366 μs 1714 μs 2943 μs 66 MHz 100 μs 232 μs 1112 μs 1728 μs 133 MHz 52 μs 120 μs 546 μs 801 μs 266 MHz 36 μs 76 μs 229 μs 472 μs 20
NC STATE UNIVERSITY Task Sets Task Set 1 (msec) Task Set 2 (msec) Task Set 3 (msec) Period (Pi) WCET (Ci) 1 2400 600 80 90 12 2 2400 600 320 120 48 18 3 1200 400 40 60 6 21
NC STATE UNIVERSITY Energy Savings of DVS Techniques 22
NC STATE UNIVERSITY Energy Savings of fast DVS modulation 23
NC STATE UNIVERSITY Energy Consumption for 3 Tasks 24
NC STATE UNIVERSITY Energy Consuption for 30 Tasks 25
NC STATE UNIVERSITY Oscilloscope 360 m. A 2 V 2 V 1 V 360 m. A time 1 V 360 m. A 2 V 2 V 1 V time 26
NC STATE UNIVERSITY Conclusions Ø State-of-the-art EDF-DVS on Power. PC 405 LP Ø Measured energy o Differs from simulations o But match trends from simulations Ø Feedback EDF-DVS o better than any other scheme o up to 64% reduced energy, 24% better than others Ø Async. Switching only 1 -5% energy savings Ø First comparative study on actual processor 27
NC STATE UNIVERSITY Acknowledgements Ø Bishop Brock – IBM Research (Austin) – – DPM S/W extension Linux kernel support H/W modifications DVS overhead data Ø IBM Research (Austin) – Power PC 405 LP development board Ø Students – Yifan Zhu – Ajay Dudani – A. Anatharam, A. Mahmoud, R. Venkatesan 28
NC STATE UNIVERSITY Questions? 29
NC STATE UNIVERSITY Backup Slides 30
NC STATE UNIVERSITY Real-Time Scheduler Integration 31
NC STATE UNIVERSITY Worst-Case Timing Analysis t 1 = gettimeofday(); for ( i = 0; I < N; i++); t 2 = gettimeofday(); work(); t 3 = gettimeofday(); for ( i = 0; I < N; i++) work(); t 4 = gettimeofday(); Ø No tool support to derive WCETs of tasks on PPC 405 LP Ø Timing loop computes average execution of N instances of the task taking into account loop overhead and cold cache misses 32
NC STATE UNIVERSITY DVS Overhead Activity Sync. DVS Async. DVS Signal handling Overhead 117 -162 μs 8 -20 μs 0. 07 -0. 6 μs 33
NC STATE UNIVERSITY Oscilloscope – Tight Task Set 360 m. A 2 V 2 V 1 V 360 m. A time 1 V 360 m. A 2 V 2 V 1 V time 34
- Slides: 34