building blocks for embedded power management
TRANSCRIPT
![Page 2: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/2.jpg)
The mission
• Brand new embedded platform• Fresh baseport of linux• Your job, add power management
• Where to begin?
• Focus: Linux kernel
![Page 3: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/3.jpg)
Overview
• No one-size fits all• PM as building blocks
– Strong base: HW features + kernel support– Suspend and Resume– managing idle– DVFS– application frameworks
• With each added block– improved power management– increasing level of effort, complexity
![Page 4: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/4.jpg)
Baby steps: Getting started
• Static tweaking– disable unused features, drivers– timeouts– screen blanking– scale back clocks, voltage
![Page 5: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/5.jpg)
Buidling a Strong Base
• Know your hardware
• HW features– clock hierarchy– voltage/current regulators– voltage domains, clock domains, power domains– platform-specific PM hardware
• Kernel internals– clock framework– NEW: voltage/current regulator framework (today @ 1:30)
![Page 6: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/6.jpg)
Clock framework
• model HW clock tree• track dependencies• maintain usage counts• disable when unused• propagate changes
• drivers must use it !!
![Page 7: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/7.jpg)
Suspend and Resume
• Hardware features– suspend state– retention: memory, registers– configurable wake-up sources
• Kernel features– Suspend/resume infrastructure
• driver notifications• platform hooks: prepare, entry, finish
• Side Benefits– Fast “boot”
![Page 8: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/8.jpg)
Managing idle time
• Customize idle loop• minimize power when idle• nothing to do? take a nap
• Kernel features– Tickless idle (a.k.a dynamic tick)– CPUidle
![Page 9: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/9.jpg)
Different kinds of sleep
• Sleep states, idle states– wakeup latency– increase power savings
• How deep can I sleep?• How long can I sleep?
– use dynamic tick...
![Page 10: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/10.jpg)
Waking up... just to press snooze
• Dynamic tick: tickless idle– No more periodic tick when idle– Only wake for next “event”– Sleep-when-idle can be smarter
• Tools: PowerTOP– who is preventing sleep– /proc/timer_stats
![Page 11: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/11.jpg)
CPUidle: when to be idle
• Platform-specific “driver”:– defines processor idle states by
• power consumption• wakeup latency
– hooks for entering idle states
• Platform independent “governor”– transition decisions
• in-kernel as of 2.6.24 (x86, ACPI only)
![Page 12: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/12.jpg)
DVFS
• Dynamic Voltage and Frequency Scaling (DVFS)• Analyze available “operating points”
– unique set of frequencies, voltages
• Kernel features– clock framework– CPUfreq– policies, governors– notification framework
![Page 13: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/13.jpg)
CPUfreq: managing operating points
• Framework for defining, and managing operating points• standardized interface to applications• platform-specific “driver”• platform-independent “governors”• notification framework• existing set of open-source utilities
![Page 14: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/14.jpg)
Available operating points
• Platform specific code– defines hardware operating points– registers them with CPUfreq– provides hook for setting operating point
• CPUfreq policy: which hardware OPs are “available”– define available set of hardware OPs– dynamic
![Page 15: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/15.jpg)
Governors: when to change
• When to change OP, and to which one?• free to pick from available OPs
– performance: always pick highest OP– powersave: always pick lowest OP– on-demand: based on CPU utilization
• e.g. if average CPU utilization >= 80%, increase OP
– userspace: any user application • sysfs• cpufrequtils
![Page 16: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/16.jpg)
Power Management QoS
• Applications know constraints, requirements– latency, throughput, ...
• Pass them to PM subsystem• PM can be smarter by using constraints
• Examples:– wake-up latency constraints may constrain sleep depth– WiFi: transmitter power can be defined by
latency/bandwith requirements– network: packets/interrupts could be buffered to reduce
power at the expense of latency
![Page 17: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/17.jpg)
Application Frameworks
• Open Hardware Manager (OHM)– addresses embedded– small is beautiful– http://ohm.freedesktop.org/
• Intel PPM (Power Policy Manager)– Mobile & Internet Linux Project (moblin.org)– http://www.lesswatts.org/
![Page 18: Building Blocks for Embedded Power Management](https://reader031.vdocuments.net/reader031/viewer/2022020702/61fb15372e268c58cd59f2ed/html5/thumbnails/18.jpg)
The End