Windows 7: The Power Management Workout!

Download Report

Transcript Windows 7: The Power Management Workout!

Andy Malone MVP, MCT
CEO / Trainer / Consultant
Quality Training (Scotland) Ltd &
Dive Deeper Technology Events EMEA
Session Code: CLI321
This Session Will Cover:
The Need for Green!
Processor Developments inc Core Parking Technology
Windows Power Management Architecture
Using Trigger Start Services, Idle Resource Utilisation, Timer
Coalescing
Enhanced Power Managements Features: Adaptive display
Brightness, Low Power Audio, Bluetooth & Network power
Enhancements.
Enhancing Notebook & Net book Battery Life
Playback Pipeline scaling
Using 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 users
Increased number of users leaving laptops / PCs
on downloading movies, music etc
Wide Availability of Broadband. Users leaving
PCs On-Line for updates, patching etc
I’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 Costs
PC energy consumption
has doubled since 2000
EPA estimates
PCs use ~2% of all
electricity consumed
Businesses trimming costs
Increased mobile workforce
More home users are
thinking “green”
PC on 24/7 is 8% of
household power usage
http://www.energystar.gov/ia/
partners/prod_development/revisions
/downloads/computer/TierII_Network
_Issue_Slides.pdf
Green Hardware + software Solutions!
Power Management Developments
Plug and Play, ACPI, On Now
Solutions are a combination of Hardware
Architecture & Operating System Advances
Automating Internet updates or systemmaintenance utilities
Handling docking changes for mobile users
Preserving network connections
Keeping presentations online
Extending mobile battery life
Handling 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 Power
Windows 7 changes frequency as needed to
meet performance needs, minimize power
Enhanced Intel SpeedStep Technology
Referred 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
Vcc
BCLK
Core
PLL
Vcc
Freq.
Sensors
PLL
Core
Vcc
Freq.
Sensors
PLL
Core
PCU
Vcc
Freq.
Sensors
PLL
Core
Uncore ,
LLC
Vcc
Freq.
Sensors
PLL
Integrated proprietary
microcontroller
Shifts control from hardware
to embedded firmware
Real time sensors for
temperature, current, power
Flexibility 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 cache
Saves 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 States
Mode
C0
C1
C1E
C1E
C2
C2
C2E
Name
What it does
Operating State CPU fully turned on
Stops CPU main internal clocks via software;
Halt
bus interface unit and APIC are kept running at
full speed.
Stops CPU main internal clocks via software
Enhanced Halt and reduces CPU voltage; bus interface unit
and APIC are kept running at full speed.
—
Stops all CPU internal clocks.
Stops CPU main internal clocks via hardware;
Stop Grant
bus interface unit and APIC are kept running at
full speed.
Stops CPU internal and external clocks via
Stop Clock
hardware
Stops CPU main internal clocks via hardware
Extended Stop
and reduces CPU voltage; bus interface unit
Grant
and APIC are kept running at full speed.
C3
Sleep
C3
Deep Sleep
C3
C4
C4E/C5
C6
Stops all CPU internal clocks
Stops all CPU internal and external clocks
CPUs
All CPUs
486DX4 and above
All socket 775 CPUs
Turion 64, 65-nm Athlon X2 and Phenom CPUs
486DX4 and above
Only 486DX4, Pentium, Pentium MMX, K5, K6, K6-2,
K6-III
Core 2 Duo and above (Intel only)
Pentium II, Athlon and above, but not on Core 2 Duo
E4000 and E6000
Pentium II and above, but not on Core 2 Duo E4000
and E6000; Turion 64
Stops all CPU internal clocks and reduces CPU
AMD Turion 64
voltage
Pentium M and above, but not on Core 2 Duo E4000
Deeper Sleep Reduces CPU voltage
and E6000 series; AMD Turion 64
Enhanced Deeper Reduces CPU voltage even more and turns off
Core Solo, Core Duo and 45-nm mobile Core 2 Duo only
Sleep
the memory cache
Reduces the CPU internal voltage to any value,
Deep Power Down
45-nm mobile Core 2 Duo only
including 0 V
AltVID
Intel® Core™ Microarchitecture Package C-State
Support Example
Core power to ~0
Cores (x N)
All cores in C6 state:
Active CPU Power
Core Clocks
and Logic
Core Clock
Distribution
Core Leakage
Uncore Logic
I/O
Uncore Clock
Distribution
Uncore
Leakage
Intel® Core™ Microarchitecture (Nehalem)
Package C-State Support Example
All cores in C6 state:
Active CPU Power
Core power to ~0
Package to C6 state:
Uncore logic stops toggling
Uncore Logic
I/O
Uncore Clock
Distribution
Uncore
Leakage
Intel® Core™ Microarchitecture Package C-State
Support Example
All cores in C6 state:
Active CPU Power
Core power to ~0
Package to C6 state:
Uncore logic stops toggling
I/O to lower power state
I/O
Uncore Clock
Distribution
Uncore
Leakage
Intel® Core™ Microarchitecture Package C-State
Support Example
All cores in C6 state:
Active CPU Power
Core power to ~0
Package to C6 state:
Uncore logic stops toggling
I/O to lower power state
Uncore clock grids stopped
Substantial reduction in
idle CPU power
I/O
Uncore Clock
Distribution
Uncore
Leakage
C6 on Intel® Core™ Microarchitecture
C6 on Intel® Core™ Microarchitecture
(Nehalem)
Core Power
Cores 0, 1, 2,
and 3 running
applications.
Core 3
0
Core 2
0
Core 1
0
Core 0
0
Time
C6 on Intel® Core™ Microarchitecture
(Nehalem)
Core Power
Task completes. No work
waiting. OS executes
MWAIT(C6) instruction.
Core 3
0
Core 2
0
Core 1
0
Core 0
0
Time
C6 on Intel® Core™ Microarchitecture
(Nehalem)
Core Power
0
Execution stops. Core
architectural state saved.
Core clocks stopped. Cores
0, 1, and 3 continue
execution undisturbed.
Core 3
Core 2
0
Core 1
0
Core 0
0
Time
C6 on Intel® Core™ Microarchitecture
(Nehalem)}
Core Power
Core power gate turned off.
Core voltage goes to 0.
Cores 0, 1, and 3 continue
execution undisturbed.
Core 3
0
Core 2
0
Core 1
0
Core 0
0
Time
C6 on Intel® Core™ Microarchitecture
(Nehalem)
Core Power
Core 3
0
Core 2
0
0
Task completes. No work waiting.
OS executes MWAIT(C6)
instruction. Core 0 enters C6.
Cores 1 and 3 continue
execution undisturbed.
Core 1
Core 0
0
Time
C6 on Intel® Core™ Microarchitecture
(Nehalem)
Core Power
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.
Core 3
Core 2
0
Core 1
0
Core 0
0
Time
C6 on Intel® Core™ Microarchitecture
(Nehalem)
Core Power
Core 3
0
0
0
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.
Core 2
Core 1
Core 0
0
Time
Core independent C6 on Intel Core Microarchitecture (Nehalem)
Controlling Sleep States
C State Example
ACPI & On Now Example
Windows Server 2008 R2 Core Parking
Windows Server has added additional support which:
Schedules virtual machines on a single server for
density as opposed to dispersion
This allows “park/sleep” cores by putting them in
deep C states
Benefits
Enhances Green IT by reducing
CPU power consumption
Windows Server 2008
16 LP Server
Windows Server 2008 R2 Core Parking
16 LP Server
Estimated ROI (University of Plymouth)
Windows 7 Power Efficiency
Idle Power
Management
Active Power
Management
New Self
Diagnostics
Always Available
Improved
Local &
Remote
Management
New Windows 7 Power Improvements
Include:
Reduced Power Consumption
Idle Resource Utilization
Trigger Start Services
Enhanced Processor Power Management
Timer Coalescing
Device Power Management
Adaptive Display Brightness
Low-Power Audio
Bluetooth Power Improvements
And There’s More:
Networking Power Improvements
Enhanced User Experiences
Greater Enterprise Power Management
Power Efficiency Diagnostics
Group Policy
Windows Management Instrumentation
Power Policy
Frequent Idle Activity
Specific Windows 7 improvements
Eliminate TCP DPC (Differential Power Comparison)
timer on every system timer interrupt
Reduce frequency of USB driver maintenance timers
Intelligent Timer Tick Distribution (ITTD)
Timer Coalescing
Goal = Eliminate idle activity in drivers and
applications
Target average idle period greater than 100ms
Timer Coalescing
Platform energy efficiency can be
improved by extending idle periods
New timer coalescing API enables callers
to specify a tolerance for due time
Enables the kernel to expire multiple timers at the same time
Extensions should integrate with Windows 7 API/DDI
Power Architecture
Managing Background Processes
System
Management
Device
management
Windows
Service Control
Manager (SCM)
System
Maintenance
Windows Task
Scheduler
Services and the Service Control Manager
Starts and stops services.
Managing services that are
running.
Maintaining service-related
state information.
Services can either be
Running
Stopped
Paused
The SCM can also notify a
service when the machine is
entering a sleep state.
Service Control Manager (SCM)
Device
connect
trigger
Service 1
IP address
trigger
Domain
trigger
Subscribed to start
on Device Connect
trigger
Service 2
Group Policy
(GP) trigger
Subscribed to
start on Domain
join trigger, Stop
on Domain disjoin
trigger, and Start
on GP trigger
service 1
Custom
trigger
Subscribed to start on
Device Connect
trigger
Optimizing Services
Windows Task Scheduler
The Task Scheduler:
Maintains a database of installed tasks
Starts and stops tasks.
Manages running tasks.
Maintains task-related state information.
Tasks can be:
Ready - Running – Queued - Disabled
Windows Task Scheduler – Optimization
Triggers start services allow background
processes to start on demand.
The following can improve system efficiency, power
consumption, and user experience.
Idle Condition
Setting enables a task to run whenever the system
is not actively in use by a user.
Power Condition
Specifies that the task should be run only when the
system is running on AC power
Windows 7 Trigger-Start Services
Many services were configured to
Autostart and wait for rare events
UBPM 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 attached
BitLocker encryption service started only
when new volumes detected
Upbm...huh, What that?
The ubpm.dll is a Unified Background Process Manager DLL.
Controlling Triggers
Methods 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 7
Service 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 Services
Tip: Optimize with Processor Affinity
Adaptive Display Brightness
Ambient 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 brightness
Dim the mobile PC display after
a period of user inactivity
Intelligent policy—timeout automatically adjusts
with user input
Does not interfere with presentations,
full-screen media playback
Processor power management
Updates to core performance state algorithm
Core parking
Device Power Management
Audio
Support for the latest Intel HD Audio
low-power specifications
USB audio class selective suspend
Bluetooth
Radio enters selective suspend
when connections are in sniff mode
Wired LAN runtime idle detection
NIC automatically enters D3
when media is disconnected
Power Policy Enhancements
Iterative evolution of Vista power policy
Continue 3 plans:
Improved User Interface elements
New power settings for Windows 7 features
Small changes to idle timeout defaults
OEMs must continue to tailor policy for specific
platforms
E.g., meet regulatory compliance standards
New Windows 7 Power Policies
Name
GUID
Description
Unattended
sleep timeout
7bc4a2f9-d8fc-4469b07b-33eb785aaca0
Determines the amount of inactivity time
before the system automatically sleeps if
the computer resumed without a user
present
System
cooling policy
94d3a615-a899-4ac5ae2b-e4d8f634367f
Determines if Active or Passive cooling
should be favored for thermal zones
Reserve
battery level
f3c5027d-cd16-4930aa6b-90db844a8f00
Configures the percentage of battery
capacity remaining before displaying the
reserve battery warning
AHCI link
power mode
0b2d69d7-a2a1-449c9680-f91c70521c60
Configures AHCI link power modes
(HIPM, DIPM) and link power states
(Partial, Slumber, Active)
Allow System
Required
Policy
a4b195f5-8225-47d88012-9d41369786e2
Enable applications to prevent the system
from idling to sleep
Dim Display
After
17aaa29b-8b43-4b94aafe-35f64daaf1ee
Determines the amount of inactivity time
before the system automatically reduces
the brightness of the display on a mobile PC
Default (Balanced)
AC
DC
2 minutes
2 minutes
Active
Active
n/a
7%
HIPM,
Partial
HIPM,
Slumber
Enabled
Enabled
5 minutes
2 minutes
Power WMI Provider
Enables power policy configuration
through standard WMI interface
Change power setting values
Activate a given plan
To get started…
Change a power setting:
Win32_PowerSetting
Activate a plan:
Win32_Plan.Activate() method
Wake Timers
Opportunity 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 hibernate
Wake timers continue to be enabled
by default on desktop systems
Power policy control to configure wake timers
Improved Low Battery Experience
Idle Detection
Windows 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 TV
Windows Media Player prevents display
from turning off while watching DVD
Presentation Mode
Idle Detection
Windows 7 improves failed idle detection
diagnostics
Use PowerCfg utility to inspect for requests
PowerCfg /REQUESTS
Network file sharing
Open files in a client-side cache (offline files)
will not prevent the client from sleeping
Policy override capability
Option to override individual availability requests
Option to override all availability requests
Idle detection will be based solely on user input
Idle Detection Diagnostics
Power Efficiency Diagnostics
Designed to evaluate problems when the system is idle
Close open applications and documents
“PowerCfg /ENERGY” at the command line
to start tracing
Included with Windows 7 only
Leverages new inbox ETW instrumentation
Advanced users can run utility and view HTML output
Automatically executed when the system is idle
Reports data to Microsoft via Customer Experience
Improvement Program (CEIP)
Power Efficiency Diagnostics
PowerCfg utility detects energy efficiency problems:
USB device selective suspend
Processor Power Management (PPM)
Inefficient power policy settings
Platform timer resolution
Platform firmware problems
… and others
Helps detect major problems at time of system
integration
HTML Output can be viewed by End Users
“PowerCfg /ENERGY” at the command line to start tracing
Windows 7 only—leverages new inbox ETW*
instrumentation
*Event Tracing for Windows (Xperf)
Power Efficiency Diagnostics
Powercfg.exe
Power Efficiency Diagnostics
Problem
Area
USB Device
Selective
Suspend
Power Policy
Settings
Processor
Utilization
Data Collected
Individual device suspend
transitions
% of time device was in suspend
state
Idle timeouts (dim, display, sleep)
PPM configuration
Power plan personality
802.11 Wireless Power Save
Overall utilization
Per-process utilization
(any process over .1%)
Top 3 module utilization in each
process
Warning Threshold
Error
Threshold
< 80% suspend
time
< 50%
suspend
time
Idle timeouts <
EnergyStar 4.0
Recommendations
Idle
timeouts
disabled
Total utilization
>2%
Total
utilization
> 4%
Power Efficiency Diagnostics
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
Sleep state availability
Display dimming capability
Firmware validation problems
PCI Express ASPM status
None
If any capability is
disabled or missing
(Last Full Charge
Capacity/Designed
Capacity) < 50%
(Last Full Charge
Capacity/Designed
Capacity) < 40%
Platform
Capabilities
Battery
Capacity
Battery static data (make, model,
serial number, manufacture date)
Last full charge capacity/design capacity
Windows 7 Group Policies
Group Policy Power Settings
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
Review:
The Need for Green!
Processor Developments inc Core Parking Technology
Windows Power Management Architecture
Using Trigger Start Services, Idle Resource Utilisation, Timer
Coalescing
Enhanced Power Managements Features: Adaptive display
Brightness, Low Power Audio, Bluetooth & Network power
Enhancements.
Enhancing Notebook & Net book Battery Life
Playback Pipeline scaling
Using Group Policies to configure Power & Performance settings.
Power Efficiency Diagnostics: Using PowerCFG.exe Drilldown.
Conclusions & Q&A
Thanks for
Attending!
Andy Malone MVP, MCT
CEO / Consultant
Quality Training (Scotland) Ltd & Dive
Deeper Technology Events EMEA
[email protected]
Resources
www.microsoft.com/teched
www.microsoft.com/learning
Sessions On-Demand & Community
Microsoft Certification & Training Resources
http://microsoft.com/technet
http://microsoft.com/msdn
Resources for IT Professionals
Resources for Developers
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.