[sf-lug] Overheating and CPU throttling
Josh Greenland
joshuag1 at mindspring.com
Sun Jan 13 05:50:49 PST 2019
Akkana Peck wrote:
> My Thinkpad X201 laptop has developed an overheating problem.
> Randomly, when I'm doing something lengthy and CPU intensive
> like building Firefox, it will shut down without warning. Afterward,
> I have messages like this in /var/log/kern.log:
> thermal_zone0: critical temperature reached (100 C), shutting down
>
> I've found lots of pages with people with similar problems,
> getting lots of responses like "Any modern Linux computer should
> automatically throttle its CPU when temperatures get high". No one
> explains how this automatic throttling is supposed to happen, or how
> to enable it if it's not happening, or what "modern" means (is it
> the CPU that needs to be modern? The BIOS? The kernel? How modern?)
>
> What I'd really like is a daemon or kernel setting that monitors
> the temperature and, if it exceeds max (well before it reaches
> critical), scales down the CPU frequency, or kills or (preferably)
> suspends whatever process is running away with the CPU, or suspends
> the machine rather than shutting down. I have started down the path
> of writing such a daemon, but it's complicated by not wanting to
> suspend certain processes like X even if their CPU usage looks high
> due to some other app. And it's hard to believe Linux doesn't
> already offer a solution to this problem.
>
> More system details:
>
> This X201 has been my main workhorse for 5+ years and never had
> temperature problems until a few weeks ago. I have opened it
> and don't see any dust bunnies around the fan.
>
> Processor is a quad-core Intel(R) Core(TM) i5 CPU M 540 @ 2.53GH.
> Distro is Debian Testing. Kernel was 4.18.0-2-amd64, which I was
> stuck on because of a modeset bug in 4.18.0-3, but it looks like
> 4.19.0-1 has fixed it so now I've upgraded.
>
> /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor is
> "ondemand", if that matters; though it doesn't seem from
> https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt
> like any of the governors look at temperature at all.
>
> Any suggestions? Any good articles I could read on how this
> scaling/governor/thermal/cpufreq stuff is supposed to work?
>
> ...Akkana
It might not hurt to install the powertop utility and use it to check
power usage, especially of hardware resources that you don't use, and to
use it to turn on all powersaving capabilities on your system. It's
made a huge difference on a hot-running system that I use, and has
helped on an older Thinkpad that I spend a lot of time on.
You can also use powertop to see what hardware resources stop using
power when you unload their modules.
I also use the cpupower utility, which has allowed me to put maximum
limits on CPU frequency when my systems run too hot -- most often during
compiles.
I use the sensors utility from the lm_sensors package and i7z to keep an
eye on temperature and fan speed.
powertop, cpupower, lm_sensors and i7z are all packages on Archlinux's
respositories. I don't know about their availability on other distros.
'
There is also thermald, a daemon software that may have been designed to
do what you want.
More information about the sf-lug
mailing list