Power Management Concepts on Portable Computers

Before you start

Objectives: learn about different power management specifications and why is power management so important.

Prerequisites: no prerequisites.

Key terms: acpi, apm, bios, device, state, management, schemes, shut, cpu, hard, os, pc, ram, support, disk, hibernate


How to Reduce Power Consumption

We can reduce the amount of power that a PC system consumed significantly by shutting off devices that weren’t in use. We can turn them on when we need them, and when we were done, we can turn them back off. This is especially true with notebook systems where power is a premium. We don’t want to use any power that we don’t have to when we’re running off of batteries.

Power Management Specifications

To provide means of managing power within our PC systems, two specifications have been used over the years. Those are APM and ACPI.

APM

APM stands for Advanced Power Management. APM is the first implementation of power management functionality. It is implemented into the system BIOS in a form of little software programs that decide when a device needs to be turned off. The whole concept of APM is based on timeouts. It checks how long has it been since somebody used some device. If it’s been over a specified amount of time, it turns off that device. The problem with APM is that the OS and the BIOS don’t communicate about what’s going on. The OS doesn’t know that the BIOS just shut off some device, which can cause problems. In addition, the APM standard wasn’t very strict. That means that every BIOS manufacturer implemented APM in a different way, so we had a wide range of APM implementations. Big problem with APM was the fact that it did not support plug-and-play devices. To correct the problems associated with APM, a new standard has been introduced, called the ACPI.

ACPI

ACPI stands for Advanced Configuration and Power Interface. This standard was created by Intel, Microsoft and Toshiba, and it replaced APM. The ACPI specification specifies how a computer’s BIOS, Operating System and devices all communicate with each other about power usage. In other words, the OS and the BIOS work together. The BIOS isn’t shutting off devices that the OS needs. ACPI is also known as Instant Available and Always On. In order to implement ACPI we have to have an ACPI-compliant BIOS and an ACPI-compliant OS. In the Windows family, from Windows 98 on are all ACPI compliant. In addition, most Linux distributions are also ACPI compliant.

With ACPI functionality, the BIOS monitors different devices on our system, like the hard disk, the expansion ports, the CPU, etc., and gathers information about how much power they’re consuming. The BIOS then gives that data to the Operating System, which then decides how much power each device needs. If we’ve used Windows at all, especially if we’ve used Windows on a notebook PC system, then we’ve used ACPI functionality. For example, with ACPI we can configure at what time the monitor is to be turned off. The same is with hard disks. In addition, with ACPI, the Operating System can lower the clock speed of the CPU itself during times when applications really don’t need the full CPU clock speed. The Operating System can monitor and reduce the motherboard and peripheral device power needs by not activating devices until they’re needed. The system can monitor the battery and dynamically change power consumption on one or more devices. The ACPI standard was written to support plug-and-play (APN did not support plug-and-play). As soon as a plug-and-play device is plugged in, it can be monitored and controlled by ACPI.

ACPI States

ACPI defines several different power states. The first ACPI state we need to be aware of is On. In the On state, all power management functions are off, which means that no power management is taking place. All devices, the CPU, the hard disk drive, peripherals, etc., is running at full power.

The next state is Enabled. In the Enabled state, power management is turned on, but no devices are shut down. Everything is running at full power.

The next ACPI state is called Standby. During Standby, the CPU is shut down. However, RAM retains its contents. In addition, all peripheral devices are also shut down. In this state we can restores the computer more quickly than from hibernation.

ACPI also defines another state that’s similar to Standby, called Suspend. In Suspend mode, everything in the PC is shut down, except for RAM. The only device in the motherboard that still has power is RAM, so the contents are retained. In this state we also restore the computer more quickly than from hibernation.

The last ACPI state is called Hibernate. In Hibernate we shut off everything in the PC, RAM as well. During Hibernate, before the system is shut off, the contents of the CPU registers, as well as the contents of RAM, are both written to the file on the hard disk drive. The system is then shut off. When the system is started back up, the file is read, and the appropriate information is read back into the CPU registers, and the appropriate RAM contents are also read back in. So even though the system was completely off, it’s as though it wasn’t off. We restore desktop exactly as it was.

Power Schemes (Plans)

Windows uses Power Schemes (plans) to manage power for the system, which are typically configured for a mobile computer. A power plan is a collection of power settings that are either predefined or created by a user for use in different computing environments. Power plan enables us to maximize computer and battery performance, which can be configured with a single click. Each power plan controls power down settings for the monitor, hard drives, and the entire system, and has settings for when running on AC power or on battery power. We can modify the existing schemes or create new ones to meet our needs, through the Power Options utility in the Control Panel. The preconfigured power schemes available depend on the operating system version and the computer type (laptop or desktop). Some manufacturers also include their own, preconfigured power schemes that are designed to optimize the custom hardware on the computer. Default power schemes are often included to maximize performance or power savings.

By default, in Windows OS we will typically have three different power plans.  In Windows Vista and Windows 7 those are called:

  • Power Saver,
  • Balanced
  • High Performance

Power Saver plan uses the least amount of energy. It reduces the system performance and in that way conserves power. Its primary purpose is to maximize battery life. The High Performance plan provides the highest level of performance by maximizing system performance. The most common plan is Balanced, which balances energy consumption and system performance by adapting CPU speed to our activity. If these three plans don’t cover our needs, we can create the Custom power plan. Custom power plan can be deleted as long as it is not in use. Default power plans can’t be deleted. It provides full power options while the computer is in use but introduces power saver modes while not in use.

We can edit the basic and advanced options for each power scheme trough the Power Option utility in Control Panel. This way we can edit the default plan to meet our specific needs, or create a Custom plan from the default one. On mobile computers, we can configure these options for both when the computer is on the battery power, and when it is plugged in. On desktop computers without the UPS, we can only configure these settings for when the computer is plugged in. Basic power plan settings can be customized by regular user, while advanced settings require administrative rights. Some of the common advanced settings that can be configured are:

  • Require a password on wake up – this will require us to enter our credentials in order to log on when the computer resumes from sleep or hibernation.
  • Power button and lid – we can configure what our computer does when we press the power button or when we close the laptop lid. For example, we can choose to go to sleep, to shut down or simply do nothing.
  • Display – we can configure display dimming options, or when it will turn off.
  • Turn off Hard disk – we can specify after how much time will our hard disks be turned off.
  • Wireless adapter – we can specify wireless settings based on the state of the computer, and in that way save power.
  • USB settings – we can choose to suspend individual USB ports and in that way prevent connected devices to consume power.
  • Peripheral Component Interconnect (PCI) Express – we can choose power saving settings fore PCIe devices.
  • Multimedia settings – when a computer is acting as a media center, we can choose to prevent or allow our computer to sleep, and choose to allow to enter Away mode (turns off monitor, but still allow to run media applications).
  • Processor power management – we can modify the amount of power allotted to the CPU, which has direct effects on the speed of the CPU.
  • Battery options – we can choose to configure our computer to take specific actions or send notifications based on the battery level. For example, we can configure our computer to enter sleep mode when the battery goes below specific power level. Basically, we can set the critical and low battery level. By default, the critical level is 5% and the low level is 10 %. By default, our computer will hibernate when the critical level is reached.

In Windows, we will typically see these power saving states:

  • Shutdown – when we shut down the computer, Windows discards any content in the RAM, clears the Page Files, closes all open applications, logs out the user, and completely shuts down the power to all devices in the computer, and turns the computer off.
  • Hibernate – in this mode, Windows saves the system state and content of the RAM into a file that is stored in the operating system volume. Then it shuts down the computer since no power is needed to maintain the data on the hard disks. As we said, the content of the RAM is stored on the hard disk, and the size of this file is equal to the amount of RAM in the computer. It is normally located in the root of the system drive. This mode will return the information from the disk back into memory when the system starts. It takes longer to resume than the sleep state.
  • Hybrid sleep – this is newer power saving feature. In this mode, the content of the RAM is saved both to the hard drive, similar to hibernate mode, but the information in the RAM is also maintained using a continuous stream of low power from the power supply. The power to all other devices is cut off. If we lose power from the power supply, we will still have all RAM data saved on the hard drive so we can resume our work. This is great for desktop computers, since they don’t have batteries.
  • Sleep – in this mode, the RAM receives continuous stream of low power, while other devices don’t receive power. In sleep, RAM maintains the system state, data and open applications. We can wake the computer using our mouse, keyboard, or network interface. So, those devices also don’t lose power. Sleep mode wakes quickly, requiring only a few seconds. We can configure that our computer goes to hibernation mode after spending specified amount of time in sleep mode. As we can see, hybrid sleep is more effective than sleep mode, since in hybrid sleep we will still have a copy of data from RAM on our disk, while this is not the case in sleep mode. If we loose power while in sleep mode, we loose our working data.

Sleep corresponds to the suspend ACPI state. Sleep is like Standby option which was available in Windows versions prior to Windows 7 (it maintains data in RAM, but powers off other devices). Note that in this state we are still using our battery. With hibernation, data from the RAM is copied to the hard disk, and all devices loose power. Batteries are not used in this case. In Windows, hibernation must be enabled before we can select Hibernate as an option for shutting down the system or in a power scheme. The BIOS must have ACPI support enabled before we can enable hibernation in Windows. If the Hibernate tab is missing, we should check the BIOS. If the BIOS does not have a setting for ACPI, we might need to upgrade the BIOS.

Group Policies also allow us to configure all of the advanced options that we have mentioned. In addition, we can sleep settings, such as preventing sleep mode based on certain applications or if network files are being used. We can also use the powercfg command line tool to configure power plans and other power related settings. Some of the common powercfg options are:

  • -setactive – used to set the active power plan
  • -list – used to list all available power plans
  • -export and -import – used to migrate power plans between computers running Windows
  • -delete – used to remove custom Power Plans (if not active)
  • -devicequery wake_from_any – used to display all of the connected devices that can wake up a client from sleep mode (e.g. keyboard or mouse).
  • -energy – provides a report of the power management settings, including diagnostics that can indicate which applications or devices might be causing power management issues.

Wake On LAN (WoL)

The Wake On LAN (WoL) feature allows a device that receives a special network signal to wake the computer from a sleeping or hibernated state. By default, devices are not allowed to wake the computer, although they might support this feature. We can edit the device properties in Device Manager to allow a device to wake the computer.

Remember

By implementing ACPI, we can dramatically reduce the amount of power our PC systems consume. It’s great when we’re using a portable system. APM is not the same as ACPI, as you will sometimes hear. With APM, the BIOS and OS don’t communicate about power management. APM doesn’t support plug-and-play. Windows uses Power Schemes to manage power for the system.

Example Configuration

We have separate articles in which we show how to deal with power in different versions of Windows:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Giveaway: EaseUS Data Recovery Pro licence ($89.95 worth). Read more
+
%d bloggers like this: