Overheating Linux Laptops

As laptops age their cooling effeciency goes down due to dirt/dust.  You may try cleaning them out but sometimes there is still more dust then when new.  Additionally you tend to donate your old laptops to your kids, who invariably use them at higher cpu rates due to more video and/or gaming.

On many linux laptops you can install lm-sensor and fantools.  The first lm-sensors allows you and utilities to see the cpu temp etc.    Fantools allows you to tweak the fan control your fan speed, the idea being you use a higher fan speed sooner to keep the CPU cooler as it runs at higher rates.   You can mess up your hardware if you get this to wrong so I won’t tell you how.  This guy did though and if what he says doesn’t work…. call him not me.  http://tuxtweaks.com/2008/08/how-to-control-fan-speeds-in-ubuntu/

In my case, due to my hardware etc., I wasn’t able to use fancontrol.   Instead I opted to control the CPU speed.   Since these systems can run forever at lower CPU clockspeeds I decided to limit them to speeds where the fans could keep the CPUs cool enough even at 100% processing load on each processor.

apt-get install lm-sensors cpufrequtils

Now find out what your current temps are, and monitor over time if you want.

sensors

Find out your current cpu frequency scaling policies with cpufrequtils

cpufreq-info

Note that you have a different policy for every CPU.   You will see a range of available processor speeds.   Here is the info dump from my desktop.

blackwater ~ # cpufreq-info 
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
 driver: powernow-k8
 CPUs which run at the same hardware frequency: 0
 CPUs which need to have their frequency coordinated by software: 0
 maximum transition latency: 8.0 us.
 hardware limits: 800 MHz - 3.10 GHz
 available frequency steps: 3.10 GHz, 2.40 GHz, 1.90 GHz, 800 MHz
 available cpufreq governors: conservative, ondemand, userspace, powersave, performance
 current policy: frequency should be within 800 MHz and 3.10 GHz.
 The governor "ondemand" may decide which speed to use
 within this range.
 current CPU frequency is 800 MHz (asserted by call to hardware).
 cpufreq stats: 3.10 GHz:5.96%, 2.40 GHz:0.16%, 1.90 GHz:0.79%, 800 MHz:93.10% (484703)
analyzing CPU 1:
 driver: powernow-k8
 CPUs which run at the same hardware frequency: 1
 CPUs which need to have their frequency coordinated by software: 1
 maximum transition latency: 8.0 us.
 hardware limits: 800 MHz - 3.10 GHz
 available frequency steps: 3.10 GHz, 2.40 GHz, 1.90 GHz, 800 MHz
 available cpufreq governors: conservative, ondemand, userspace, powersave, performance
 current policy: frequency should be within 800 MHz and 3.10 GHz.
 The governor "ondemand" may decide which speed to use
 within this range.
 current CPU frequency is 800 MHz (asserted by call to hardware).
 cpufreq stats: 3.10 GHz:6.07%, 2.40 GHz:0.14%, 1.90 GHz:0.66%, 800 MHz:93.13% (470719)
analyzing CPU 2:
 driver: powernow-k8
 CPUs which run at the same hardware frequency: 2
 CPUs which need to have their frequency coordinated by software: 2
 maximum transition latency: 8.0 us.
 hardware limits: 800 MHz - 3.10 GHz
 available frequency steps: 3.10 GHz, 2.40 GHz, 1.90 GHz, 800 MHz
 available cpufreq governors: conservative, ondemand, userspace, powersave, performance
 current policy: frequency should be within 800 MHz and 3.10 GHz.
 The governor "ondemand" may decide which speed to use
 within this range.
 current CPU frequency is 800 MHz (asserted by call to hardware).
 cpufreq stats: 3.10 GHz:5.94%, 2.40 GHz:0.13%, 1.90 GHz:0.63%, 800 MHz:93.31% (441526)
analyzing CPU 3:
 driver: powernow-k8
 CPUs which run at the same hardware frequency: 3
 CPUs which need to have their frequency coordinated by software: 3
 maximum transition latency: 8.0 us.
 hardware limits: 800 MHz - 3.10 GHz
 available frequency steps: 3.10 GHz, 2.40 GHz, 1.90 GHz, 800 MHz
 available cpufreq governors: conservative, ondemand, userspace, powersave, performance
 current policy: frequency should be within 800 MHz and 3.10 GHz.
 The governor "ondemand" may decide which speed to use
 within this range.
 current CPU frequency is 800 MHz (asserted by call to hardware).
 cpufreq stats: 3.10 GHz:5.93%, 2.40 GHz:0.13%, 1.90 GHz:0.65%, 800 MHz:93.28% (450588)

On the laptops in question I wrote some infinite loops to run in the background so the processors could be pegged and watch how the heat was handled.   Unfortunately on the laptops the only speed that didn’t cause undue heat gain was 800MHz.   Yes thats dog slow but its faster than 0 and cheaper than replacing them for now.

/usr/bin/cpufreq-set -c 0 -u 800Mhz
/usr/bin/cpufreq-set -c 1 -u 800Mhz

The laptops had 2 cores.  This will keep your CPU speed upper limit at 800Mhz for CPU 0 and 1.  If you have more or less cores change -c # accordingly.

Finally to make sure this happens every time the system is started add the lines to your startup scripts.  If you are in a particularly retro mood you can add them to /etc/rc.local.   Or you can learn how your particular version of linux handles startup and add them where it makes better sense.

 

For more info on cpufrequtils see this webpage http://www.thinkwiki.org/wiki/How_to_use_cpufrequtils

About these ads