The present invention relates to the field of computer systems, more particularly relating to methods and apparatuses for power management in computer systems.
A variety of techniques are known for reducing the power consumption in computer systems. For example, the Advanced Configuration and Power Interface (ACPI) Specification (Rev. 2.0a, Mar. 31, 2002) sets forth information about how to reduce the dynamic power consumption of portable and other computer systems. With respect to processors used in computer systems, different processor power states (or C states) are defined in the ACPI Specification. Mobile computer systems typically include implementation of a variety of C states (e.g., C0, C1, C2, and C3) to save power.
In the C0 state, the processor is considered to be in an active state, executing code and performing useful work. In any of the non-C0 states, the processor may be considered to be idle. For example, in the C1 state, the processor may be able to respond to snoop transactions, and wake up very quickly (also referred to as having low latency exit). The processor may progressively cycle through the other lower states such as C2 and C3 as necessary to save even more power. C2 is a stop grant or mobile “Quick Start” state, where typically clocks are gated off to a large portion of the processor die. The processor is able to service snoops in the C2 state. The C2 state also supports a fairly low latency exit to allow software to quickly resume execution. A processor in the C2 state may not return to the C0 state as quickly as a processor in the C1 state. However, a processor in the C2 state may not consume as much power as a processor in the C1 state.
C3 is a deep sleep state, where clocks may be gated either internally or externally to the entire processor. In the C3 state, the processor is unable to snoop bus master transactions. A processor in the C3 state may have higher latency exit to return to the C0 state as compared to a processor in the C2 or C1 state.
The following drawings disclose various embodiments of the present invention for purposes of illustration only and are not intended to limit the scope of the invention.
In some embodiments, a system and method for determining a next processor idle state is disclosed. The next processor idle state may be determined based on a previous processor idle state and a prediction of the period that the processor may remain in the next idle state.
In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention. It will be evident, however, to one skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known structures, processes and devices are shown in block diagram form or are referred to in a summary manner in order to provide an explanation without undue detail.
Computer System
The chipset 107 may include a memory control hub (MCH) 110. The MCH 110 may include a memory controller 112 that is coupled to memory 115. The memory 115 may store data and sequences of instructions that are executed by the CPU 102 or any other processing devices included in the computer system 100. The MCH 110 may include a display controller 113. Display 130 may be coupled to the display controller 113. The chipset 107 may also include an input/output controller hub (ICH) 140. The ICH 140 is coupled with the MCH 110 via a hub interface 141. The ICH 140 provides an interface to input/output (I/O) devices within the computer system 100. The ICH 140 may include PCI bridge 146 that provides an interface to PCI bus 142. The PCI bridge 146 may provide a data path between the CPU 102 and peripheral devices. An audio device 150 and a disk drive 155 may be connected to the PCI bus 142. The disk drive 155 may include a storage media to store data and sequences of instructions that are executed by the CPU 102 or any other processing devices included in the computer system 100. Although not shown, other devices may also be connected to the PCI bus 142. For example, they may include network interface controller, communication device, keyboard, etc.
Idle State Determination Based on Past Busy Rate
The selection of the appropriate idle state is normally performed by an operating system (OS). Typically, the OS selects the idle state based on past busy rate. That is, if the past busy rate indicates that the processor was normally idle, a low power idle state (e.g., C2 or C3 state) may be used. If the past busy rate indicates that the processor was normally busy, then a low latency idle state (e.g., C1 state) may be used.
In a high interrupt rate environment, if the handling of the interrupt does not take much processing time, the average processor busy rate may stay relatively low, and the OS may select the low power C state for the processor during the idle period, as illustrated in
Determination of Next Idle State Based on Previous Idle Period
For some embodiments, each idle state may be associated with a threshold time. The threshold time for an idle state that is associated with lower power consumption (e.g., C3 state) may be longer than the threshold time for an idle state that is associated with low latency exit (e.g., C1 state). For example, a threshold time of more than 500 microseconds may be associated with the C3 state; a threshold time of more than 200 microseconds but less than or equal to 500 microseconds may be associated with the C2 state; and a threshold time less than or equal to 200 microseconds may be associated with the C1 state.
For some embodiments, each idle state may be associated with a likelihood or probability that it may be selected as the next idle state. The likelihood of being selected may be referred to herein as a selection state. A higher selection state value may correspond to a higher probability that the idle state is selected as the next idle state. For example, the selection states may be defined as:
A point in between the selection states “2” and “3” may be viewed as 50% likelihood that an idle state is either selected or not selected as a next idle state.
Initially, an idle state may be associated with any selection state. For example, each of the idle states C1 to C3 may initially be associated with the selection state “1”. In block 310 of the current example, the selection state for the C1 state is set at “1”. This is illustrated with a token placed at a position representing the selection state “1” for the C1 state. Similarly, a token is placed at a position representing the selection state “1” for the C2 state, and a token is placed at a position representing the selection state “4” for the C3 state.
For some embodiments, the selection states of the idle states may be adjusted based on a possible next idle state. For example, from block 305, when the possible next idle state 350 is determined as the C3 state, the selection state for the C3 state may be incremented to a next higher likelihood of being selected. In addition, the selection states for the C2 and C1 states may be decremented to a next lower likelihood of being selected. When a selection state associated with an idle state is at its highest likelihood of being selected (e.g., “4”), the selection state may not be incremented. Instead, it may remain the same or be decremented to a next lower likelihood of being selected (e.g., from “4” to “3”). Similarly, when a selection state associated with an idle state is at its lowest likelihood of being selected (e.g., “1”) the selection state may not be decremented. Instead, it may remain the same or be incremented to a next higher likelihood of being selected (e.g., from “1” to “2”). The possible next idle state may be verified against its associated selection state. This is to determine if the possible next idle state may need to be adjusted before it can be used as the next idle state.
For some embodiments, when the selection state associated with a possible next idle state is more than 50% likelihood of being selected, the possible next idle state may be used as the next idle state.
For some embodiments, when the selection state associated with a possible next idle state is less than 50% likelihood of being selected, a previous idle state may also be used together with the selection state associated with the possible next idle state to determine the next idle state. Following is one technique that may be used to determine the next idle state using the previous idle state. When the selection state associated with the possible next idle state is at less than 50% likelihood of being selected (e.g., “2” or “1”), then if the possible next idle state is supposed to help save more power than the previous idle state (e.g., C3 saves more power than C1), the possible next idle state may be adjusted to a next higher power consumption idle state (e.g., from C3 to C2) and used as the next idle state; otherwise if the possible next idle state is supposed to help save less than the previous idle state (e.g., C1 saves less power than C2), then the possible next idle state may be adjusted to a next lower power consumption idle state (e.g., from C1 to C2) and used as the next idle state. The technique may also be described in the following pseudo-code example:
This technique of considering the previous idle state in determining the next idle state is further illustrated in the following examples related to
The processor described in the example in
Since the possible next idle state 351 determined from the block 306 is the C1 state, the selection state for the C1 state is examined. As illustrated in block 311, the selection state for the C1 state is incremented by one (from “1” to “2”). Since the C3 state is not the possible next state, the selection state of the C3 state is decremented by one (from “4” to “3”). The same decrement would normally need to be done to the C2 state. However, since the selection state of the C2 state is already at its lowest value of “1”, the selection state of the C2 state may remain the same at “1”.
In the current example, the selection state associated with the possible next idle state 351 is at “2” (less likely to be selected), and the possible next idle state 351 is the C1 state which may save less power than the previous idle state 321 (which was the C3 state). Therefore, the possible next idle state may be adjusted to a next lower power consumption idle state (e.g., C1 to C2) and used as the next idle state. Thus, the next idle state 316 is the C2 state, as illustrated in
The processor described in the example in
Since the possible next idle state 352 determined from the block 307 is the C1 state, the selection state for the C1 state is examined. As illustrated in block 312, the selection state for the C1 state is incremented by one (from “2” to “3”). Since the C3 state is not the possible next idle state, the selection state of the C3 state is decremented by one (from “3” to “2”). The same decrement would normally need to be done to the C2 state. However, since the selection state of the C2 state is already at its lowest value of “1”, the selection state of the C2 state may remain the same at “1”.
In the current example, the selection state associated with the possible next idle state 352 (C1 state) is at “3” (more than likely to be selected), then the previous idle state 322 may not need to be considered, and the possible next idle state 352 may be used as the next idle state. Thus the next idle state 317 is the C1 state, as illustrated in
The processor described in the example in
Since the possible next idle state 353 determined from the block 308 is the C2 state, the selection state for the C2 state is examined. As illustrated in block 313, the selection state for the C2 state is incremented by one (from “1” to “2”). Since the C3 state is not the possible next idle state, the selection state of the C3 state is decremented by one (from “2” to “1”). Similarly, since the C1 state is not the possible next idle state, the selection state of the C1 state is decremented by one (from “3” to “2”).
In the current example, the selection state associated with the possible next idle state 353 (C2 state) is at “2” (less likely to be selected), and the possible next idle state 353 is the C2 state which may save more power than the previous idle state 323 (which was the C1 state). Therefore, the possible next idle state 353 may be adjusted to a next higher power consumption idle state (e.g., C2 to C1) and the adjusted possible next idle state may be used as the next idle state. Thus, the next idle state 318 is the C1 state, as illustrated in
Determination of Next Idle State Based on Device Driver Interrupts
For some embodiments, the selection of a next idle state may be performed using input from one or more device drivers. The input may include information about when an interrupt associated with a device driver is estimated to occur.
Interrupts generated by a device may be periodic. For some embodiments, a device driver may include logic to estimate when a next interrupt may be generated by an associated device. Any techniques may be used to estimate when the next interrupt may be generated. Referring to
This next interrupt time 417 may be subtracted from a current time 418, and the result may be used as an estimate of a next idle period 420. This operation may be performed by an OS, and the estimate of the next idle period 420 may be provided to the processor 400. When the processor 400 is to enter an idle state, the estimate of the next idle period 420 may be used by idle state selection logic 425 to determine which idle state 440 to enter. The idle state selection logic 425 may compare the estimate of the next idle period 420 with the threshold time associated with the different idle states. The threshold time is described above with
Process
The operations of these various techniques may be implemented by a processor in a computer system. The processor may execute sequences of computer program instructions that are stored in a memory that may be considered to be a machine-readable storage media. The memory may be random access memory, read only memory, a persistent storage memory, such as mass storage device or any combination of these devices. Execution of the sequences of instruction may cause the processor to perform operations according to the processes described in
Although the present invention has been described with reference to specific exemplary embodiments, it will be evident that various modifications and changes may be made to these embodiments without departing from the broader spirit and scope of the invention as set forth in the claims. Accordingly, the specification and drawings are to be regarded in an illustrative rather than a restrictive sense.
Number | Name | Date | Kind |
---|---|---|---|
4593367 | Slack et al. | Jun 1986 | A |
5954820 | Hetzler | Sep 1999 | A |
6105139 | Dey et al. | Aug 2000 | A |
6516307 | Masuoka et al. | Feb 2003 | B1 |
6845456 | Menezes et al. | Jan 2005 | B1 |
7047224 | Neuneier et al. | May 2006 | B1 |
7240223 | de Cesare et al. | Jul 2007 | B2 |
20030217296 | Ma | Nov 2003 | A1 |
20040139356 | Ma | Jul 2004 | A1 |
20070118631 | Devarakonda et al. | May 2007 | A1 |
20070234088 | Marshall et al. | Oct 2007 | A1 |
20070245163 | Lu et al. | Oct 2007 | A1 |
20070297327 | Strom | Dec 2007 | A1 |
Number | Date | Country | |
---|---|---|---|
20080028240 A1 | Jan 2008 | US |