Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kim Shearer Senior Program Manager Microsoft Corporation SESSION CODE: DPR308.

Similar presentations


Presentation on theme: "Kim Shearer Senior Program Manager Microsoft Corporation SESSION CODE: DPR308."— Presentation transcript:

1 Kim Shearer Senior Program Manager Microsoft Corporation SESSION CODE: DPR308

2

3 Increasing IT Footprint Decreasing Productivity Rising Costs Continual Demand for New Services Traditional Application Architecture Typical Operational Practices Inefficient IT

4 Increasing IT Footprint Decreasing Productivity Rising Costs Stressed Power Systems

5 Increasing IT Footprint Decreasing Productivity Rising Costs Increasing IT Power Increasing Regulatory attention Shareholder & NGO Scrutiny Power Constraints & Outages Grid Local Stressed Power Systems

6 Increasing IT Footprint Decreasing Productivity Rising Costs Manageable Service Demands Smart Application Resource Use New Operational Practices Stressed Power Systems Efficient IT

7 ReliableReliable & SecureReliable, Secure & Efficient

8 Increase Server Utilization Centralized PC Power Management Increase Server Utilization Centralized PC Power Management Rightsizing Efficient Power Supply Remove Unnecessary Components Rightsizing Efficient Power Supply Remove Unnecessary Components Energy Efficient & Aware Applications Platform Power Management Low-power components Building Management Infrastructure Hardware Package Applications Operating System Silicon Improve Data Center PUE Increase Facility Utilization Improve Data Center PUE Increase Facility Utilization

9 Client Reduced battery life – important user feature Cost of system insomnia (additional cost to enterprises) Poor user experience (laptop as bag warmer) Cloud Less effective virtualization/consolidation More servers - Increased Capex/Opex/disposal Stressed power and cooling systems

10 Enables transition to a low power mode while saving OS and application state Allows active system to reduce power needs without negatively impacting user productivity Provides users and administrators with controls to save energy

11 Hardware OSApplications Power Efficient System Power Efficient System

12 “Energy Smart” Application Allows the system to reduce power when possible Respects user preferences to save energy Responds to system state and power source changes

13 Client Code Verify system sleep and display power management behavior Server Code Measure application energy consumption Establish goals and a schedule for improvement All Code Detect and analyze timer resolution changes Encourage use of timer coalesce

14 Verizon185,000 PCs$7 million savings FedEx20,000 PCs$1 million savings

15 Function nameDescription PowerCreateRequestCreates a power context object and returns a handle to it. PowerClearRequestRemoves an outstanding availability request on a particular request context object PowerSetRequestActivates a power availability request and indicates the type of request.

16

17

18

19

20

21 void EatBatteryLife() { HANDLE sharedResource = NULL; //spawn multiple threads, one of which does this: while (sharedResource == NULL) { waitTime++; Sleep(1);//or just keep spinning on a lock or mutex } DO NOT DO THIS

22 //thread 1’s code void UpdateSharedResource() { //set sharedResource sharedResource = UpdateResource(); //Set sharedResourceIsReadyEvent to signaled SetEvent(sharedResourceIsReadyEvent); } /thread 2's code void ConsumeSharedResource() { DWORD dwWaitResult; dwWaitResult = WaitForSingleObject( sharedResourceIsReadyEvent, INFINITE); // indefinite wait switch (dwWaitResult) { case WAIT_OBJECT_0: // // TODO: use sharedResource // break; default: return 0; }

23 Windows 7 Vista

24 BOOL WINAPI SetWaitableTimerEx( __in HANDLE hTimer, __in const LARGE_INTEGER *lpDueTime, __in LONG lPeriod, __in_opt PTIMERAPCROUTINE pfnCompletionRoutine, __in_opt LPVOID lpArgToCompletionRoutine, __in_opt PREASON_CONTEXT WakeContext, __in ULONG TolerableDelay );

25 void CreateAndSetPeriodicTimer() { myTimer = CreateWaitableTimerEx(NULL, TimerName,//string with chosen timer name NULL, TIMER_MODIFY_STATE);//required security attribute to call //SetWaitableTimerEx bError = SetWaitableTimerEx(myTimer, DueTime,//UTC due time 10000,//periodic timer duration is ten seconds CompletionRoutinePointer,//APC completion routine ArgsToCompletionRoutine,//completion routine arguments WakeContext,//only if waking the machine 1000);//tolerable delay is one second //DO WORK bError = CancelWaitableTimer(myTimer);//be sure to cancel periodic timers! }

26

27

28

29 // // Register for Power Setting Notifications. // // The RegisterPowerSettingNotification API returns a handle to the // registration which we cache in a local variable so that we can // unregister when the window is closed. We also do the registration here // because it is explicitly obvious that the dialog is initialized and the // handle to the window is valid. // hPowerPersonality = RegisterPowerSettingNotification(m_hWnd, &GUID_POWERSCHEME_PERSONALITY, DEVICE_NOTIFY_WINDOW_HANDLE); hBatteryPercentage = RegisterPowerSettingNotification(m_hWnd, &GUID_BATTERY_PERCENTAGE_REMAINING, DEVICE_NOTIFY_WINDOW_HANDLE); hACDCSource = RegisterPowerSettingNotification(m_hWnd, &GUID_ACDC_POWER_SOURCE, DEVICE_NOTIFY_WINDOW_HANDLE);

30 //Custom handler for processing WM_POWERBROADCAST messages LRESULT CPowerMonDlg::OnWMPowerBroadcast(WPARAM wParam, LPARAM lParam) { … switch(LOWORD(wParam)) { case PBT_POWERSETTINGCHANGE: // // This is the type of message sent by the power manager when a // power event such as a power plan personality or a system power source // change event occurs. We need to take the // POWERBROADCAST_SETTING struct pointed to by the lParam and // analyze it to determine what setting changed. // PowerMessageSetting = (PPOWERBROADCAST_SETTING)lParam; if (IsEqualGUID(PowerMessageSetting->PowerSetting, GUID_POWERSCHEME_PERSONALITY) && PowerMessageSetting->DataLength == sizeof(GUID)) { // // This is a powerscheme personality change. // Determine power scheme, then take appropriate actions // PowerMessageGUID = *(GUID*)PowerMessageSetting->Data; if (IsEqualGUID(PowerMessageGUID, GUID_TYPICAL_POWER_SAVINGS)){ // Balanced

31 SQL Server 2008 R2 Avoided use of 1ms timer resolution Adobe Flash 10.1 Release Candidate Power Availability Requests Indirect (close audio channel on multi-media pause) Direct (prevent display dimming when playing video in visible window) Contextual timer resolution changes Default when loaded doing nothing or paused 1ms only when rendering video Frame-rate throttling Drop video to 2fps when rendering video in hidden window

32

33

34

35 www.microsoft.com/teched www.microsoft.com/learning http://microsoft.com/technet http://microsoft.com/msdn

36

37 Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31 st http://northamerica.msteched.com/registration You can also register at the North America 2011 kiosk located at registration Join us in Atlanta next year

38

39


Download ppt "Kim Shearer Senior Program Manager Microsoft Corporation SESSION CODE: DPR308."

Similar presentations


Ads by Google