Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Pat Stemen Senior Program Manager Microsoft Corporation PC02.

Similar presentations


Presentation on theme: " Pat Stemen Senior Program Manager Microsoft Corporation PC02."— Presentation transcript:

1  Pat Stemen Senior Program Manager Microsoft Corporation PC02

2

3

4

5

6

7 Watts 0W - Off Why does idle power matter? Most user workloads are dominated by idle time Reducing idle power reduces the “base” power consumption of the system OEMs are focusing on driving down system idle power for regulatory compliance Components: Platform hardware, devices and drivers Core OS and kernel OS services (indexing, background tasks, etc.) Applications and services Time Workloads Idle Workloads ~8-12W Idle

8 Time Watts 0W - Off Idle Power Trade quality or performance for power savings Examples Index only high- priority items Disable animations DVD playback at 30fps instead of 60fps “Race to Sleep” Execute rapidly at high power Quickly re-enter low-power state Extend average idle duration Examples Timer coalescing Idle Resource utilization optimizations Reduce power by eliminating unnecessary activity Examples: Events and notifications instead of polling Extending polling intervals Eliminating periodic disk activity

9

10 Internal Microsoft measurements, Intel processor

11

12 Timer tick 15.6 ms Periodic Timer Events Windows 7 Vista

13 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 ); DllImport("kernel32.dll")] static extern bool SetWaitableTimerEx( IntPtr hTimer, ref long lpDueTime, int lPeriod, TimerCompletionDelegate pfnCompletionRoutine, IntPtr lpArgToCompletionRoutine, IntPtr WakeContext, ulong TolerableDelay );

14

15

16

17

18

19

20

21

22

23 // // Create a SystemRequired request to keep the system from automatically sleeping while downloading a file. // POWER_REQUEST_CONTEXT DownloadPowerRequestContext; HANDLE DownloadPowerRequest; // // Set up the diagnostic string // DownloadPowerRequestContext.Version = POWER_REQUEST_CONTEXT_VERSION; DownloadPowerRequestContext.Flags = POWER_REQUEST_CONTEXT_SIMPLE_STRING; DownloadPowerReqeustContext.Reason.SimpleReasonString = L”My application is downloading files.” // // Create the request, get a handle // DownloadPowerRequest = PowerCreateRequest(&DownloadPowerRequestContext); // // Set the request // PowerSetRequest( DownloadPowerRequest, PowerRequestSystemRequired ); // Download the File... // // Clear the request // PowerClearRequest(DownloadPowerRequest);

24

25

26

27

28

29

30

31 [DllImport("kernel32.dll")] static extern IntPtr PowerCreateRequest( ref POWER_REQUEST_CONTEXT Context ); [DllImport("kernel32.dll")] static extern bool PowerSetRequest( IntPtr PowerRequestHandle, PowerRequestType RequestType ); [DllImport("kernel32.dll")] static extern bool PowerClearRequest( IntPtr PowerRequestHandle, PowerRequestType RequestType ); enum PowerRequestType { PowerRequestDisplayRequired = 0, PowerRequestSystemRequired, PowerRequestAwayModeRequired, PowerRequestMaximum } const int POWER_REQUEST_CONTEXT_VERSION = 0; const int POWER_REQUEST_CONTEXT_SIMPLE_STRING = 0x1; const int POWER_REQUEST_CONTEXT_DETAILED_STRING = 0x2;

32 / // Note: // // Windows defines the POWER_REQUEST_CONTEXT structure with an // internal union of SimpleReasonString and Detailed information. // To avoid runtime interop issues, this version of POWER_REQUEST_CONTEXT // only supports SimpleReasonString. To use the detailed information, // define the PowerCreateRequest function with the first parameter of type // POWER_REQUEST_CONTEXT_DETAILED. // [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] public struct POWER_REQUEST_CONTEXT { public UInt32 Version; public UInt32 Flags; [MarshalAs(UnmanagedType.LPWStr)] public string SimpleReasonString; } [StructLayout(LayoutKind.Sequential)] public struct PowerRequestContextDetailedInformation { public IntPtr LocalizedReasonModule; public UInt32 LocalizedReasonId; public UInt32 ReasonStringCount; [MarshalAs(UnmanagedType.LPWStr)] public string[] ReasonStrings; } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct POWER_REQUEST_CONTEXT_DETAILED { public UInt32 Version; public UInt32 Flags; public PowerRequestContextDetailedInformation DetailedInformation; }

33 Please fill out your evaluation for this session at: This session will be available as a recording at: www.microsoftpdc.com

34

35 © 2008 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.

36


Download ppt " Pat Stemen Senior Program Manager Microsoft Corporation PC02."

Similar presentations


Ads by Google