Notes on comments.
Welcome to our blog dedicated to the engineering of Microsoft Windows 7
Happy New Year! The following post continues our discussion of fundamentals with a focus on power management. Power Management (or energy efficiency) is something that every contributor to the PC Ecosystem must always address—the energy efficiency of a running PC is limited by the weakest component. In engineering Windows 7 we had an explicit focus on the energy usage patterns of the running system and will continue to work with hardware and software makers to realize the collective benefit of all of this work. While we talk about the balancing of needs in every area, energy consumption is probably the most easily visualized—when we test running systems we connect them to power meters and watch a very clear number change as we run tests. (If you’ve seen the film Apollo 13 then you’ve seen a similar (albeit much more mission critical) struggle with a power budget.) This post is by Dean DeWhitt in program management team on our Kernel team. --Steven PS: Quite a few of us are at CES this week!
Energy efficiency is one of the most active topics in modern computing today. As evidence, consider that processor and chipset vendors are marketing products on “performance per watt”, instead of just processor clock frequency and benchmark performance. Perhaps you have seen a press release for one of the many industry consortiums focused on “Green Computing”--reducing the power consumption and environmental impact of computing. Finally, battery life continues to be a major purchasing and usability factor for mobile PCs. These related energy efficiency efforts in the PC industry result in an ever-increasing interest in how Windows manages power.
In engineering Windows 7, our goal is to deliver the capabilities and features users want from a Windows PC while reducing power consumption over previous releases. Windows already provides a rich set of energy saving features, including the ability to turn off the display and automatically put the system to sleep when the user is not interacting with the computer. For Windows 7, we are building upon the investments in these areas by extending the existing capabilities and focusing on reducing power consumption when the system is idle. Although Windows is responsible for managing the power state of many devices, including the processor, hard drive and display, the remaining devices and software running on the computer have just as much (if not more) impact on power consumption and battery life. This is a challenge for everyone contributing to the PC experience.
When we talk about energy efficiency and power consumption, we like to break down the problem area into 3 main components:
Realizing great energy efficiency from a Windows PC requires efforts in each of these areas. A problem with any single component in any area can have a significant impact on power consumption. Thus approaching energy efficiency from a platform approach and paying special attention to each component on the platform is required.
The base hardware platform is really dictated by the system manufacturer. The customer gets the ultimate choice when they buy a system—the customer can buy a system with ultra-efficient hardware components or can buy a system with components that favor performance over power consumption. There are desktop and mobile PCs in all kinds of form factors, with varying capabilities and power consumption levels. Some mobile PCs have a normal 3 or 6-cell battery, while others have an extended 9-cell battery or another external battery that can be added to the computer. The challenge for Windows is to be energy efficient across the wide range of hardware in the Windows ecosystem. Looking at a modern laptop, here is where the power goes:
Desktops will have a similar power distribution although higher in watts. The display is a large amount of the energy consumed in using your desktop PC as well.
The Windows operating system can have just as big an influence as any other component in the platform. In engineering Windows 7 our goal is to make sure Windows provides a great foundation and energy saving opportunities within the operating system starting with configuration of power policy settings.
The first place most users encounter Windows power management is through Power Options in control panel, or the battery meter on a mobile PC. For as long as Windows has had power management, Windows has had power schemes or power plans. The power plans allow you to easily change from one set of power settings to another, depending on your preferences.
Within a power plan, you can change a variety of Windows power-saving features, including inactivity timers for turning off the display, automatically putting the system to sleep or even creating a new custom power plan for the exact settings you want. The display and sleep idle features are very important for power savings and battery life. As above, the display can consume approximately 40% of the power budget on the typical mobile PC and anywhere from 30-100+ Watts on a desktop PC.
PC OEMs, especially makers of laptops, will often develop a custom set of power schemes that work to take advantage of differentiated hardware and unique software available on a specific model. So often you will see power schemes that carry the name of your PC OEM in the title. These have been developed by the OEM who is just as committed to energy efficiency.
Quick tips: The easiest way to save power on a desktop PC is reduce the display idle timeout to something very aggressive, such as 2 or 5 minutes. If you have a screen saver enabled, disable it to allow the display to turn off. On a mobile PC, the easiest way to extend battery life is to reduce the brightness of the display in addition. Also note that many of the new all-in-one machines use laptop components and thus from a power management perspective look like laptops.
Windows manages the processor performance and changes it dynamically based on the current usage to provide performance boost when required and conserve power based on the current workload. For example, when the system is mostly idle, such as when I’m typing this blog post, there is no need to be running the processor in the maximum performance mode, instead the processor voltage and frequency can be reduced to a lower value to save power. Similarly, the hard disk drive and a variety of other devices can be placed in low-power modes or turned off completely to save power when not in use.
For Windows 7, we’re refining the user experiences for power management, focusing on reducing idle power consumption and supporting new device power modes.
There are two reasons to optimize idle power consumption on the system. First there are various times throughout the day when the PC is idle and the more the system gets to idle and stays idle, the less power it uses. Second, idle power consumption is the ‘base’ power consumption for all other workloads. A system which consumes 15W at Idle will consume additional power over the idle power consumption while is use for other workloads. By reducing the idle power consumption on the platform we will improve most other scenarios as well.
The first step in reducing idle power is optimizing the amount of processor, memory and disk utilization. Reducing processor utilization is the most important, because the processor has a wide range of power consumption. When truly idle, the processor power consumption can be as low as 100-300mW. But, when fully busy, the processor can consume up to 35W. This large range means that even small amounts of processor activity can have a significant impact on overall power consumption and battery life. There are several areas of investment in Windows 7 that help reduce processor utilization and thereby enabling longer periods of time where the processor can enter into low power modes. One of these investments is in the area of services that are running on the platform and having those services only start when they are required referred to as “Trigger-Start”. While these services are efficient and have minimal impact by themselves, the additive effect of several services can add up. We are looking at smart ways to manage these services both within Windows but making our investments in this area extensible for others who are writing services to take advantage of this infrastructure. (Also note these are the same features that contribute to improvements in boot time as well).
To further help reduce idle power, we are focusing on core processor power management improvements. Windows scales processor performance based on the current amount of utilization, and making sure Windows only increases processor performance when absolutely required can have a big impact on power consumption.
We have made several investments in the area of device power management including enhancements to USB device classes to enable selective suspend across a broad range of devices including audio, biometrics, scanners, and smart cards. These investments available in Windows 7 enable more energy efficient PC designs. We have also invested in improvements to power management for networking devices, both wired and wireless.
While many of our investments in the core infrastructure improves energy efficiency across several scenarios, in Windows 7 we also focused on several key customer scenarios to identify resource utilization improvements to extend battery life on mobile platforms. One of these scenarios that we identified was media playback. The optimizations for DVD playback include reducing processor and graphics utilization, audio improvements, and optical disk drive enhancements. These improvements are already paying off and showing significant increase in battery life across a broad range of mobile platforms which we demonstrated at the WinHEC conference.
Graphics devices, USB devices, device drivers, background services and installed applications are all extensions to Windows. Large improvements in power consumption and energy efficiency can be realized by improving the efficiency of platform extensions.
For example, consider a single USB device that does not support Selective Suspend. That USB device itself may have very low power consumption (e.g., a fingerprint reader), but until that device enters the suspend state, the processor and chipset must poll the device at a very high frequency to see if there is new data. That polling prevents the processor from entering low power idle states, and on a typical business-class notebook reduces battery life by 20-25%.
Devices are not the only area that require efforts for great energy efficiency. Application and service software can also have a big impact on power consumption. Take for example an application that increases the platform timer resolution using the timeBeginPeriod API. The platform timer tick resolution will be increased and the processor will not be able to efficiently use low power idle modes. We have observed a single application that keeps the timer resolution increased to 1ms can have up to a 10% impact on battery life on a typical notebook PC.
We’re committed to helping improve the energy efficiency of Windows platform extensions by working closely with our partners. The strategy we’re employing is to provide rich tools to identify energy efficiency problems in hardware and software. For Windows 7, we’ve added a new inbox utility that provides an HTML report of energy efficiency issues—a “Top 10” checklist of power problems. If you want to try it out on Windows 7, run powercfg /energy at an elevated command prompt. Be sure to close any open applications and documents before running powercfg—this utility is designed to find energy efficiency problems when the system is idle. powercfg with the /energy parameter can detect USB devices that are not suspending and applications that have increased the platform timer resolution.
For more advanced analysis, we have provided the Windows Performance Toolkit. The Performance Toolkit http://www.microsoft.com/whdc/system/sysperf/perftools.mspx makes it very easy for software developers to observe the resource utilization of their applications, resolve performance bottlenecks and identify issues impacting energy efficiency.
So far, we have been talking about how to save power while the PC is ON. But, there are power savings to gain by entering low power modes when the PC is not in use. Many users simply Shut Down their computer when it is not in use, yet others use Sleep and sometimes Hibernate on mobile PCs. Windows features each of these power-saving modes so you can choose the right mode for how you use the system:
Using an example desktop PC, we measured power consumption for Sleep, Hibernate, Shut Down and the basic ON state, with just the desktop shown and no open programs. We also measured resume latency—the amount of time to get the system back to the ON state.
The chart makes it pretty clear why we focus on Sleep reliability and performance, and encourage most people to use it when they are not using their computer. Sleep consumes nearly the same amount of power as Shut Down, but resumes the system in less than 2 seconds, instead of going through the boot process. You can see that boot takes a significant amount of power so when considering whether to turn off your machine to save power or to put it into a low power state, think about how long your machine will be out of use. Nevertheless, as we’ve talked about in previous blogs boot (and shutdown) are obviously very important performance scenarios as we engineer Windows 7.
We are committed to continuously improving the energy efficiency of Windows PCs, and have made significant improvements to core platform power management for Windows 7, as well as tools to identify where power is consumed. We still have more work to do, and look forward to our upcoming Beta release and monitoring incoming CEIP telemetry for energy efficiency and power management results. Of course we continue to work very closely with the other members of the ecosystem as we all have much to contribute to energy efficiency—from the manufacturing, usage, and end of life of a PC, software, and peripherals.
Very nice, hope for more, my HP ElitBook(Intel SSD base) now runs with Vista between 7-10 hours. If 7 gives us more power saving abilities, that time will be longer, so I can use my PC while I flight from USA to Europe the whole time long.
Offtoppic: I heard about Windows Seven Beta Release for tomorrow, is that true?
I expected the power consumption of a notebook display to be pretty substantial, but I never expected it to be this much. Also, you'd think the CPU is more power hungry than the chipset and this does not seem to be true according to this data. Pretty interesting these numbers and not really what I expected. It does show that OLED can't come soon enough (if they can increase lifespan).
BTW, I am also very interested in the open Beta for Windows 7, but I'm wondering though, how open is it going to be? Can pretty much anyone participate, or do you need to have a TechNet subscription or something similar? I'm hoping to hear more on this topic, as I can't wait to try Windows 7 myself. This blog has certainly raised my expectations of what's to come for Windows 7. So keep up the good work guys and good luck with finalizing Windows 7.
A while ago, Anandtech stumbled across some pretty huge differences in battery life between a Vista laptop and a Macbook:
Have you looked at these numbers, and if these figures are valid, is Win7 likely to compare better to a Mac? (If you think the figures are invalid, it'd be interesting to hear your reasoning as well)
You need to see that OS X runs on a small number of hardware components and the developers have it very easy to perform the system for more running time...but windows need to do that with milions of hardware configurations, so please dont compare OS X and Windows, if Windows can beat OS X in that point something goas very wrong with the Macs...
Thanks for the article.
Can hibernate not be made significantly quicker by adding a little intelligence?
E.g. the cache is a large use of RAM. At hibernate, dump the cached data and then only write the remaining, allocated pages to disk. Rather than storing say 4GB, you'd get it back down to say 1.5GB on my PC at the moment.
BTW, the Vista hibernate with no percentage bar (and if I remember, a blank screen), is dire... Hopefully the hibernate experience is now better again.
Jalf - My words, I like windows, but this graph is sad to watch: http://www.anandtech.com/mobile/showdoc.aspx?i=3439&p=13 - see Battery life: Internet usage relative to battery capacity, all Macs are getting over 6 minutes per Wh, while Windows laptops score between 1-3 minutes/Whr :(.
I know that Apple is in complete control of hardware and drivers, but it is still a 200-400% (let's not talk about DTRs) difference in power efficiency, and it is hard to believe that Nvidia/ATI/AMD/Intel would miss so many optimizations after years of driver development (as a similar difference exists even with Vista/OS X on a same machine where only drivers or OS power management can make difference).
If anyone of dev team has some explanation, I'd like to hear it.
There is one feature I was really looking forward to seeing in windows 7 - a way to determine which program/process is preventing automatic sleep. On every PC I have in my house, from Vista desktops to XP laptops, the automatic sleep function works for a while, and then inexplicably stops. I can still manually sleep/resume it, but I can leave the system idle for days, and it wont go back to sleep. A reboot usually fixes it for a while. The monitor always goes blank on time, and it never wakes up on it's own, but there is absolutely *zero* way as far as I can tell to figure out why it wont go to sleep.
Is there any related functionality in Windows 7 that I'm not aware of?
mdaria510 - are you sharing media on the PCs? By default, Vista disables automatic sleep when sharing media. You can turn that setting off in the power settings.
jalf - I'm also curious what MS's response will be to the large discrepancy in battery life discovered by Anand.
Currently I do not use sleep or hibernate on my home computer because I have had problems trying to access it through remote desktop. If this feature already exists I cannot figure out how to make it work reliably.
One other problem I have found is that my monitor turns on and stays on the logon screen when I remote desktop to that computer and log off. I have come home many hours after using the connection and found that the monitor is still on. I have set that monitor to sleep after 10 minutes of not being used and RDP seems to be the only app that somehow turns it back on.
I hope some progress can be made on these issues in Windows 7 so I can start saving some power on my home computer by using sleep or hibernate.
I think the main thing is to help Aero to be more power effective. And do some magic with return from hibernation, so that it's much faster than booting up.
Also, please make the interface of power management more understandable, especially what's behind the Advanced buttons... I hate the weird wording beside the UAC shield, it doesn't make sense.
Though it has little to really do with Windows 7, I was surprised to see how much power the LCD takes. I figured the HDD with moving parts would take more power.
Just to throw myself into the ring, I do prefer sleep over hibernate. I just wish my Vista Laptop would go to sleep quicker. Always ends up pegging the HDD and I never know why.
It's interesting to know how Stand-by is energy efficient & convenient way when system is idle, than switching off or hibernate.
I travel a lot and so I use data card on my laptop for internet access(not USB connected). Problem is, whenever I put the system in standby mode it kinda switches off my Data card device - So even when I turn my system on again, it doesn't start the device. So I had to manually boot the system to get that back online. but When I hibernate my system, I don't have this issue. And ofcourse, turn-off will work too.
I wish I could put it in standby - as it prepares back system fast compared to hibernating it.
I don't know if this is true for anyother devices but With growing number of people starting to use internet-datacards, you may need to look at it. Not big issue - but, yeh, there is one though.
And btw, I can't wait for public beta to test my SAP access via windows 7 - or out of curiousity, I might just pray the Torrent-God to help me. ;-)
peterfnet: do you by chance have hybrid sleep on?
what that does is prepare your computer for hibernation, but go into sleep instead, thus making restoration fast. At some pre-arranged very low battery power remaining, it will then hibernate (ie turn off completely).
This combines the advantages of hibernate (no power used at all) and one of the advantages of sleep (fast turn on) with at least some of the disadvantages as well (suspend takes a while; still drains the battery; resume sometimes takes a while). It's a nice compromise state but whether or not it's useful depends how you use the laptop
What does the '1.8' mean for boot in the final chart you show? I don't see how a fully shutdown system can use more power than a hibernated system, let alone one in standby, so I'm confused how "boot" is higher on the "power" axis than either standby or hibernate?
Also, where are your units? ;)
sbowe: To remotely access a system in standby/hibernate (or even shutdown), you'll need some sort of wake-on-lan setup. It depends on your hardware configuration, but you probably can figure out something to make it work.
peterfnet: Vista (I think by default) has a hybrid sleep state that combines hibernate and sleep. It will write all of your RAM to hiberfile.sys when going to sleep, but also keep the RAM powered. If the computer loses power unexpectedly in this state, a reboot will bring you back from 'hibernate'. If hibernate isn't in your shutdown menu, this is probably why. Hybrid sleep can be disabled in the advanced power settings window.
Yes, more power improvements are welcome. My HP Pavilion Entertainment laptop with the Windows 7 prebeta only runs 2 hours and 15 to 20 minutes max even when the display is set to the dimmest possible state. Watching Hollywood movies is now a reality but those 3 hour Bollywood movies without AC power is still a dream ;-) But sleep, hibernation and resume from both in Windows Vista and Windows 7 are noticeably faster on my laptop compared to XP.
I was going to point to the same Anandtech article. It would be interesting to know how Windows 7 and Windows XP fare in that benchmark.
For a future Windows version, it would make me very happy as a gamer if something like NVIDIA's HybridPower - discrete GPU turned off and switch to onboard Aero capable GPU - were available on all hardware platforms as an industry standard. Maybe Microsoft and Intel can develop such a standard.