andy malone mvp, mct ceo / trainer / consultant quality training (scotland) ltd & dive deeper...
TRANSCRIPT
Windows 7: The Power Management Workout!
Andy Malone MVP, MCTCEO / Trainer / ConsultantQuality Training (Scotland) Ltd &Dive Deeper Technology Events EMEASession Code: CLI321
This Session Will Cover:The Need for Green!Processor Developments inc Core Parking TechnologyWindows Power Management Architecture Using Trigger Start Services, Idle Resource Utilisation, Timer CoalescingEnhanced Power Managements Features: Adaptive display Brightness, Low Power Audio, Bluetooth & Network power Enhancements.Enhancing Notebook & Net book Battery LifePlayback Pipeline scalingUsing Group Policies to configure Power & Performance settings.Power Efficiency Diagnostics: Using PowerCFG.exe Drilldown.Conclusions & Q&A
The Need for Green!
The Need for Green!
Increasing number of mobile usersIncreased number of users leaving laptops / PCs on downloading movies, music etcWide Availability of Broadband. Users leaving PCs On-Line for updates, patching etcI’m not paying the bill so users have a don’t Care Mentality.Need to leave systems on for Backup, defragmentation, AV purposes.
We Need to be Smarter!
A Dynamic and Design Scalable Microarchitecture
Increasing Energy Focus on PCs
Increasing Energy CostsPC energy consumption has doubled since 2000
EPA estimates PCs use ~2% of all electricity consumed
Businesses trimming costsIncreased mobile workforceMore home users are thinking “green”
PC on 24/7 is 8% of household power usage
From http://www.energystar.gov/ia/partners/prod_development/revisions/downloads/computer/TierII_Network_Issue_Slides.pdf
Hours/year
Off
Sle
ep
100 -
0 -
50 -
Pow
er
(watt
s)
0 8760
Idle
Activ
e
Green Hardware + software Solutions!
Power Management DevelopmentsPlug and Play, ACPI, On Now
Solutions are a combination of Hardware Architecture & Operating System AdvancesAutomating Internet updates or system-maintenance utilitiesHandling docking changes for mobile usersPreserving network connectionsKeeping presentations onlineExtending mobile battery lifeHandling events for network agents and peripherals.
The Advanced Configuration and Power Interface (ACPI)
Open standard for unified operating system-centric device configuration and power management. Released in 1996, Defines platform-independent interfaces for hardware discovery, configuration, power management and monitoring. Specification is central to Operating System-directed configuration and Power Management (OSPM); a term used to describe a system implementing ACPI.Removes device management responsibilities from legacy firmware interfaces. Standard was originally developed by Intel, Microsoft, and Toshiba, and last published as "Revision 4.0", in June 2009.
Managing Active PowerWindows 7 changes frequency as needed to meet performance needs, minimize power
Enhanced Intel SpeedStep TechnologyReferred to as processor P-States
PCU tunes voltage for given frequency, operating conditions, and silicon characteristics
PCU automatically optimizes operating voltage
Processor Power Control Unit
PLL
Uncore, LLC
Core
Vcc
Freq.
Sensors
Core
Vcc
Freq.
Sensors
Core
Vcc
Freq.
Sensors
Core
Vcc
Freq.
Sensors
PLL
PLL
PLL
PLL
PCU
BCLKVcc
Integrated proprietary microcontrollerShifts control from hardware to embedded firmwareReal time sensors for temperature, current, powerFlexibility enables sophisticated algorithms, tuned for current operating conditions
PowerNow!™ Dashboard
PowerTOP For Open Solaris
Understanding Processor States:Intel Deep Power Down Technology (DPD)
(DPD) is the latest & lowest possible Processor power state. Referred to as “C6” State.In this mode
The processor flushes and disables L2 cacheSaves the state of each core into on-die SRAM memory.Then lowers core voltage close to 0 Volt.Thermal Design Power of dual-core mobile CPUs in this state is 0.3 Watt.
Intel Deep Power Down (DPD)
The process of waking up the CPU from DPD mode is initiated by a chipset.The chipset signals VRM to increase core voltage.The CPU's internal clock is activated and wakes up the CPU. The CPU in its turn resets internal state, restores previously stored state from on-die SRAM, and enables L2 cache. Deep Power Down mode was first introduced in Intel Penryn core.
Understanding Processor Power StatesMode Name What it does CPUs
C0 Operating State CPU fully turned on All CPUs
C1 HaltStops CPU main internal clocks via software; bus interface unit and APIC are kept running at full speed.
486DX4 and above
C1E Enhanced HaltStops CPU main internal clocks via software and reduces CPU voltage; bus interface unit and APIC are kept running at full speed.
All socket 775 CPUs
C1E — Stops all CPU internal clocks. Turion 64, 65-nm Athlon X2 and Phenom CPUs
C2 Stop GrantStops CPU main internal clocks via hardware; bus interface unit and APIC are kept running at full speed.
486DX4 and above
C2 Stop Clock Stops CPU internal and external clocks via hardware
Only 486DX4, Pentium, Pentium MMX, K5, K6, K6-2, K6-III
C2E Extended Stop Grant
Stops CPU main internal clocks via hardware and reduces CPU voltage; bus interface unit and APIC are kept running at full speed.
Core 2 Duo and above (Intel only)
C3 Sleep Stops all CPU internal clocks Pentium II, Athlon and above, but not on Core 2 Duo E4000 and E6000
C3 Deep Sleep Stops all CPU internal and external clocks Pentium II and above, but not on Core 2 Duo E4000 and E6000; Turion 64
C3 AltVID Stops all CPU internal clocks and reduces CPU voltage AMD Turion 64
C4 Deeper Sleep Reduces CPU voltage Pentium M and above, but not on Core 2 Duo E4000 and E6000 series; AMD Turion 64
C4E/C5 Enhanced Deeper Sleep
Reduces CPU voltage even more and turns off the memory cache Core Solo, Core Duo and 45-nm mobile Core 2 Duo only
C6 Deep Power Down Reduces the CPU internal voltage to any value, including 0 V 45-nm mobile Core 2 Duo only
Intel® Core™ Microarchitecture Package C-State Support Example
Active CPU Power
Core Leakage
Core Clock Distribution
Core Clocks and Logic
Uncore Leakage
Uncore Clock Distribution
I/O
Uncore Logic
Core
s (x
N)
All cores in C6 state:Core power to ~0
Intel® Core™ Microarchitecture (Nehalem) Package C-State Support Example
Active CPU Power
Uncore Leakage
Uncore Clock Distribution
I/O
Uncore Logic
All cores in C6 state:Core power to ~0
Package to C6 state:Uncore logic stops toggling
Intel® Core™ Microarchitecture Package C-State Support Example
Active CPU Power
Uncore Leakage
Uncore Clock Distribution
I/O
All cores in C6 state:Core power to ~0
Package to C6 state:Uncore logic stops togglingI/O to lower power state
Intel® Core™ Microarchitecture Package C-State Support Example
All cores in C6 state:Core power to ~0
Package to C6 state:Uncore logic stops togglingI/O to lower power stateUncore clock grids stopped
Active CPU Power
Uncore Leakage
Uncore Clock Distribution
I/O
Substantial reduction inidle CPU power
C6 on Intel® Core™ Microarchitecture
C6 on Intel® Core™ Microarchitecture (Nehalem)
Core 0
Core 1
Core 2
Core 3
Core Power
Time
0
0
0
0
Cores 0, 1, 2, and 3 running applications.
C6 on Intel® Core™ Microarchitecture (Nehalem)
Core 0
Core 1
Core 2
Core 3
Core Power
Time
0
0
0
0
Task completes. No work waiting. OS executes MWAIT(C6) instruction.
C6 on Intel® Core™ Microarchitecture (Nehalem)
Core 0
Core 1
Core 2
Core 3
Core Power
Time
0
0
0
0
Execution stops. Core architectural state saved. Core clocks stopped. Cores 0, 1, and 3 continue execution undisturbed.
C6 on Intel® Core™ Microarchitecture (Nehalem)}
Core 0
Core 1
Core 2
Core 3
Core Power
Time
0
0
0
0
Core power gate turned off. Core voltage goes to 0. Cores 0, 1, and 3 continue execution undisturbed.
C6 on Intel® Core™ Microarchitecture (Nehalem)
Core 0
Core 1
Core 2
Core 3
Core Power
Time
0
0
0
0
Task completes. No work waiting. OS executes MWAIT(C6) instruction. Core 0 enters C6. Cores 1 and 3 continue execution undisturbed.
C6 on Intel® Core™ Microarchitecture (Nehalem)
Core 0
Core 1
Core 2
Core 3
Core Power
Time
0
0
0
0
Interrupt for Core 2 arrives. Core 2 returns to C0, execution resumes at instruction following MWAIT(C6). Cores 1 and 3 continue execution undisturbed.
C6 on Intel® Core™ Microarchitecture (Nehalem)
Core 0
Core 1
Core 2
Core 3
Core Power
Time
0
0
0
0
Core independent C6 on Intel Core Microarchitecture (Nehalem)
Interrupt for Core 0 arrives. Power gate turns on, core clock turns on, core state restored, core resumes execution at instruction following MWAIT(C6). Cores 1, 2, and 3 continue execution undisturbed.
Controlling Sleep States
C State Example
ACPI & On Now Example
Windows Server 2008 R2 Core ParkingWindows Server has added additional support which:
Schedules virtual machines on a single server for density as opposed to dispersionThis allows “park/sleep” cores by putting them in deep C states
BenefitsEnhances Green IT by reducing CPU power consumption
Windows Server 200816 LP Server
Windows Server 2008 R2 Core Parking16 LP Server
Processor is “parked”
Processor is “parked”
Estimated ROI (University of Plymouth)
Windows 7 Power Efficiency
Idle Power Management
Active Power Management
New Self Diagnostics
Improved Local & Remote
Management
Always Available
New Windows 7 Power Improvements Include:
Reduced Power ConsumptionIdle Resource Utilization Trigger Start Services Enhanced Processor Power Management Timer Coalescing Device Power Management Adaptive Display Brightness Low-Power Audio Bluetooth Power Improvements
Networking Power Improvements Enhanced User Experiences Greater Enterprise Power Management Power Efficiency Diagnostics Group Policy Windows Management Instrumentation Power Policy
And There’s More:
Frequent Idle Activity
Specific Windows 7 improvementsEliminate TCP DPC (Differential Power Comparison) timer on every system timer interruptReduce frequency of USB driver maintenance timersIntelligent Timer Tick Distribution (ITTD)Timer Coalescing
Goal = Eliminate idle activity in drivers and applications
Target average idle period greater than 100ms
Timer CoalescingPlatform energy efficiency can be improved by extending idle periods
New timer coalescing API enables callers to specify a tolerance for due timeEnables the kernel to expire multiple timers at the same time
Extensions should integrate with Windows 7 API/DDI
Windows 7
Timer tick15.6 ms
Periodic Timer Events
Vista
Power Architecture
Managing Background Processes
System Management
Device management
System Maintenance
Windows Service Control Manager (SCM)
Windows Task Scheduler
Services and the Service Control ManagerStarts and stops services.Managing services that are running.Maintaining service-related state information.Services can either be
RunningStoppedPaused
The SCM can also notify a service when the machine is entering a sleep state.
Service Control Manager (SCM)
Service Control
Manager (SCM)
Device connect trigger
IP address trigger
Domain trigger
Group Policy (GP) trigger
Custom trigger
Service 1
Subscribed to start on Device Connect
trigger
Service 2Subscribed to
start on Domain join trigger, Stop
on Domain disjoin trigger, and Start
on GP triggerservice 1
Subscribed to start on Device Connect
trigger
Optimizing Services
Windows Task Scheduler
The Task Scheduler:Maintains a database of installed tasksStarts and stops tasks.Manages running tasks.Maintains task-related state information.
Tasks can be:Ready - Running – Queued - Disabled
Windows Task Scheduler – OptimizationTriggers start services allow background processes to start on demand.
The following can improve system efficiency, power consumption, and user experience.
Idle ConditionSetting enables a task to run whenever the system is not actively in use by a user.
Power ConditionSpecifies that the task should be run only when the system is running on AC power
Windows 7 Trigger-Start ServicesMany services were configured to Autostart and wait for rare eventsUBPM enables Trigger-Start services based on environmental changes (On Demand)
Device arrival/removal, IP address change, domain join, etc.Examples
Bluetooth service is started only if a Bluetooth radio is currently attachedBitLocker encryption service started only when new volumes detected
Upbm...huh, What that?The ubpm.dll is a Unified Background Process Manager DLL.
Controlling TriggersMethods of starting triggers include the SC Command or through Task Scheduler. sc qtriggerinfo <SERVICENAME>Configuring a service to trigger-start when the computer acquires its first IP address is similarly easy:sc triggerinfo <SERVICENAME> start/networkon
Trigger Service Bluetooth Example!
The BTHSERV (Bluetooth) Service Dynamically Starts when a Bluetooth
device is Started.
Some Trigger-Start Services In Windows 7Service Name Description Trigger Type
AELookupSvc Processes application compatibility cache requests for applications as they are launched
Custom ETW
BDESVC Provides BitLocker client services for user interface and auto-unlocking of data volumes
Custom ETW
BTHSERV The Bluetooth service supports discovery and association of remote Bluetooth devices.
Device
SensorsMTPMonitor Monitors MTP (Media Transfer Protocol) sensors (such as a cell phone with a GPS receiver) to communicate sensor data to programs
Device
TabletInputService Enables Tablet PC pen and ink functionality Device
WinDefend Protection against spyware and potentially unwanted software
Group Policy
Trigger Start Servicesdemo
Tip: Optimize with Processor Affinity
Adaptive Display BrightnessAmbient light sensors detect changes in ambient light and adjust the display brightness.If service is disabled, display brightness will not adapt to lighting conditions.If monitor does not contain a light sensor, service can be default state of Manual or Disabled.Service Name (registry): SensrSvc
Device Power Management
Adaptive display brightnessDim the mobile PC display after a period of user inactivityIntelligent policy—timeout automatically adjusts with user inputDoes not interfere with presentations, full-screen media playback
Processor power managementUpdates to core performance state algorithmCore parking
Device Power Management
AudioSupport for the latest Intel HD Audio low-power specificationsUSB audio class selective suspend
BluetoothRadio enters selective suspend when connections are in sniff mode
Wired LAN runtime idle detectionNIC automatically enters D3 when media is disconnected
Power Policy EnhancementsIterative evolution of Vista power policy
Continue 3 plans: Performance, Balanced, Power SaverImproved User Interface elementsNew power settings for Windows 7 featuresSmall changes to idle timeout defaults
OEMs must continue to tailor policy for specific platforms
E.g., meet regulatory compliance standards
New Windows 7 Power PoliciesName GUID Description
Default (Balanced)
AC DC
Unattended sleep timeout
7bc4a2f9-d8fc-4469-b07b-33eb785aaca0
Determines the amount of inactivity time before the system automatically sleeps if the computer resumed without a user present
2 minutes 2 minutes
System cooling policy
94d3a615-a899-4ac5-ae2b-e4d8f634367f
Determines if Active or Passive cooling should be favored for thermal zones Active Active
Reserve battery level
f3c5027d-cd16-4930-aa6b-90db844a8f00
Configures the percentage of battery capacity remaining before displaying the reserve battery warning
n/a 7%
AHCI link power mode
0b2d69d7-a2a1-449c-9680-f91c70521c60
Configures AHCI link power modes (HIPM, DIPM) and link power states (Partial, Slumber, Active)
HIPM, Partial
HIPM, Slumber
Allow System Required
Policya4b195f5-8225-47d8-8012-9d41369786e2
Enable applications to prevent the system from idling to sleep Enabled Enabled
Dim Display After
17aaa29b-8b43-4b94-aafe-35f64daaf1ee
Determines the amount of inactivity time before the system automatically reduces the brightness of the display on a mobile PC
5 minutes 2 minutes
Power WMI ProviderEnables power policy configuration through standard WMI interface
Change power setting valuesActivate a given plan
To get started…Change a power setting: Win32_PowerSettingActivate a plan: Win32_Plan.Activate() method
Wake TimersOpportunity to improve mobile PC experience by reducing spurious wake events
E.g., system wakes up in bag due to application request, remains on, drains battery
Windows 7 mobile PCs will not program wake timer alarm by default
Excludes doze to hibernateWake timers continue to be enabled by default on desktop systemsPower policy control to configure wake timers
Improved Low Battery Experience
7%
16%
5%
Automatic Hibernate
All thresholds are configurable in power policy
Idle DetectionWindows 7 is aggressive about placing the system in sleep when idle
User input and application availability requests only
Availability requests allow applications to request temporary overrides on power management
Media center recording service prevents idle to sleep when recording TVWindows Media Player prevents display from turning off while watching DVDPresentation Mode
Idle DetectionWindows 7 improves failed idle detection diagnostics
Use PowerCfg utility to inspect for requestsPowerCfg /REQUESTS
Network file sharingOpen files in a client-side cache (offline files) will not prevent the client from sleeping
Policy override capabilityOption to override individual availability requestsOption to override all availability requests
Idle detection will be based solely on user input
Idle Detection Diagnosticsdemo
Power Efficiency DiagnosticsDesigned to evaluate problems when the system is idle
Close open applications and documents“PowerCfg /ENERGY” at the command line to start tracingIncluded with Windows 7 only
Leverages new inbox ETW instrumentationAdvanced users can run utility and view HTML output
Automatically executed when the system is idleReports data to Microsoft via Customer Experience Improvement Program (CEIP)
Power Efficiency DiagnosticsPowerCfg utility detects energy efficiency problems:
USB device selective suspendProcessor Power Management (PPM) Inefficient power policy settingsPlatform timer resolutionPlatform firmware problems… and others
Helps detect major problems at time of system integrationHTML Output can be viewed by End Users“PowerCfg /ENERGY” at the command line to start tracingWindows 7 only—leverages new inbox ETW* instrumentation
*Event Tracing for Windows (Xperf)
Power Efficiency DiagnosticsPowercfg.exe
demo
Power Efficiency DiagnosticsDetected problems
Problem Area Data Collected Warning Threshold Error
Threshold
USB Device Selective Suspend
Individual device suspend transitions% of time device was in suspend state
< 80% suspend time
< 50% suspend time
Power Policy Settings
Idle timeouts (dim, display, sleep)PPM configurationPower plan personality802.11 Wireless Power Save
Idle timeouts < EnergyStar 4.0 Recommendations
Idle timeouts disabled
Processor Utilization
Overall utilizationPer-process utilization (any process over .1%)Top 3 module utilization in each process
Total utilization >2%
Total utilization > 4%
Power Efficiency DiagnosticsDetected problems
Problem Area Data Collected Warning Threshold
Error Threshold
Timer Resolution Requests
Current system timer interrupt period (e.g., 15.6ms)Applications with outstanding timer requests, request amount
None Timer interrupt period < 15.6ms
Power Requests
Applications with outstanding power requests (Display, Sleep, Away Mode) None Each outstanding
power request
Platform Capabilities
Sleep state availabilityDisplay dimming capabilityFirmware validation problemsPCI Express ASPM status
None If any capability is disabled or missing
Battery Capacity
Battery static data (make, model, serial number, manufacture date)Last full charge capacity/design capacity
(Last Full Charge Capacity/Designed Capacity) < 50%
(Last Full Charge Capacity/Designed Capacity) < 40%
Windows 7 Group Policies
Group Policy Power Settingsdemo
Windows 7 Vs Windows Vista
“In a demonstration of two identically configured ThinkPads T400s, Intel and Microsoft claimed that a Windows XP SP2 machine consumed on average 20.2 watts, while the Windows 7 machine consumed 15.4 watts. That translated to about 1.4 hours of additional battery life”. PC Magazine September 2009
question & answer
Review:The Need for Green!Processor Developments inc Core Parking TechnologyWindows Power Management Architecture Using Trigger Start Services, Idle Resource Utilisation, Timer CoalescingEnhanced Power Managements Features: Adaptive display Brightness, Low Power Audio, Bluetooth & Network power Enhancements.Enhancing Notebook & Net book Battery LifePlayback Pipeline scalingUsing Group Policies to configure Power & Performance settings.Power Efficiency Diagnostics: Using PowerCFG.exe Drilldown.Conclusions & Q&A
Thanks for Attending!
Andy Malone MVP, MCTCEO / ConsultantQuality Training (Scotland) Ltd & Dive Deeper Technology Events [email protected]
www.microsoft.com/teched
Sessions On-Demand & Community
http://microsoft.com/technet
Resources for IT Professionals
http://microsoft.com/msdn
Resources for Developers
www.microsoft.com/learning
Microsoft Certification & Training Resources
Resources
Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,
IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.