Wednesday, December 28, 2005

Article: Sleep Mode 101

If you're clueless about the various Sleep Mode (specially you mobile users), then this should be a good newbie guide....

All materials ©2005 by DM, reproduction by permission only
Target Audience: N/E (N=Newbie, E=Hardware Enthusiast, O=Overclocker, B=Budget)

I. "Preparing the bed, pillows, and bedsheet" (Introduction)

If you are wondering about the confusing sleep states, and what it really is, then this short guide is for you. The aim is to provide a basic understanding of the various sleep states, and how they vary from one another.

For example, how do S1 differs from S2? What is S3, and is there even an S0 and S5? So, with this knowledge, or lack thereof, the article will try to give a direct and clear definition of the various sleep states.

"Sleep state" is just one section of bigger much broader industry standard, ACPI. ACPI, or Advanced Configuration and Power Interface, is a specification to establish a "common interface enabling robust operating system (OS)-directed motherboard device configuration and power management of both devices and entire systems". Heavy huh? So as you can see, it's really broad, and Sleep State is just a section of that standard.

II. "Are you still awake?" (Sleeping States)

So without much fuzz, let's list down the various sleep states and how do they differ with one another. Let's list down the various sleep states as defined by ACPI standards:

The Five(5) Sleep States, as defined by ACPI Standards

  1. S1 Sleeping State - The S1 sleeping state is a low wake latency sleeping state. In this state, no context is lost(CPU or chipset) and hardware maintains all context.

  2. S2 Sleeping State - The S2 sleeping state is a low wake latency sleeping state. This state is similar to S1 sleeping state except that the CPU and system cache context is lost (the OS is responsible for maintaining the caches and CPU context). Control starts from the processsor's reset vector after the wake event.

  3. S3 Sleeping State - The S3 sleeping state is a low wake latency sleeping state where all system context is lost except system memory. CPU, cache, and chipset context are lost in this state. Hardware maintains memory context and restores some CPU and L2 configuration context. Control starts from the processor's reset vector after the wake event.

  4. S4 Sleeping State - The S4 sleeping state is the lowest power, longest wake latency sleeping state supported by ACPI. In order to reduce power to a minimum, it is assumed that the hardware platform has powered off all devices. Platform context is maintained.

  5. S5 Soft Off State - The S5 state is similar to S4 state except that the OS does not save any context. The system is in the "soft" off state and requires a complete boot when it wakes. Software uses a different state value to distinguish between the S5 and the S4 state to allow for initial boot operations within the BIOS to distinguish whether or not the boot is going to wake from a saved memory image.

I don't know about you, but I find the definition too geeky for me, aka, I can't dig it. Hardware vendors have an equivalent definition for these sleep states. Let's try what and how the various vendors (manufacturers) define the different sleep states.

The Six(6) Sleep States, as used by vendors

  1. S0 - No Power Management

  2. S1 - Commonly known as Sleep or Standby

  3. S2 - Commonly known as Sleep or Standby

  4. S3 - Commonly known as Sleep, Standby, Suspend, or "Instant-On"

  5. S4 - Commonly known as Hibernation

  6. S5 - Commonly known as "Off"
As you can see from the above list, the definitions from which the various sleep states are known, aren't very descriptive as well. It's not as geeky sounding as the one used on the ACPI standard, but it's still not very clear. With a little digging, we'll add some "geek" points in your portfolio by putting the various sleep states into a more "normal" person's definition.

In a nutshell, S1 thru S4 deals with the varying degree of power saving modes. How much? Well, let's look at the definitions, as simple as I can lay it down without getting too technical.

The Special Sleep State, Sleeping Wide Awake

  • S0 - this state means that there is no power saving whatsoever, system runs at full power without regard to power consumption.

I'm no expert, but I just find this an irony. The S0 sleep state is not sleeping at all!
Next, is the official sleep state listed on the ACPI, in a much simpler definition.

Sleep State, or maybe just a nap?

  1. S1 - this state can easily be worken by moving a mouse or pressing a key. In this stated, monitor and hard drive power can be turned off, and leaving everything "on". This puts your monitor and hardrive to "sleep".

  2. S2 - it is S1, plus shutting down the CPU and its cache. So in additon to monitor and hard drive, the CPU will also be "sleeping" and everything else is "awake".

  3. S3 - it is a step further in power reduction, and turns off everything except those that is needed to keep the contents of the RAM active.

I will just want to emphasize that all these three sleep states requires electricity to enable the PC to detect the "wake up" event. In the event of power failure, everything in the memory, and cpu will be lost.

Sleep State, ZZzzz....

  1. S4 - is defined as "hibernation". This state preserved everything that is on the memory to a non-volatile storage, and writing it into a "special hibernation file". All necessary settings needed to restore the system where it left off are written and preserved until power is fully restored. Mouse click and keystrokes will not wake up the system. A power switch on is required to "wake" the system.

  2. S5 - Well, this machine uses no power (well, technically, it still uses power). The main difference with S4 and S5 is that S4 doesn't have to do a complete reboot, with any applications running on the background be fully restored. S5, on the other hand, requires initialization of applications. S4 can "boot" faster since it will just restore what was saved in the memory, while S5 have to process everything from scratch

The last two sleep state doesn't require any power at all, well, not that you're interested with S5 keeping your information.


III. "Laying down to rest" (Last Words)

As I've mentioned earlier, Sleep States is just a section of a much bigger ACPI standard and I barely scratch the surface with the various definition of sleep states. If you have a fancy for more information, you can dig more details by visiting the ACPI official website. You can see why S5 is defined as "Soft Off" and what state a system is in if it has completly no "power" at all. But as much as I would like to cover that, the standard is too broad and goes beyond the scope of this short article. So till then, I'll be transitioning from G0 to G1 state in a while (oops, I haven't defined it yet, but hey, you can proceed from here on =))!

©2005-Infinity by dm for TPC. Reproduction by Permission

No comments: