Impact of "Idle" Software on Battery Life
Total Page:16
File Type:pdf, Size:1020Kb
Impact of “Idle” Software on Battery Life Manuj Sabharwal, Application Engineer Eunice Chang, Engineering Manager Session ID: EBLS002 Agenda • Importance of Battery Life • Role of Software in Battery Life • Case Study: “Idle” Software Applications Overhead • Tools for Analyzing Power Overhead • Case Studies: Browser, Media Playback, Messaging • Call to Action • Q/A 2 How Critical is Laptop Battery Life and the Impact of Software? 3 Top Mobile Computing Needs Consumers’ Most Desired Laptop Configuration Improvements (Results when end-used named their top 3) Consume Less Energy/Better Battery 66% Better Performance/Improve Speed of … 60% More Storage/Bigger Hard Drive 45% Better Range of Wireless Internet … 40% Make it Lighter 42% Larger Screen/Display 22% Better Appearance/Looks 15% Make it Smaller 13% Source: Internal Worldwide Market Research, 2010 Software Energy-Efficiency • Platform hardware designed with aggressive power management especially when idle (e.g. ACPI, C/Pstates, PCIE ASPM, SATA LPM, etc.) • Software (OS, FW, Drivers) plays important role in platform energy efficiency • Energy-efficient applications, when idle, should have minimal impact on platform power consumption – Ideally, application at idle should consume no additional energy A single ill-behaving application can thwart all of the power management benefits built into system. 5 A Case Study of “Idle” Software Apps 6 Case Study The Measurement System • Intel® Core2 Duo based Mobile Reference Platform • Core i5 T6600 (Dual Core, 2.2 GHz) • Windows* 7, 64-bit • Intel® Solid State Drive • Wired LAN • (Power) Fluke* NetDAQ The Measured Applications Select 25 common applications including: • 4 web browsers • 5 media playback applications • 5 messaging applications • 2 virus scanners 7 Study Results 5 Lower is Better Deep Dive #2 4 3 Deep Dive #3 Deep Dive #1 2 1 Power Over Baseline (Watts) Baseline Over Power 0 ChatMessaging PhotoPhoto VirusAnti-ProductivityProductivity PluginPlug-ins BrowsersBrowsersMediaPlayersMedia Players Virus The Power comparisons shown is based on the Intel® Core™ i5 Mobile Processor using NetDAQ® Fluke ® instrument . Results have been estimated based on internal Intel analysis 8 and are provided for informational purposes only. Any difference in system hardware or software design or configuration may affect actual performance/Power Battery Life Impact 10 UltraThin, 56WHr, 6W Idle 9 Mainstream, 64WHr, 9W Idle 8 0.5W ~45Min 7 6 0.5W Battery Life (Hours) ~20Min 2W 5 ~75Min 4 0 1 2 3 4 5 Additional Power (Watts) Idle power increase has significant battery life impact 9 Deep Dive Detail Methodology • Component Power (CPU, Chipset, HDD, LAN/Wifi) • Software Tools: Hardware, Driver, Operating System, Software Timers, Memory Utilization, ... – Windows* Powercfg – Battery Life Analyzer – Windows* Performance Analyzer Toolkit (aka “xPerf”) 10 Windows* Powercfg • Command-line utility to control the power settings • Inbox with Windows* 7, Leverages ETW • Power Schemes, Hibernate, Standby, Wake Timer / Devices • -ENERGY Option – Platform timers, changes to timers by the application process/dll – Processor Utilization per process – Power Management Settings in Hardware and OS – Needs to run in Administrator Mode, can output raw .etl traces • Attend EBLS003 Mobile Platform Idle Power Optimization – Methodologies and Tools for demo and details Quick & Easy to Identify Common Problems 11 Battery Life Analyzer • New Tool written by Intel • Simple GUI interface • Identify misbehaving drivers, processes, and hardware that prevent the platform from entering low power states • Provides power impact estimate based on an algorithm for each offending piece of hardware/software • Attend EBLS003 Mobile Platform Idle Power Optimization – Methodologies and Tools for demo and details Identify, Analyze, and Summarize – All in one tool 12 Windows* Performance Toolkit - xPerf • Built by Microsoft, Available in Windows* 7 SDK • Leverage ETW (Event Tracing for Windows) Technology • Wide range of OS performance analysis in a trace file – All processes/threads, User + kernel mode, DPCs and ISRs, Scheduling, Disk and file I/O, Memory, Network, … • Some Issues xPerf can help identify: – Responsiveness issues – Long delays in applications, Slow On/Off transitions – High CPU usage, High Disk usage Feature-rich Tool for Detailed Power Performance Analysis 13 Analysis of Two Case Studies 14 Investigation #1 – A Browser Application 5 Other 4.6 7% 4 Chipset 33% CPU Deep Dive #1 3 2.7 60% 2.6 2.4 2.4 2.3 2.1 2.2 2 1.6 1.4 1.4 1 0.8 Power Over Baseline (Watts) Baseline Over Power 0 Chat/VoiPMessaging PhotoEditPhoto VirusScanVirus ProductivityProductivity BrowserBrowser MediaPlayerMedia Players Edit Scan *The Power comparisons shown is based on the Intel® Core™ i5 Mobile Processor using NetDAQ® Fluke ® instrument . Results have been estimated based on internal Intel analysis 15 and are provided for informational purposes only. Any difference in system hardware or software design or configuration may affect actual performance/Power 16 and are provided for informational purposes only. Any difference in system hardware or software design or configuration system software for informationaldifference may or a provideddesign hardware or Any are in purposes only. and Power Package Idle CPU Browser Idle vs. System The Power comparisons shown is based on the Power(W) 0.00 0.50 1.00 1.50 2.00 2.50 3.00 3.50 4.00 System Idle vs. Browser Idle total CPU Package Power CPU Package Idle Idlevs. total Browser System BrowserApplication 1 22 43 64 System Idle System 85 Workload 106 127 148 169 Intel® Core™ i5 Mobile Processor Mobile Intel®Core™ i5 190 211 232 253 System Idle Power 274 295 316 337 using 358 379 NetDAQ 400 421 ® Fluke 442 Platform Power 463 ® instrument. Resultsestimatedhave been internal basedon Intel analysis 484 505 526 12.06 10.12 547 568 Browser IdleBrowser Power ffe 589 ct actualperformance 610 power from System Idle? there is Why an increase in BrowserIdle 631 652 673 Showing browser power consumption Runtime graph for core package power 694 715 736 757 778 CPUPower 799 820 841 1.46 2.63 862 883 904 925 946 967 988 1009 1030 1051 1072 Battery Life Analyzer Analysis Average C State Residency Change - System idle vs. Browser Idle 100 Increase due to Browser Idle 80 I/O controller Operational State operations spends less time 60 activity deep C state 40 Average(%) 20 0 Package0 C0 - C1 Package0 C2 Package0 C3 Package0 C6 Average System idle(%) Average Browser Idle Few Things to Know : • C-states: Collection of Idle State. – The deeper the C-States allows to achieve the low power consumption, but more time is required for the CPU to “wake up”. • Average C-State Residency is average residency in each C-State over period of time • Deeper C-state Residency(C6), more power savings (System Idle) • Periodic activity results in more time spent in C0-states (Browser Idle) 17 Windows* Powercfg Browser setting Timer Tick to 1msec Command line utility giving call stack of module setting timer tick to 1ms 18 Causes: Idle State Power Consumption • Context Switches – Process of storing and restoring state of a CPU – Increase due to OS requires to take control of the CPU to do storing and restoring task. Image Name Context Switches Context Switches – More details on cause of at system idle Browser high context switches on next Platform Activity 53 550 slide System Idle Browser Image Name Calls/sec Calls/sec • System calls hal.dll 64.1 999.9 – Increase in periodic ataport.SYS 3.0 1.0 calls/sec due to ACPI.sys 0.4 0.4 clock interrupts USBPORT.SYS 3.0 2.9 hal.dll: Interrupt Servicing - much higher for application idle 19 Windows* Performance Toolkit - xPerf Analysis for Browser xPerf shows frequent CPU activities for browser app due to many periodic activities Process Timer Interval Remarks Browser.exe 150msec GetMessageW 21msec SendMessage 20msec Sleep Browser Service 4 msec FlushFileBuffers 20 msec WaitForSingleObject() Alternatives? -Optimized Sleep version to give better performance and power. -Use user land locks if possible instead of WaitForSingleObject -Use unbuffered I/O instead of calling FlushFileBuffers Can periodic intervals prolonged and their activities coalesced ? 20 Effect Of Timer-Tick On Browser Application Timer-Tick Value Platform Power CPU Package Power 1msec (Default app Idle) 12.06 2.63 10msec 11.04 1.95 System Idle 10.12 1.46 • Timer-Tick change saves 1.02 Watts of total power at platform level. Out of Box, this browser uses 60 extra minutes battery life at “idle” on a standard 64Whr battery The Power comparisons shown is based on the Intel Core i5- T6600 processor using NetDAQ® Fluke ® instrument. Results have been estimated based on internal Intel analysis and 21 are provided for informational purposes only. Any difference in system hardware or software design or configuration may affect actual performance/Power Analysis • Application appears to be setting a timer interval of 1ms • The total average CPU utilization < 0.2% • Many periodic activity with small intervals causing CPU wakeup by polling drivers Recommendations: • Don’t make the timer tick change request until it’s necessary • Use event driven code rather than polling CPU • Review the necessity of periodic activity and minimize • Use un-buffered I/O instead of calling FlushFileBuffers 22 Investigation #2 – A Playback Application Other 5 Deep Dive #2 4.6 22% CPU 39% 4 Chipset 39% 3 2.7 2.6 2.4 2.4 2.3 2.1 2.2 2 1.6 1.4 1.4 1 0.8 Power Over Baseline (Watts) Baseline Over Power 0 Chat/VoiPMessaging PhotoEditPhoto VirusScanVirus ProductivityProductivity BrowserBrowser MediaPlayerMedia Players Edit Scan *The Power comparisons shown is based on the Intel® Core™ i5 Mobile Processor using NetDAQ® Fluke ® . Results have been estimated based on internal Intel analysis and are 23 provided for informational purposes only. Any difference in system hardware or software design or configuration may affect actual performance/Power Battery Life Analyzer Analysis C-State Package Residency- System Idle vs.