The invention relates to a computer, and in particular, to processor power management.
Processor power consumption can be managed by adjusting processor operating frequency and voltage. The Advanced Configuration and Power Interface (ACPI) specification 2.0 provides several methods for performing this task, such as _PCT (performance control), _PSS (Performance Supported States), and _PPC (Performance Present Capabilities).
In a conventional method, an operating system (OS) issues system management interrupts (SMI) and gives system control to a Basic Input/Output System (BIOS) for executing processor power management. The frequent SMIs, however, may cause computer instability and inefficiency.
In another conventional method, the BIOS provides processor performance state-specific control values for adjusting processor operating frequency and voltage. The OS does not grant system control to the BIOS. An ACPI driver of the OS passes the control values to the processor driver program. The processor driver program derives resultant control values from the original control values and performs processor performance transitions by writing the resultant control values to the performance control register of a processor. This may be time consuming, and comprise querying a plurality of tables using respective portions of the original control values as indices or keys, and combining located values as the resultant control values. The greater the derivation complexity, the more time that may be spent to transit processor performance states.
Hence, there is a need for a method capable of reducing the derivation duration.
Accordingly, some embodiments of invention provide a method for switching processor performance states, implemented in a computer comprising a processor and a read-only memory (ROM). The processor comprises a register including frequency field and a voltage field respectively for controlling processor operating frequency and voltage thereof. A frequency identification and a voltage identification are retrieved from the ROM, bits of which respectively correspond one-to-one to bits of the frequency field and the voltage field, and bit numbers of which are respectively the same as the frequency field and the voltage field. Each bit of the frequency field and the voltage field is respectively filled with a new value reflecting only the value of the bit corresponding thereto included in the frequency identification or the voltage identification.
Also disclosed is a computer, comprising a read-only memory (ROM) and a processor. The ROM stores a frequency identification and a voltage identification. The processor comprises a frequency field and a voltage field respectively for controlling processor operating frequency and voltage thereof, retrieves the frequency identification and the voltage identification from the ROM, bits of which respectively correspond one-to-one to bits of the frequency field and the voltage field. Bit numbers of which are respectively the same as the frequency field and the voltage field, respectively fill each bit of the frequency field and the voltage field with a new value reflecting only the value of the bit corresponding thereto included in the frequency identification or the voltage identification.
Some embodiments of the invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
Methods for simplifying processor performance state transition and a computers utilizing the same are provided.
In
Register 11 comprises two respective sets of bits for adjusting operating frequency and voltage of processor 1, referred to as a frequency field and a voltage field respectively, and bits for controlling whether the processor operating frequency and voltage is adjustable. For example, register 11 comprises 32 bits, five of which form the frequency field and other five form the voltage field. The bit number of the frequency field and the voltage field may vary with specification of processors.
Each of the control values comprises two respective sets of bits corresponding to operating frequency and voltage statuses of processor 1, referred to as a frequency identification and a voltage identification respectively. In some embodiments of the invention, bits of each frequency identification correspond one-to-one to bits of the frequency field, bits of each voltage identification correspond one-to-one to bits of the voltage field, each bit value of a frequency identification corresponds one-to-one to the value of the corresponding bit thereof in the frequency field, and each bit value of a voltage identification corresponds one-to-one to the value of the corresponding bit thereof in the voltage field.
For example, in
In
For example, if the relationship R is an equal relation, the new value of each bit of frequency field 111 and voltage field 112 equals the value of the corresponding bit thereof included in frequency identification 211 or voltage identification 212. For example, when a bit value of frequency identification 211 is “1”, the new value of the corresponding bit thereof included in frequency field 111 is also “1”. When a bit value of frequency identification 211 is “0”, the new value of the corresponding bit thereof included in frequency field 111 is also “0”.
For example, if the relationships R are inverted, new value of each bit of frequency field 111 and voltage field 112 is generated from the inversion of the value of the corresponding bit thereof included in frequency identification 211 or voltage identification 212.
Additionally, new bit values of frequency field 111 and voltage field 112 may be generated from exclusive OR operations of different constant and the values of the corresponding bits thereof included in frequency identification 211 or voltage identification 212. Thus, the relationships R may comprise different exclusive OR operations. The relationships R are assumed as an equal relation in the following description.
The relative order of bits within frequency identification 211 and voltage identification 212 may be the same as corresponding bits thereof within frequency field 111 and voltage field 112.
The absolute order of frequency identification 211 and voltage identification 212 within control value 21 may match the absolute order of frequency field 111 and voltage field 112 within register 11.
For example, when processor 1 executes OS 51 and determines that computer 10 requires performance state transition, steps in
For example, a register comprises 32 bits the least significant bit of which is referred as the first bit. Frequency field 111 and voltage field 112 comprise 20th to 24th bits and 15th to 19th bits respectively. Frequency identification 211 and voltage identification 212 comprise 20th to 24th bits and 15th to 19th bits of control value 21 respectively, wherein the least significant bit thereof is referred as the first bit.
In an example of relationships R comprising an equal relation, processor 1 retrieves original value of register 11 (step S10) and zeroes portions thereof corresponding to frequency field 111 and voltage field 112 to generate a temporary value from the original value (step S12). Processor 1 retrieves control values, such as control value 21 (step S14), and applies an OR operation to the temporary value and the control value to generate a new value of register 11 (step S16). The new value may be adopted as the control value and status value of the _PSS method and written to register 11 to adjust operating frequency and voltage of processor 1 (step S18). The previously described steps are illustrated in the following.
For example, relationships R comprise equal relation. The original value of register 11 and control value 21 are shown in rows R1 and R3 of table 1 respectively. Values of frequency field 111 and voltage field 112 are replaced with frequency identification 211 and voltage identification 212 according to the relationships R, i.e. equal relation, respectively. Specifically, portions of the original value corresponding to frequency field 111 and voltage field 112 are zeroed to generate a temporary value as shown in row R2 (step S12). An OR operation is applied to the temporal value and the control value 21 to generate a new value of register 11 as shown in R4 (step S16). The new value is written to register 11 to adjust processor 1 to operating frequency 500 MHz and voltage 2.5 V (step S18). Similarly, when necessary, processor 1 may be adjusted to operating frequency 1 GHz and voltage 5 V according to control value 22.
The following table 2 shows parameters of an example where the relationships R comprise inversion.
The original value of register 11 and a control value are shown in rows R5 and R6 of table 1 respectively. Values of frequency field 111 and voltage field 112 are replaced with inverted frequency identification (20th˜24th bits) and voltage identification (15th˜19th bits) of the control value according to the relationships R, i.e. inversion, respectively. Specifically, the inverted value of the control value is generated as shown in R7, the same as control value 21. The new value of register 11 is generated as shown in R8 in the procedure as described in the previous example. The new value is written to register 11 to adjust processor 1 to operating frequency 500 MHz and voltage 2.5 V.
The following table 3 shows parameters of an example where the relationships R comprise exclusive OR (XOR) operations.
The original value of register 11 and a control value are shown in rows R9 and R10 of table 1 respectively. The result of an exclusive OR operation applied to the control value and a constant (in R11) is generated as shown in R12. Values of frequency field 111 and voltage field 112 are replaced with bits of the result corresponding to frequency identification (20th˜24th bits) and voltage identification (15th˜19th bits) respectively. The new value of register 11 is generated as shown in R13 in the procedure as described in the previous example. The new value is written to register 11 to adjust processor 1 to operating frequency 500 MHz and voltage 2.5 V.
Hence, generation of new values of frequency field 111 and voltage field 112 does not require parsing of the control values, used to query tables, or arranged with other complex algorithms. Each bit value of frequency field 111 and voltage field 112 reflects the corresponding bit value thereof included in frequency identification 211 or voltage identification 212. Thus, in switching performance states of processor 1, signal control value corresponds to only one new value of frequency field 111 and voltage field 112 and only one operating frequency and voltage status of processor 1.
While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.
Number | Date | Country | Kind |
---|---|---|---|
93125112 | Aug 2004 | TW | national |