G state, D state, C state, P state, what are they? -- ACPI


The following are extracted from wikipedia.org.

Global states


The ACPI specification defines the following seven states (so-called global states) an ACPI-compliant computer system can be in:


G0 Working is the normal working state of the computer, meaning that the operating system and whatever applications, run. The CPU(s) execute instructions. Within this state (i.e., without entering G1 Sleeping), it is possible for CPU(s) and devices like hard drives, DVD drives, etc. to be repeatedly put into and come back from low-energy states, called C0–Cn and D0–D3. (Laptops, for example, routinely power down all currently unused devices when running on battery; some computers do this to reduce noise.)
G1 Sleeping subdivides into the four states S1 through S4. The time needed to bring the system from here back into G0 Working (wake-latency time) is shortest for S1, short for S2 and S3, and not so short for S4.


S1 is the most power-hungry of sleep modes. All processor caches are flushed, and the CPU(s) stop executing instructions. Power to the CPU(s) and RAM is maintained; devices that do not indicate they must remain on may be powered down. Some newer machines do not support S1; older machines are more likely to support S1 than S3.


S2 is a deeper sleep state than S1, where the CPU is powered off; however, it is not commonly implemented.


S3 is called Standby in Windows, Sleep in Mac OS X, and sometimes also Suspend to RAM (STR), although the ACPI specification mentions only the terms S3 and Sleep. In this state, main memory (RAM) is still powered, although it is almost the only component that is. Since the state of the operating system and all applications, open documents, etc. lies all in main memory, the user can resume work exactly where he/she left off—the main memory content when the computer comes back from S3 is the same as when it was put into S3. (The specification mentions that S3 is rather similar to S2, only that some more components are powered down in S3.) S3 has two advantages over S4; the computer resumes in about the time it takes the monitor to come on, secondly if any running applications (open documents, etc) have private information in them, this will not be written to the disk. Desktop users using this state may want to disable disk caching (also called disk buffer) so that, in the event of a power failure, the system disk is less likely to become corrupted due to data in the cache not being written to the disk.


S4 -- Main article: Hibernate (OS feature). S4 is called Hibernation in Windows, Safe Sleep in Mac OS X, and sometimes also Suspend to disk, although the ACPI specification mentions only the term S4. In this state, all content of main memory is saved to a hard drive, preserving the state of the operating system, all applications, open documents etc. That means that after coming back from S4, the user can resume work where it was left off in much the same way as with S3. The difference between S4 and S3, apart from the added time of moving the main memory content to disk and back, is that a power loss of a computer in S3 makes it lose all data in main memory, including all unsaved documents, while a computer in S4 is unaffected. S4 is quite different from the other S states and actually resembles G2 Soft Off and G3 Mechanical Off more than it resembles S1–S3.
G2 (S5) Soft Off-- G2, S5, and Soft Off are synonyms. G2 is almost the same as G3 Mechanical Off, but some components remain powered so the computer can "wake" from input from the keyboard, LAN, or USB device [2]. This state is the same as G3 Mechanical Off, in that the boot procedure must be run to bring the system from G2 to G0 Working. G3 Mechanical Off is entered only when a power loss occurs, whereas G2 is initiated by the operating system (typically because the user issued a shutdown command in some way). The computer is not safe for disassembly in the G2 state due to the components that remain powered, however it is safe to unplug the computer and, after approximately 20 seconds, the computer will be in the G3 state. It is always advisable to unplug a desktop computer (and wait 20 seconds) prior to "disassembly", because, although internal drives are usually not powered, the (PS2) keyboard, USB ports, mainboard, expansion cards, and power supply may remain powered, even if the computer is not used to wake from input to these devices.
G3 Mechanical Off: The computer's power consumption is very close to zero, to the point that the power cord can be removed and the system is safe for disassembly (typically, only the real-time clock is running off its own small battery). The computer falls into this state when a power loss occurs, e.g. in case of a power outage. Once power is restored, a full boot procedure is necessary to bring the system from G3 to G0 Working.
Furthermore, a state Legacy is defined as the state when an operating system runs which does not support ACPI. In this state, the hardware and power are not managed via ACPI, effectively disabling ACPI.
(Reference: ACPI specification 3.0b is linked to under External links, section 7.3.4)


Device states

The device states D0-D3 are device-dependent:
D0 Fully-On is the operating state.
D1 and D2 are intermediate power states whose definition varies by device.
D3 Off has the device powered off and unresponsive to its bus.

Processor states

The CPU power states C0-C3 are defined as follows:
C0 is the operating state.
C1 (often known as Halt) is a state where the processor is not executing instructions, but can return to an executing state essentially instantaneously. Some processors, such as the Pentium 4, also support an Enhanced C1 state (C1E) for lower power consumption.
C2 (often known as Stop-Clock) is a state where the processor maintains all software-visible state, but may take longer to wake up.
C3 (often known as Sleep) is a state where the processor does not need to keep its cache coherent, but maintains other state. Some processors have variations on the C3 state (Deep Sleep, Deeper Sleep, etc.) that differ in how long it takes to wake the processor.

Performance states

While a device or processor is operating (D0 and C0, respectively), it can be in one of several power-performance states. These states are implementation-dependent, but P0 is always the highest-performance state, with P1 to Pn being successively lower-performance states, up to an implementation-specific limit of n no greater than 16.
P-states are called SpeedStep in Intel processors, Cool'n'Quiet in AMD processors and PowerSaver in VIA processors.