LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-14-2018, 10:27 AM   #1
magicm
Member
 
Registered: May 2003
Distribution: Slackware
Posts: 128

Rep: Reputation: 58
Question How to throttle builds to keep temperature lower


First - thanks in advance for any help / advice
Currently - am using sbopkg to upgrade webkit2gtk - and it is about 2/3 way complete. I've done this before, and the build always takes longer and more resources than I remember. But every time I do this, I get concerned at the temperatures that running this build seems to generate in my Thinkpad T420s -

What techniques, system settings, and/or packages can anyone recommend that would allow for throttling, reducing load, etc. of this (or any other process)? Ideally, I'd like something that I could set and forget.
 
Old 04-14-2018, 10:30 AM   #2
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,428

Rep: Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971
I suggest you to use nice to make the programs to behave, well... nice.

Last edited by Darth Vader; 04-14-2018 at 12:00 PM.
 
1 members found this post helpful.
Old 04-14-2018, 10:46 AM   #3
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: Slackware
Posts: 159

Rep: Reputation: 28
Laptops run hot by design. Make sure the laptop's heatsinks are not clogged with dust. Get a laptop cooler if the laptop is overheating.

If you build packages often, you will be better off with a machine built for compute-intensive workloads.
Ed
 
Old 04-14-2018, 11:07 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 10,994

Rep: Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270Reputation: 3270
I guess only, because I do not really know how it works, but make has a -j flag which can influence it. (see man make about -j). But you need to know it also may slow down the build process.
 
Old 04-14-2018, 11:18 AM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro
Posts: 6,397

Rep: Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238Reputation: 1238
I've always thought about clearing off a shelf in the fridge and slip my laptop in there to help keep the CPUs colder. But newer CPUs have throttling so it will not burn up the CPU's.

My Laptop always runs hot whenever I am re-sampling and such. the throttling keeps it from burning out. I had a dual core that I could keep my coffee hot with and it never died on me. That was a workhorse even though the heat from the fan off of the CPU's would feel like it was burning my hand.

your specs for your board.
http://www.notebookreview.com/notebo...ness-laptop/3/

CPU it may have in it.
https://ark.intel.com/products/52229...up-to-3_20-GHz

100 C max running temp, check your dmesg to see what its doing for throttling it down to keep it in specs.
Code:
[ 1517.360658] CPU7: Core temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360659] CPU6: Core temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360661] CPU0: Package temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360663] CPU3: Package temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360664] CPU4: Package temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360665] CPU5: Package temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360667] CPU2: Package temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360668] CPU1: Package temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360669] CPU6: Package temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360672] mce: [Hardware Error]: Machine check events logged
[ 1517.360681] CPU7: Package temperature above threshold, cpu clock throttled (total events = 1)
[ 1517.360683] mce: [Hardware Error]: Machine check events logged
[ 1517.361668] CPU6: Core temperature/speed normal
[ 1517.361669] CPU1: Package temperature/speed normal
[ 1517.361670] CPU0: Package temperature/speed normal
[ 1517.361671] CPU2: Package temperature/speed normal
[ 1517.361672] CPU3: Package temperature/speed normal
[ 1517.361673] CPU4: Package temperature/speed normal
[ 1517.361674] CPU7: Core temperature/speed normal
[ 1517.361675] CPU5: Package temperature/speed normal
[ 1517.361677] CPU7: Package temperature/speed normal
[ 1517.361685] CPU6: Package temperature/speed normal
userx@slackwhere101:~
it should be throttling your CPU's to keep it within spec's.

haha looks like I got to check something of my own.
Code:
[ 1517.360683] mce: [Hardware Error]: Machine check events logged
but that's my system.
its just a throttle thing, for peice of mind
Code:
> $ sudo mcelog
> Hardware event. This is not a software error.
> MCE 0
> CPU 6 THERMAL EVENT TSC 3554a1da6de 
> TIME 1523740441 Sat Apr 14 16:14:01 2018
> Processor 6 heated above trip temperature. Throttling enabled.
> Please check your system cooling. Performance will be impacted
> STATUS 88010003 MCGSTATUS 0
> MCGCAP c09 APICID 6 SOCKETID 0 
> CPUID Vendor Intel Family 6 Model 42
> Hardware event. This is not a software error.

Last edited by BW-userx; 04-14-2018 at 11:33 AM.
 
Old 04-14-2018, 11:28 AM   #6
magicm
Member
 
Registered: May 2003
Distribution: Slackware
Posts: 128

Original Poster
Rep: Reputation: 58
*Embarrassed* - NICE - I should have known better - apparently there is a setting in sbopkg.conf that sbopkg can use to set this when it runs a slackbuild - I've now changed this value from the default 10 to 16. Hopefully that will help for the future. Marking this solved!
 
Old 04-14-2018, 11:45 AM   #7
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,233
Blog Entries: 4

Rep: Reputation: 1764Reputation: 1764Reputation: 1764Reputation: 1764Reputation: 1764Reputation: 1764Reputation: 1764Reputation: 1764Reputation: 1764Reputation: 1764Reputation: 1764
'nice' will not really help. It only lowers the priority of your build so that other things happening on your laptop will run faster. If nothing else is running, your build will run just as fast and just as hot as it does without 'nice'.

You could try editing /etc/rc.d/rc.cpufreq (try it with SCALING_GOVERNOR=powersave) and then reboot.
 
1 members found this post helpful.
Old 04-14-2018, 03:10 PM   #8
magicm
Member
 
Registered: May 2003
Distribution: Slackware
Posts: 128

Original Poster
Rep: Reputation: 58
Hmm - so perhaps I marked this as solved too early?
In any event, it seems as if my laptop is already using powersave (rc.cpufreq attempts to set it to 'ondemand' but that's not what is reported)

Quote:
root@igloo:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
powersave
root@igloo:~# cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
powersave
root@igloo:~# cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
powersave
root@igloo:~# cat /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
powersave
Any other suggestions?
 
Old 04-16-2018, 04:23 AM   #9
elcore
Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 492

Rep: Reputation: Disabled
Could check for available frequency steps with cpufreq-info, and set it manually. I do that all the time.

For example (if you have 2X core) this is usually the default policy:

cpufreq-set -c 0 -g ondemand
cpufreq-set -c 1 -g ondemand

The ondemand governor changes freq based on demand, which is why it's a default.
But you could override if you need max performance for extended period.

cpufreq-set -c 0 -g performance
cpufreq-set -c 1 -g performance

When max performance is no longer needed, or when compiling is done, you could easily do this:

Code:
cpufreq-set -c 0 -f 800M
cpufreq-set -c 1 -f 800M
cpufreq-set -c 0 -g userspace
cpufreq-set -c 1 -g userspace
It disables the dynamic freq, and sets a static one. For when the machine is idle, or not using the cpu at all.

Also, a note from cpufreq-set manual:

Code:
The -f FREQ, --freq FREQ parameter cannot be combined with any other parameter except the -c

Last edited by elcore; 04-16-2018 at 04:25 AM.
 
Old 04-16-2018, 06:52 AM   #10
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 114

Rep: Reputation: Disabled
One of my projects is a program to clamp the CPU frequency when the temperature gets too high, for hardware lacking such a feature/driver in Linux. This thread gives me a reason to finish it.
 
Old 04-16-2018, 08:46 AM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,336

Rep: Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113
Been there, did this:
Code:
#!/bin/sh
# Avoid over heating if need be.
# Here the max frequency allowed is 3500000, adapt to your hardware.
# echo 2500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
cpufreq-info tells the range and the current settings.

Last edited by Didier Spaier; 04-16-2018 at 08:48 AM.
 
1 members found this post helpful.
Old 04-16-2018, 09:28 AM   #12
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 114

Rep: Reputation: Disabled
@55020, the ondemand and conservative governors each have an "ignore_nice_load" in /sys/devices/system/cpu/cpufreq/$GOVERNOR. When "ignore_nice_load" contains "1", then so-called "nice" processes are the same as idle, for the purposes of CPU frequency adjustments.
 
Old 04-16-2018, 10:11 AM   #13
magicm
Member
 
Registered: May 2003
Distribution: Slackware
Posts: 128

Original Poster
Rep: Reputation: 58
Thumbs up

@Didier Spaier

Beauty !! Thank you !!

My current setup reports
Code:
root@igloo:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 
3300000
I assume that your script snippet is in /etc/rc.d/rc.local

So, if I set a value 80-85% of its current max for all the ../cpu/cpu?/.. there, it should set new ceilings.

XLNT !!
 
Old 04-16-2018, 12:34 PM   #14
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,336

Rep: Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113Reputation: 3113
Quote:
Originally Posted by magicm View Post
I assume that your script snippet is in /etc/rc.d/rc.local
No I start it when needed, like when compiling webkit2gtk...

Last edited by Didier Spaier; 04-16-2018 at 12:40 PM.
 
Old 04-16-2018, 04:56 PM   #15
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 114

Rep: Reputation: Disabled
Maybe this script can help?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Temperature inside computer box and CPU temperature Lola Kews Linux - Hardware 14 11-29-2013 06:22 PM
CPU temperature lower with 64-bit Mint Jeays Linux - Hardware 3 09-26-2013 07:13 PM
[SOLVED] Regular expression needed to write [[:lower:]] to [[:lower:]] and [[:upper:]] rgdacosta Programming 13 04-05-2012 12:50 PM
ACPI temperature reading makes my CPU throttle uraldinho Linux - Laptop and Netbook 6 08-26-2008 11:25 PM
how do you throttle bandwidth? wincen Linux - Networking 1 05-15-2005 12:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration