You are not logged in.

#1 2017-01-26 11:02:29

gen2arch
Member
Registered: 2013-05-16
Posts: 182

Thermal throttling while compiling a custom kernel

Hi,

when I compile a custom kernel on my new machine with a core i7 quad core processor I get messages like the following in my journal:

Jan 26 11:31:05 machine kernel: CPU0: Core temperature above threshold, cpu clock throttled (total events = 782)
Jan 26 11:31:05 machine kernel: CPU4: Core temperature above threshold, cpu clock throttled (total events = 782)
Jan 26 11:31:05 machine kernel: CPU5: Package temperature above threshold, cpu clock throttled (total events = 1271)
Jan 26 11:31:05 machine kernel: CPU3: Package temperature above threshold, cpu clock throttled (total events = 1271)
Jan 26 11:31:05 machine kernel: CPU1: Package temperature above threshold, cpu clock throttled (total events = 1271)
Jan 26 11:31:05 machine kernel: CPU6: Package temperature above threshold, cpu clock throttled (total events = 1271)
Jan 26 11:31:05 machine kernel: CPU2: Package temperature above threshold, cpu clock throttled (total events = 1271)
Jan 26 11:31:05 machine kernel: CPU7: Package temperature above threshold, cpu clock throttled (total events = 1271)
Jan 26 11:31:05 machine kernel: CPU4: Package temperature above threshold, cpu clock throttled (total events = 1271)
Jan 26 11:31:05 machine kernel: mce_notify_irq: 1 callbacks suppressed
Jan 26 11:31:05 machine kernel: mce: [Hardware Error]: Machine check events logged
Jan 26 11:31:05 machine kernel: CPU0: Package temperature above threshold, cpu clock throttled (total events = 1271)
Jan 26 11:31:05 machine kernel: mce: [Hardware Error]: Machine check events logged
Jan 26 11:31:05 machine kernel: CPU4: Core temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU0: Core temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU2: Package temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU6: Package temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU7: Package temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU1: Package temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU5: Package temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU3: Package temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU0: Package temperature/speed normal
Jan 26 11:31:05 machine kernel: CPU4: Package temperature/speed normal

As the processor has 8 independent threads I set "MAKEFLAGS="-j16"" in /etc/makepkg.conf.

Can someone help me with the following:

Is this normal behavior or does the throtteling indicate that something is not well configured?

What is triggering this cpu throttle: is it something within linux or is it the BIOS of the machine?

What is the difference between "Core" and "Package" temperature?

What programs allow to manipulate the cpu behavior (setting "performance" profiles) from within linux?

Thanks.

Offline

#2 2017-01-26 11:56:26

jaergenoth
Member
Registered: 2015-01-16
Posts: 85

Re: Thermal throttling while compiling a custom kernel

This means your cpu is hitting the thermal throttling temperature limit.
Propably shouldn't happen if you are running a desktop computer, on laptops this happens pretty often as they have worse cooling.
If you are on a desktop, you should check that the cpu heatsink is correctly installed.

gen2arch wrote:

What is triggering this cpu throttle: is it something within linux or is it the BIOS of the machine?

I'm not an expert on processors, but I believe it's the processor itself that decides to throttle itself?

gen2arch wrote:

What is the difference between "Core" and "Package" temperature?

Core temp is the temperature inside the processor, package temp is the temperature of the cpu socket.

gen2arch wrote:

What programs allow to manipulate the cpu behavior (setting "performance" profiles) from within linux?

https://wiki.archlinux.org/index.php/CP … cy_scaling

Last edited by jaergenoth (2017-01-26 11:58:51)

Offline

#3 2017-01-26 12:37:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,444
Website

Re: Thermal throttling while compiling a custom kernel

gen2arch wrote:

As the processor has 8 independent threads I set "MAKEFLAGS="-j16"" in /etc/makepkg.conf.

Why 16?

The data I've seen suggests that the optimal number of make jobs can vary between the number of physical cores and the number of threads based on where the bottleneck actually is.  But in no case have I seen data supporting using more than, certainly not double, the number of threads.  In tests performance stops improving - and generally declines a bit - after jobs > threads.  At job >> threads performance  can decline notably, often due to the thermal throttling that you are seeing.

Some recommend that -j can be 2 times the number of cores, generally on the assumption that this will be the number of threads - but I've never seen a recommendation of 2 times the number of threads.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2017-01-27 12:07:24

gen2arch
Member
Registered: 2013-05-16
Posts: 182

Re: Thermal throttling while compiling a custom kernel

Trilby wrote:
gen2arch wrote:

As the processor has 8 independent threads I set "MAKEFLAGS="-j16"" in /etc/makepkg.conf.

Why 16?.

You are right: thats a mistake, "-j8" is what I intended to do!

I tried the exact same compilation of the kernel (with 175 modules in modeprobe.db) with "-j{16,8,6,4}": the result was that I always got thermal throttling except with "-j4". Throttling occurs at 100C core temperature, temperatures stay close to 100C after throttling.

Compile times were roughly the same for "16, 8, 6", namely 6:20, compression of the three packages (kernel, headers, doc) included; compiling with "-j4" got me no throttling, but compile time was also considerably longer, 10:20.

I guess my machine is special with regard to thermal management as it has such an uncommon formfactor (about the size of a pocket book).

Given the results I'll go with "-j8".

@jaergenoth thanks for your hints also! my machine roughly falls in the "notebook"  category although with a much higher TDP, so I guess thermal throttling is mostly unavoidable.

Thanks

Last edited by gen2arch (2017-01-27 12:42:43)

Offline

Board footer

Powered by FluxBB