Difference between revisions of "Pentium M undervolting and underclocking"

From ThinkWiki
Jump to: navigation, search
(wikilink)
m (Tested frequencies/voltages: fixed wiki formatting)
 
(58 intermediate revisions by 25 users not shown)
Line 5: Line 5:
 
In the Pentium M, speed and voltage are controlled by software (through the MSR registers). It is up to the operating system to choose the right voltage for each frequency. Normally this is done according to tables published by Intel or according to ACPI tables. However, this can be overriden - in the case of Linux, by a kernel patch.
 
In the Pentium M, speed and voltage are controlled by software (through the MSR registers). It is up to the operating system to choose the right voltage for each frequency. Normally this is done according to tables published by Intel or according to ACPI tables. However, this can be overriden - in the case of Linux, by a kernel patch.
  
{{WARN|Following this instructions will operate your CPU under conditions it was not designed for. Even if your system seems stable, it may still suffer transient faults leading to arbitrary data corruption. In addition, errors in following these instructions (or changes between processor models) may operate the CPU ''above'' its nominal parameters, with effects up to and including laptop meltdown.}}
+
{{WARN|Following this instructions will operate your CPU under conditions it was not designed for. Even if your system seems stable, it may still suffer transient faults leading to arbitrary data corruption. In addition, errors in following these instructions (or changes between processor models) may operate the CPU ''above'' its nominal parameters, which, if taken too far, can cause kernel panics or even possibly hardware damage}}
  
For an example of what may be achieved, on one ThinkPad {{T43}} all voltages could be reduced by 20-30% and moreover, the minimal frequency reduced from 800MHz to 533MHz; this reduced stable CPU temperature by 7-10deg under both idle and burn-in conditions. Combined with an [[ACPI fan control script]] and/or the [[patch for controlling fan speed]], this greatly reduced the [[Problem with fan noise|problem with fan noise]].
+
For an example of what may be achieved, consider these examples: when voltages on one ThinkPad {{T43}} were reduced by 20-30%, stable CPU temperature dropped by 7-10deg under both idle and burn-in conditions. Combined with [[how to control fan speed|fan speed control]], this greatly reduced the [[Problem with fan noise|problem with fan noise]]. On one user's ThinkPad {{R51}}, an undervolt brought the full-load processor temperature down from 87 degrees to 63 degrees while maintaining full stability. The effect was, however, negligible at idle.
  
 
{{NOTE|While under''volting'' has a clear measurable effect, it's not clear if under''clocking'' really works. <tt>/proc/cpuinfo</tt> reflects the underclocked frequency, but enabling debug output on <tt>cpufreq</tt> causes it to say things like "<tt>CPU frequency out of sync: cpufreq and timing core thinks of 533000, is 800000 kHz.</tt>" where the former is the chosen underclocked frequency and the latter is the documented minimum frequency. This discrepancy also causes [[Software Suspend 2]] to oops during suspend.}}
 
{{NOTE|While under''volting'' has a clear measurable effect, it's not clear if under''clocking'' really works. <tt>/proc/cpuinfo</tt> reflects the underclocked frequency, but enabling debug output on <tt>cpufreq</tt> causes it to say things like "<tt>CPU frequency out of sync: cpufreq and timing core thinks of 533000, is 800000 kHz.</tt>" where the former is the chosen underclocked frequency and the latter is the documented minimum frequency. This discrepancy also causes [[Software Suspend 2]] to oops during suspend.}}
  
== Instructions ==
+
There are several methods to control CPU voltage in Linux, and currently all of them require a patched kernel.
  
# Determine the stable voltages for each frequency, using some overclocking/undervolting utility that has specific support for Pentium M ("Centrino") processors. It seems that no such utility exists for Linux. For windows, one good choice is [http://www.pbus-167.com/chc.htm Notebook Hardware Control (NHC)], which conveniently also includes a table of nominal frequencies and voltags (in its help file).<br> Ascertain that at the undervolted settings the CPU actually performs correct computation ([http://www.mersenne.org/freesoft.htm Prime95] in "Tortute Test" mode seems to be a good partial test emphasizing FPU and memory access).<br> Note that beside reducing voltages (undervolting), you can also try to add lower frequencies (underclocking).
+
== Alternative 0: linux-phc ==
 +
 
 +
Use the [[linux-phc]] kernel patch. '''This is the recommended  method, as it is most generic and best supported.'''
 +
* [http://phc.athousandnights.de/ linux-phc home page]
 +
 
 +
The sysfs interface of linux-phc (version 0.3.0 or newer) requires you to specify VID (Voltage ID) numbers; see the documentation in the source package. For pre-Core Intel CPUs, VID is related to voltage (in mV) as follows: <tt>VID=(voltage-700)/16</tt>.
 +
 
 +
A typical configuration command would look something like this:
 +
 
 +
{{cmdroot|echo '27 22 16 10 3' > /sys/devices/system/cpu/cpu0/cpufreq/phc_vids}}
 +
 
 +
Note :<br>
 +
PHC plus patches for >=2.6.35 kernel is in the Gentoo tree as [http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-power/phc-intel/ sys-power/phc-intel]. [http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-power/phc-k8/ sys-power/phc-k8] and the GUI [http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-power/phctool/ sys-power/phctool].
 +
 
 +
== Alternative 1: patch with hard-coded voltages ==
 +
=== Instructions ===
 +
 
 +
# Determine the stable voltages for each frequency, using some overclocking/undervolting utility that has specific support for Pentium M ("Centrino") processors. It seems that no such utility exists for Linux. For windows, one good choice is [http://www.pbus-167.com/chc.htm Notebook Hardware Control (NHC)], which conveniently also includes a table of nominal frequencies and voltages (in its help file).<br> Ascertain that at the undervolted settings the CPU actually performs correct computation ([http://www.mersenne.org/freesoft.htm Prime95] in "Tortute Test" mode seems to be a good partial test emphasizing FPU and memory access).<br> Note that beside reducing voltages (undervolting), you can also try to add lower frequencies (underclocking). If you undervolt a particular frequency too much your machine is likely to crash, so try not to have any other programs open.
 
# Determine the model name string reported by the CPU, e.g., via the "<tt>Model name</tt>" line in {{path|/proc/cpuinfo}}, and likewise the <tt>cpu_family</tt>, <tt>model</tt> and <tt>stepping</tt>.
 
# Determine the model name string reported by the CPU, e.g., via the "<tt>Model name</tt>" line in {{path|/proc/cpuinfo}}, and likewise the <tt>cpu_family</tt>, <tt>model</tt> and <tt>stepping</tt>.
 
# Grab a copy of the example patch below and update it to reflect the parameters, frequencies and voltages you found.
 
# Grab a copy of the example patch below and update it to reflect the parameters, frequencies and voltages you found.
Line 31: Line 48:
 
Please report your results (including voltages)!
 
Please report your results (including voltages)!
  
== Linux kernel patch (example) ==
+
=== Linux kernel patch (example) ===
  
 
The following example shows how to undervolt a Pentium M 750 (1.86GHz) on a ThinkPad {{T43}}. As discussed above, the parameters are specific to this one CPU. You will need to experimentally find the correct settings for your own CPU and adjust the patch accordingly.
 
The following example shows how to undervolt a Pentium M 750 (1.86GHz) on a ThinkPad {{T43}}. As discussed above, the parameters are specific to this one CPU. You will need to experimentally find the correct settings for your own CPU and adjust the patch accordingly.
  
Note that the Pentium M 750 has a 533MHz FSB (quad-pumped 133MHz), hence the use of <tt>OP133</tt>. If you have a Pentium M with 400MHz FSB (i.e., quad-pumped 100MHz, found in [[Intel Pentium M (Dothan)|Dothan]] and older [[Intel Pentium M (Banias)|Banias]]) then in the voltage table change <tt>OP133</tt> to <tt>OP</tt>.
+
Note that the Pentium M 750 has a 533MHz FSB (quad-pumped 133MHz), hence the use of <tt>OP133</tt>. If you have a Pentium M with 400MHz FSB (i.e., quad-pumped 100MHz, found in [[Intel Pentium M (Banias)|Banias]] and older [[Intel Pentium M (Dothan)|Dothan]]) then in the voltage table change <tt>OP133</tt> to <tt>OP</tt>.
 +
 
 +
{{CodeRef|undervolt-pentium-m-2.6.13.1.patch}}
  
<pre>--- linux-2.6.13.1-vanilla/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c 2005-09-10 05:42:58.000000000 +0300
+
Don't forget to disable <tt>CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI</tt>.
+++ linux-2.6.13.1/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c 2005-10-18 04:46:01.000000000 +0200
 
@@ -54,6 +54,7 @@ enum {
 
CPU_DOTHAN_A1,
 
CPU_DOTHAN_A2,
 
CPU_DOTHAN_B0,
 
+ CPU_DOTHAN_C0,
 
CPU_MP4HT_D0,
 
CPU_MP4HT_E0,
 
};
 
@@ -63,6 +64,8 @@ static const struct cpu_id cpu_ids[] = {
 
[CPU_DOTHAN_A1] = { 6, 13, 1 },
 
[CPU_DOTHAN_A2] = { 6, 13, 2 },
 
[CPU_DOTHAN_B0] = { 6, 13, 6 },
 
+ [CPU_DOTHAN_C0] = { 6, 13, 8 },
 
[CPU_MP4HT_D0] = {15,  3, 4 },
 
[CPU_MP4HT_E0] = {15,  4, 1 },
 
};
 
@@ -94,6 +97,12 @@ static struct cpufreq_driver centrino_dr
 
.frequency = (mhz) * 1000, \
 
.index = (((mhz)/100) << 8) | ((mv - 700) / 16) \
 
}
 
+/* Likewise, for processors with 133MHz FSB. */
 
+#define OP133(mhz, mv) \
 
+ { \
 
+ .frequency = (mhz) * 1000, \
 
+ .index = (((mhz)/133) << 8) | ((mv - 700) / 16) \
 
+ }
 
 
/*
 
  * These voltage tables were derived from the Intel Pentium M
 
@@ -202,7 +211,26 @@ static struct cpufreq_frequency_table ba
 
OP(1700, 1484),
 
{ .frequency = CPUFREQ_TABLE_END }
 
};
 
+
 
+/* Intel Pentium M 750, drastically undervoltaged */
 
+static struct cpufreq_frequency_table pentium_m_750[] =
 
+{
 
+     /* MHz  mV */
 
+ OP133( 800,  700),
 
+ OP133(1066,  780),
 
+ OP133(1200,  828),
 
+ OP133(1333,  876),
 
+ OP133(1466,  924),
 
+ OP133(1600,  972),
 
+ OP133(1733, 1020),
 
+ OP133(1866, 1068),
 
+ { .frequency = CPUFREQ_TABLE_END }
 
+};
 
+
 
#undef OP
 
+#undef OP133
 
 
#define _BANIAS(cpuid, max, name) \
 
{ .cpu_id = cpuid, \
 
@@ -225,6 +253,12 @@ static struct cpu_model models[] =
 
BANIAS(1500),
 
BANIAS(1600),
 
BANIAS(1700),
 
+ {
 
+ .cpu_id    =  &cpu_ids[CPU_DOTHAN_C0],
 
+ .model_name = "Intel(R) Pentium(R) M processor 1.86GHz",
 
+ .max_freq  = 1866000,
 
+ .op_points  = pentium_m_750
 
+ },
 
 
/* NULL model_name is a wildcard */
 
{ &cpu_ids[CPU_DOTHAN_A1], NULL, 0, NULL },
 
  
</pre>
+
== Alternative 2: patch with user-space control ==
  
Don't forget to disable <tt>CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI</tt>.
+
If you want to use the Ubuntu 2.6.15 Kernel, please have a look at this thread: http://ubuntuforums.org/showthread.php?t=146366
  
==Alternative patch with user-space control==
+
The [http://fabrice.bellamy.club.fr/bdz.undervolt.2005.10.22.a.patch bdz.undervolt.2005.10.22.a.patch] patch, written by Gentoo-Wiki user "Bdz", allows voltages to be changed without reboot.
There is an [http://gentoo-wiki.com/HOWTO_Undervolt_a_Pentium_M_CPU alternative patch], which allows voltages to be changed without reboot.
 
  
 
It presents a userspace interface, as in the following example:
 
It presents a userspace interface, as in the following example:
Line 119: Line 69:
 
:{{cmdroot|echo "1084,1084,1084,1084,1084,1084,1084,988,908,860" >/sys/devices/system/cpu/cpu0/cpufreq/voltage_table}}
 
:{{cmdroot|echo "1084,1084,1084,1084,1084,1084,1084,988,908,860" >/sys/devices/system/cpu/cpu0/cpufreq/voltage_table}}
  
The same [http://gentoo-wiki.com/HOWTO_Undervolt_a_Pentium_M_CPU page] also gives some helpful hints and scripts for voltage adjustment.
+
The relevant [http://gentoo-wiki.com/HOWTO_Undervolt_a_Pentium_M_CPU page] on Gentoo-Wiki providues further information and some helpful hints and scripts for voltage adjustment.
 +
 
 +
When applying this patch be sure to keep the "ACPI tables for decoding frequency pairs" option -- this patch only allows adjustment of the voltages for the normal clock speeds as reported by the ACPI table in the BIOS.  On some models (e.g., ThinkPad {{T43}}) this does not include all clock speeds supported by the processor.
 +
 
 +
=== Initscript ===
 +
This is a Gentoo initscript for the patch from Gentoo-Wiki user "Bdz".
 +
 
 +
==== Configuration file ====
 +
<source lang="bash">
 +
# /etc/conf.d/undervoltage
 +
 
 +
# voltage table sysfs interface
 +
VTABLE_SYSFS="/sys/devices/system/cpu/cpu0/cpufreq/voltage_table"
 +
 
 +
# switch back to  DEFAULT_VTABLE if undervoltage is stopped? [yes/no]
 +
SWITCH_BACK="no"
 +
 
 +
# pentium-m banias 1,7GHz default voltages
 +
DEFAULT_VTABLE="1484,1308,1228,1116,1004,956"
 +
# pentium-m banias 1,7GHz lowered voltages [ -208mV ]
 +
MOD_VTABLE="1276,1100,1020,908,796,748"
 +
</source>
 +
 
 +
==== Initscript ====
 +
<source lang="bash">
 +
#!/sbin/runscript
 +
# Copyright 1999-2005 Gentoo Foundation
 +
# Distributed under the terms of the GNU General Public License v2
 +
# $Header: $
 +
 
 +
sysfs_check() {
 +
 
 +
        if ! [ -e ${VTABLE_SYSFS} ]; then
 +
                logger "No sysfs voltage_table present. Modifying vcore voltage failed."
 +
                eerror "It seems that the undervolting patch has not been applied to the kernel."
 +
                eerror "see http://gentoo-wiki.com/HOWTO_Undervolt_a_Pentium_M_CPU for further information"
 +
                return 1
 +
        fi
 +
}
 +
 
 +
start() {
 +
        sysfs_check || return 1
 +
        ebegin "Switching to modified voltage table [${MOD_VTABLE}]"
 +
                echo ${MOD_VTABLE} > ${VTABLE_SYSFS}
 +
        eend $?
 +
}
 +
 
 +
# I think it is not necessary to switch to the default voltage table on shutdown
 +
stop() {
 +
        if [ $SWITCH_BACK = "yes" ]; then
 +
                ebegin "Switching back to default voltage table [${DEFAULT_VTABLE}]"
 +
                        echo ${DEFAULT_VTABLE} > ${VTABLE_SYSFS}
 +
                eend $?
 +
        fi
 +
}
 +
</source>
 +
 
 +
== Alternative 3: another patch with user-space control ==
 +
 
 +
The [http://avkrok.net/nw8240/centrino-voltages.diff centrino-voltages.diff] patch, written by Rickard Holmberg, also provides user-space control. See [http://avkrok.net/nw8240/ here] and [http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2005-December/030772.html here] for usage.
 +
 
 +
== Stress Testing ==
 +
 
 +
This [[Undervolt Stress Testing Script|script]] illustrates a very conservative method to stress test your lowered voltage settings.
 +
 
 +
== Tested frequencies/voltages ==
 +
 
 +
If you have done excessive testing with user defined frequencies (stable system for over a month).
 +
and no lookups occur when computing primes with mprime http://mersenne.org/ (gentoo: 'emerge gimps')
 +
you can post your frequencies here. But note that this is just a rough indication, since the stable values will differ between individual processors, even in the same model.
 +
 
 +
{| {{prettytable}}
 +
! CPU Type !! GHz !! Frequency Steps
 +
|-
 +
| Pentium-M Banias || 1.6  || 1212,1084,956,860,796,748
 +
|-
 +
| Pentium-M Banias || 1.7  || 1276,1100,1020,908,796,748
 +
|-
 +
| Pentium-M Dothan || 2.0 || 1084,940,844,764,748
 +
|-
 +
| Pentium-M Dothan || 1.86 || 1068,972,876,780,700
 +
|-
 +
| Pentium-M SL6F7  || 1.6  || 1196,1052,956,860,780,732
 +
|-
 +
| Pentium-M Dothan || 1.6  || 940,876,812,748,716,716
 +
|-
 +
| Pentium-M Dothan || 1.5 || 924,892,860,828,812,796,764,732,700
 +
|-
 +
| Pentium-M Dothan || 1.4 || 924,892,860,828,796,764,732,700
 +
|}
  
Note that this approach only allows adjustment of the voltages for the normal clock speeds (as reported by the ACPI table in the BIOS). On some models (e.g., ThinkPad {{T43}}) this does not inlude all clock speeds supported by the processor.
 
  
==External Sources==
+
Following values were obtained with: (running at the same time)
  
* A [http://forums.anandtech.com/messageview.aspx?catid=51&threadid=1677980 forum discussion] of Pentium M undervolting
+
{{cmdroot|
 +
nice -n19 glxgears &
 +
mplayer somedivx.avi &
 +
cd /usr/src/linux && make -j2
 +
}}
 +
* note1: for pre-Core Intel CPUs, VID is related to voltage (in mV) as follows: VID=(voltage-700)/16 (or: voltage=(VID*16+700) mV)
 +
* note2: when testing for stability you should pay attention to sound too, occasional distortions which disappear after bumping voltage a notch or two
 +
* note4: if you use phc_vids for your script, then take only second number in each pair
 +
{| {{prettytable}}
 +
! Machine !! CPU Type !! GHz !! phc_controls (fid:vid)
 +
|-
 +
| {{T42}} || Pentium-M Dothan (735) || 1.7 || 17:19 14:12 12:8 10:4 8:1 6:1
 +
|-
 +
| {{X31}} || Pentium-M Banias (1.4) || 1.4 || 14:35 12:32 10:25 8:20 6:10 (fairly conservative)
 +
|-
 +
| {{X32}} || Pentium-M Dothan (745) || 1.8 || 18:26 16:20 14:15 12:11 10:6 8:2 6:1
 +
|-
 +
| {{X40}} || Pentium-M Banias LV (718) || 1.2 || 12:18 11:15 10:12 9:9 8:6 6:3
 +
|-
 +
| {{X41T}} || Pentium-M Dothan LV (758) || 1.5 || 15:15 14:13 13:11 12:9 11:7 10:5 9:3 8:2 6:2
 +
|}
  
 
[[Category:Patches]]
 
[[Category:Patches]]

Latest revision as of 01:27, 6 September 2014

Background

Intel Pentium M processors from the Dothan and Banias families can be instructed to operate at voltage and clock frequencies lower than the nominal ones recommended by Intel and used by ThinkPads by default. Experience shows that the processor may continue working correctly at lower-than-nominal voltages and frequencies, thereby reducing power consumption, heat and fan noise.

In the Pentium M, speed and voltage are controlled by software (through the MSR registers). It is up to the operating system to choose the right voltage for each frequency. Normally this is done according to tables published by Intel or according to ACPI tables. However, this can be overriden - in the case of Linux, by a kernel patch.

ATTENTION!
Following this instructions will operate your CPU under conditions it was not designed for. Even if your system seems stable, it may still suffer transient faults leading to arbitrary data corruption. In addition, errors in following these instructions (or changes between processor models) may operate the CPU above its nominal parameters, which, if taken too far, can cause kernel panics or even possibly hardware damage

For an example of what may be achieved, consider these examples: when voltages on one ThinkPad T43 were reduced by 20-30%, stable CPU temperature dropped by 7-10deg under both idle and burn-in conditions. Combined with fan speed control, this greatly reduced the problem with fan noise. On one user's ThinkPad R51, an undervolt brought the full-load processor temperature down from 87 degrees to 63 degrees while maintaining full stability. The effect was, however, negligible at idle.

NOTE!
While undervolting has a clear measurable effect, it's not clear if underclocking really works. /proc/cpuinfo reflects the underclocked frequency, but enabling debug output on cpufreq causes it to say things like "CPU frequency out of sync: cpufreq and timing core thinks of 533000, is 800000 kHz." where the former is the chosen underclocked frequency and the latter is the documented minimum frequency. This discrepancy also causes Software Suspend 2 to oops during suspend.

There are several methods to control CPU voltage in Linux, and currently all of them require a patched kernel.

Alternative 0: linux-phc

Use the linux-phc kernel patch. This is the recommended method, as it is most generic and best supported.

The sysfs interface of linux-phc (version 0.3.0 or newer) requires you to specify VID (Voltage ID) numbers; see the documentation in the source package. For pre-Core Intel CPUs, VID is related to voltage (in mV) as follows: VID=(voltage-700)/16.

A typical configuration command would look something like this:

# echo '27 22 16 10 3' > /sys/devices/system/cpu/cpu0/cpufreq/phc_vids

Note :
PHC plus patches for >=2.6.35 kernel is in the Gentoo tree as sys-power/phc-intel. sys-power/phc-k8 and the GUI sys-power/phctool.

Alternative 1: patch with hard-coded voltages

Instructions

  1. Determine the stable voltages for each frequency, using some overclocking/undervolting utility that has specific support for Pentium M ("Centrino") processors. It seems that no such utility exists for Linux. For windows, one good choice is Notebook Hardware Control (NHC), which conveniently also includes a table of nominal frequencies and voltages (in its help file).
    Ascertain that at the undervolted settings the CPU actually performs correct computation (Prime95 in "Tortute Test" mode seems to be a good partial test emphasizing FPU and memory access).
    Note that beside reducing voltages (undervolting), you can also try to add lower frequencies (underclocking). If you undervolt a particular frequency too much your machine is likely to crash, so try not to have any other programs open.
  2. Determine the model name string reported by the CPU, e.g., via the "Model name" line in /proc/cpuinfo, and likewise the cpu_family, model and stepping.
  3. Grab a copy of the example patch below and update it to reflect the parameters, frequencies and voltages you found.
  4. Apply the patch to your kernel (tested with 2.6.13.1 and 2.6.14-rc2).
  5. To prevent the ACPI table from overriding your table, disable the CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI kernel option.
  6. Compile and install the new kernel.

The changes should be active now. If you want to see debug information attesting to thus, do the following:

  1. Reboot in single mode.
  2. # echo 2 > /sys/module/cpufreq/parameters/debug
  3. # modprobe speedstep-centrino
  4. # dmesg and check for the message "speedstep-centrino: found "Intel(R) Pentium(R) M processor ..."

If you don't see that message, you got the cpu_id or model_name parmaeters wrong. If your system crashes, re-test the voltages and adjust accordingly.

Please report your results (including voltages)!

Linux kernel patch (example)

The following example shows how to undervolt a Pentium M 750 (1.86GHz) on a ThinkPad T43. As discussed above, the parameters are specific to this one CPU. You will need to experimentally find the correct settings for your own CPU and adjust the patch accordingly.

Note that the Pentium M 750 has a 533MHz FSB (quad-pumped 133MHz), hence the use of OP133. If you have a Pentium M with 400MHz FSB (i.e., quad-pumped 100MHz, found in Banias and older Dothan) then in the voltage table change OP133 to OP.

undervolt-pentium-m-2.6.13.1.patch (download)

Don't forget to disable CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI.

Alternative 2: patch with user-space control

If you want to use the Ubuntu 2.6.15 Kernel, please have a look at this thread: http://ubuntuforums.org/showthread.php?t=146366

The bdz.undervolt.2005.10.22.a.patch patch, written by Gentoo-Wiki user "Bdz", allows voltages to be changed without reboot.

It presents a userspace interface, as in the following example:

# cat /sys/devices/system/cpu/cpu0/cpufreq/voltage_table
1356,1356,1356,1356,1356,1356,1356,1244,1116,988
# echo "1084,1084,1084,1084,1084,1084,1084,988,908,860" >/sys/devices/system/cpu/cpu0/cpufreq/voltage_table

The relevant page on Gentoo-Wiki providues further information and some helpful hints and scripts for voltage adjustment.

When applying this patch be sure to keep the "ACPI tables for decoding frequency pairs" option -- this patch only allows adjustment of the voltages for the normal clock speeds as reported by the ACPI table in the BIOS. On some models (e.g., ThinkPad T43) this does not include all clock speeds supported by the processor.

Initscript

This is a Gentoo initscript for the patch from Gentoo-Wiki user "Bdz".

Configuration file

# /etc/conf.d/undervoltage

# voltage table sysfs interface
VTABLE_SYSFS="/sys/devices/system/cpu/cpu0/cpufreq/voltage_table"

# switch back to  DEFAULT_VTABLE if undervoltage is stopped? [yes/no]
SWITCH_BACK="no"

# pentium-m banias 1,7GHz default voltages
DEFAULT_VTABLE="1484,1308,1228,1116,1004,956"
# pentium-m banias 1,7GHz lowered voltages [ -208mV ]
MOD_VTABLE="1276,1100,1020,908,796,748"

Initscript

#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

sysfs_check() {

        if ! [ -e ${VTABLE_SYSFS} ]; then
                logger "No sysfs voltage_table present. Modifying vcore voltage failed."
                eerror "It seems that the undervolting patch has not been applied to the kernel."
                eerror "see http://gentoo-wiki.com/HOWTO_Undervolt_a_Pentium_M_CPU for further information"
                return 1
        fi
}

start() {
        sysfs_check || return 1
        ebegin "Switching to modified voltage table [${MOD_VTABLE}]"
                echo ${MOD_VTABLE} > ${VTABLE_SYSFS}
        eend $?
}

# I think it is not necessary to switch to the default voltage table on shutdown
stop() {
        if [ $SWITCH_BACK = "yes" ]; then
                ebegin "Switching back to default voltage table [${DEFAULT_VTABLE}]"
                        echo ${DEFAULT_VTABLE} > ${VTABLE_SYSFS}
                eend $?
        fi 
}

Alternative 3: another patch with user-space control

The centrino-voltages.diff patch, written by Rickard Holmberg, also provides user-space control. See here and here for usage.

Stress Testing

This script illustrates a very conservative method to stress test your lowered voltage settings.

Tested frequencies/voltages

If you have done excessive testing with user defined frequencies (stable system for over a month). and no lookups occur when computing primes with mprime http://mersenne.org/ (gentoo: 'emerge gimps') you can post your frequencies here. But note that this is just a rough indication, since the stable values will differ between individual processors, even in the same model.

CPU Type GHz Frequency Steps
Pentium-M Banias 1.6 1212,1084,956,860,796,748
Pentium-M Banias 1.7 1276,1100,1020,908,796,748
Pentium-M Dothan 2.0 1084,940,844,764,748
Pentium-M Dothan 1.86 1068,972,876,780,700
Pentium-M SL6F7 1.6 1196,1052,956,860,780,732
Pentium-M Dothan 1.6 940,876,812,748,716,716
Pentium-M Dothan 1.5 924,892,860,828,812,796,764,732,700
Pentium-M Dothan 1.4 924,892,860,828,796,764,732,700


Following values were obtained with: (running at the same time)

# nice -n19 glxgears & mplayer somedivx.avi & cd /usr/src/linux && make -j2

  • note1: for pre-Core Intel CPUs, VID is related to voltage (in mV) as follows: VID=(voltage-700)/16 (or: voltage=(VID*16+700) mV)
  • note2: when testing for stability you should pay attention to sound too, occasional distortions which disappear after bumping voltage a notch or two
  • note4: if you use phc_vids for your script, then take only second number in each pair
Machine CPU Type GHz phc_controls (fid:vid)
T42 Pentium-M Dothan (735) 1.7 17:19 14:12 12:8 10:4 8:1 6:1
X31 Pentium-M Banias (1.4) 1.4 14:35 12:32 10:25 8:20 6:10 (fairly conservative)
X32 Pentium-M Dothan (745) 1.8 18:26 16:20 14:15 12:11 10:6 8:2 6:1
X40 Pentium-M Banias LV (718) 1.2 12:18 11:15 10:12 9:9 8:6 6:3
X41 Tablet Pentium-M Dothan LV (758) 1.5 15:15 14:13 13:11 12:9 11:7 10:5 9:3 8:2 6:2