# i7-3740QM, pstate, powersave and overheating

## gryf

So, I've spent a quite some time on trying to prevent my laptop from burning entire city.

The actors:

- Dell Latitude E6430 with i7-3740QM CPU

- Gentoo (obviously) with kernel 4.14.x

- Debian testing with kernels 4.16.x

I've noticed some time ago, that this laptop tends to go beyond usual temperatures, even for this particular processor, which have working temperature pretty high. But lately, I've started to have ~60°C at idle and in stress over 98-102°C which is almost at the upper limit for this cpu. I didn't joined the dots than, but now I think all that madness begins with 4.x kernel line.

I've started with cleaning cooling system and replacing thermal paste with the fresh one, which helps for some time, but temperatures always back to ~60-70°C at idle.

Than, I've decided to replace this laptop with another one, which I have from work, removed hard drive and forgot about the issue.

Lately I have dig it up again, put the spare hard drive and installed Debian testing, since I needed a machine for a certain task. I was so surprising that temperatures was around 48-52°C at idle and the fan was not trying to replace my hair dryer…

So I've started to investigate. First of all, I've checked up what drivers are used for frequency and idle control, installed `i7z` and `cpupower` for measurements, and trying to find anything useful on the internet. I found several threads regarding pstate and frequency, but all of the hints I could find there doesn't solve the issue. Conclusion was, that on Debian there is almost fanless idle with frequency ~1.2GHz and temperatures around 55°C, while on Gentoo I have on idle crazy and noisy fan, ~70°C and ~3,6GHz most the time (with some drops to 3.2GHz but, temperature was constant).

Finally, I've cloned my working Gentoo system and made dual-boot with Debian for investigating purposes on this machine. And using this[1] thread, and Debian prepared the kernel config hoping for less heat.

Here is my kernel conf on Gentoo:

```
# grep -P "^[^#].*(FREQ|IDLE|PSTATE)" /usr/src/linux/.config

CONFIG_NO_HZ_IDLE=y

CONFIG_GENERIC_SMP_IDLE_THREAD=y

CONFIG_ACPI_CPU_FREQ_PSS=y

CONFIG_ACPI_PROCESSOR_IDLE=y

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_GOV_ATTR_SET=y

CONFIG_CPU_FREQ_GOV_COMMON=y

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=m

CONFIG_CPU_FREQ_GOV_USERSPACE=m

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

CONFIG_X86_INTEL_PSTATE=y

CONFIG_X86_PCC_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ_CPB=y

CONFIG_X86_AMD_FREQ_SENSITIVITY=m

CONFIG_CPU_IDLE=y

CONFIG_CPU_IDLE_GOV_LADDER=y

CONFIG_CPU_IDLE_GOV_MENU=y

CONFIG_INTEL_IDLE=y

CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m

CONFIG_PM_DEVFREQ=y

CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=m

```

So the acpi/freq/pstate crazy stuff is the same as in Debian kernel configuration:

```
# grep -P "^[^#].*(FREQ|IDLE|PSTATE)" /boot/Debian/config-4.16.0-2-amd64

CONFIG_NO_HZ_IDLE=y

CONFIG_GENERIC_SMP_IDLE_THREAD=y

CONFIG_ACPI_CPU_FREQ_PSS=y

CONFIG_ACPI_PROCESSOR_IDLE=y

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_GOV_ATTR_SET=y

CONFIG_CPU_FREQ_GOV_COMMON=y

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=m

CONFIG_CPU_FREQ_GOV_USERSPACE=m

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

CONFIG_X86_INTEL_PSTATE=y

CONFIG_X86_PCC_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ_CPB=y

CONFIG_X86_AMD_FREQ_SENSITIVITY=m

CONFIG_CPU_IDLE=y

CONFIG_CPU_IDLE_GOV_LADDER=y

CONFIG_CPU_IDLE_GOV_MENU=y

CONFIG_INTEL_IDLE=y

CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m

CONFIG_PM_DEVFREQ=y

CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=m

```

And the fun begins. After several trials I've ended with those on Gentoo so far.

i7z output:

```
Cpu speed from cpuinfo 2690.00Mhz

cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc

Linux's inbuilt cpu_khz code emulated now

True Frequency (without accounting Turbo) 2691 MHz

  CPU Multiplier 27x || Bus clock frequency (BCLK) 99.67 MHz

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]

  TURBO ENABLED on 4 Cores, Hyper Threading ON

  Max Frequency without considering Turbo 2790.67 MHz (99.67 x [28])

  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  37x/36x/35x/35x

  Real Current Frequency 3266.57 MHz [99.67 x 32.77] (Max of below)

        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp  VCore

        Core 1 [0]:       3266.57 (32.77x)         1    1.03       1       0    97.5    68  1.2109

        Core 2 [1]:       2797.87 (28.07x)      1.15    3.63       1       0    94.2    67  1.2109

        Core 3 [2]:       2209.00 (22.16x)         1    2.13       1       0    96.3    67  1.2109

        Core 4 [3]:       2919.44 (29.29x)      1.01    1.36       1       0    96.5    63  1.2360

C0 = Processor running without halting

C1 = Processor running with halts (States >C0 are power saver modes with cores idling)

C3 = Cores running with PLL turned off and core cache turned off

C6, C7 = Everything in C3 + core state saved to last level cache, C7 is deeper than C6

  Above values in table are in percentage over the last 1 sec

[core-id] refers to core-id number in /proc/cpuinfo

'Garbage Values' message printed when garbage values are read

  Ctrl+C to exit

```

Note, that temperature is quite high and fan is constantly running.

cpupower:

```
# cpupower info

analyzing CPU 0:

perf-bias: 6

# cpupower idle-info

CPUidle driver: intel_idle

CPUidle governor: menu

# cpupower frequency-info

analyzing CPU 0:

  driver: intel_pstate

  CPUs which run at the same hardware frequency: 0

  CPUs which need to have their frequency coordinated by software: 0

  maximum transition latency:  Cannot determine or is not supported.

  hardware limits: 1.20 GHz - 3.70 GHz

  available cpufreq governors: performance powersave

  current policy: frequency should be within 1.20 GHz and 3.70 GHz.

                  The governor "powersave" may decide which speed to use

                  within this range.

  current CPU frequency: Unable to call hardware

  current CPU frequency: 2.84 GHz (asserted by call to kernel)

  boost state support:

    Supported: yes

    Active: yes

    3500 MHz max turbo 4 active cores

    3500 MHz max turbo 3 active cores

    3600 MHz max turbo 2 active cores

    3700 MHz max turbo 1 active cores

# cpupower monitor

    |Nehalem                    || SandyBridge        || Mperf              || Idle_Stats

CPU | C3   | C6   | PC3  | PC6  || C7   | PC2  | PC7  || C0   | Cx   | Freq || POLL | C1   | C1E  | C3   | C6   | C7

   0|  0,23|  0,00|  0,00|  0,00|| 96,55|  0,00|  0,00||  0,73| 99,27|  3506||  0,00|  0,68|  0,10|  0,25|  0,00| 98,18

   4|  0,23|  0,00|  0,00|  0,00|| 96,56|  0,00|  0,00||  0,32| 99,68|  3443||  0,00|  0,00|  0,01|  0,00|  0,00| 99,62

   1|  0,26|  0,00|  0,00|  0,00|| 96,38|  0,00|  0,00||  1,02| 98,98|  3388||  0,00|  0,00|  0,11|  0,30|  0,00| 98,53

   5|  0,26|  0,00|  0,00|  0,00|| 96,38|  0,00|  0,00||  0,34| 99,66|  3515||  0,00|  0,00|  0,01|  0,00|  0,00| 99,64

   2|  0,13|  0,00|  0,00|  0,00|| 97,86|  0,00|  0,00||  0,40| 99,60|  2862||  0,00|  0,00|  0,00|  0,07|  0,00| 99,52

   6|  0,13|  0,00|  0,00|  0,00|| 97,86|  0,00|  0,00||  0,42| 99,58|  3468||  0,00|  0,00|  0,40|  0,08|  0,00| 99,05

   3|  0,21|  0,00|  0,00|  0,00|| 96,36|  0,00|  0,00||  0,23| 99,77|  3235||  0,00|  0,00|  0,00|  0,00|  0,00| 99,77

   7|  0,21|  0,00|  0,00|  0,00|| 96,36|  0,00|  0,00||  1,20| 98,80|  3523||  0,00|  0,00|  0,38|  0,22|  0,00| 98,03

```

For comparison, Debian i7z (note the temperature and frequency):

```
Cpu speed from cpuinfo 2682.00Mhz

cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc

Linux's inbuilt cpu_khz code emulated now

True Frequency (without accounting Turbo) 2690 MHz

  CPU Multiplier 27x || Bus clock frequency (BCLK) 99.63 MHz

Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]

  TURBO ENABLED on 4 Cores, Hyper Threading ON

  Max Frequency without considering Turbo 2789.63 MHz (99.63 x [28])

  Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is  37x/36x/35x/35x

  Real Current Frequency 1196.23 MHz [99.63 x 12.01] (Max of below)

        Core [core-id]  :Actual Freq (Mult.)      C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp      VCore

        Core 1 [0]:       1195.95 (12.00x)      2.98    3.09       1       0    94.6    56      0.9957

        Core 2 [1]:       1195.95 (12.00x)      1.34    54.8       0       0    44.6    54      0.9957

        Core 3 [2]:       1195.95 (12.00x)      3.12    3.49       1       0    94.1    52      1.0057

        Core 4 [3]:       1196.23 (12.01x)      2.28     3.3       1       0    94.7    51      1.0107

C0 = Processor running without halting

C1 = Processor running with halts (States >C0 are power saver modes with cores idling)

C3 = Cores running with PLL turned off and core cache turned off

C6, C7 = Everything in C3 + core state saved to last level cache, C7 is deeper than C6

  Above values in table are in percentage over the last 1 sec

[core-id] refers to core-id number in /proc/cpuinfo

'Garbage Values' message printed when garbage values are read

  Ctrl+C to exit

```

And Debian cpuinfo values:

```
# cpupower info

analyzing CPU 0:

perf-bias: 6

# cpupower idle-info

CPUidle driver: intel_idle

CPUidle governor: menu

# cpupower frequency-info

analyzing CPU 0:

  driver: intel_pstate

  CPUs which run at the same hardware frequency: 0

  CPUs which need to have their frequency coordinated by software: 0

  maximum transition latency:  Cannot determine or is not supported.

  hardware limits: 1.20 GHz - 3.70 GHz

  available cpufreq governors: performance powersave

  current policy: frequency should be within 1.20 GHz and 3.70 GHz.

                  The governor "powersave" may decide which speed to use

                  within this range.

  current CPU frequency: Unable to call hardware

  current CPU frequency: 1.20 GHz (asserted by call to kernel)

  boost state support:

    Supported: yes

    Active: yes

    3500 MHz max turbo 4 active cores

    3500 MHz max turbo 3 active cores

    3600 MHz max turbo 2 active cores

    3700 MHz max turbo 1 active cores

# cpupower monitor

    |Nehalem                    || SandyBridge        || Mperf              || Idle_Stats

CPU | C3   | C6   | PC3  | PC6  || C7   | PC2  | PC7  || C0   | Cx   | Freq || POLL | C1   | C1E  | C3   | C6   | C7

   0|  0.22|  0.00|  0.00|  0.00|| 92.56|  0.00|  0.00||  1.52| 98.48|  1203||  0.00|  0.00|  0.01|  0.06|  0.00| 98.43

   4|  0.22|  0.00|  0.00|  0.00|| 92.56|  0.00|  0.00||  2.84| 97.16|  1201||  0.00|  0.00|  1.70|  0.15|  0.00| 95.47

   1|  0.71|  0.00|  0.00|  0.00|| 90.19|  0.00|  0.00||  4.30| 95.70|  1199||  0.00|  0.70|  1.49|  0.00|  0.00| 93.72

   5|  0.71|  0.00|  0.00|  0.00|| 90.19|  0.00|  0.00||  0.77| 99.23|  1198||  0.00|  0.00|  0.00|  0.00|  0.00| 99.34

   2|  1.01|  0.00|  0.00|  0.00|| 94.62|  0.00|  0.00||  1.14| 98.86|  1197||  0.00|  0.00|  0.12|  0.15|  0.00| 98.73

   6|  1.01|  0.00|  0.00|  0.00|| 94.61|  0.00|  0.00||  1.60| 98.40|  1239||  0.00|  0.00|  0.34|  0.08|  0.00| 98.11

   3|  0.12|  0.00|  0.00|  0.00|| 85.24|  0.00|  0.00||  2.04| 97.96|  1201||  0.00|  0.00| 10.49|  0.04|  0.00| 87.57

   7|  0.12|  0.00|  0.00|  0.00|| 85.24|  0.00|  0.00||  0.90| 99.10|  1197||  0.00|  0.00|  0.00|  0.09|  0.00| 99.14

```

What is worth to mention, idle on Debian is mostly fan-less.

I've tried many combinations of the kernel config, and I've ended on slightly less temperature (around 67°C), unstable frequency jumping from 1.2GHz to 3Ghz but it is far from stable temperatures and more predictable frequencies, which I can observe on Debian.

There is no additional software like thermald or laptop-mode-tools neither on Debian or Gentoo side. I'm out of ideas, how can I get nice, silent and cool system based on Gentoo. Both systems have same desktop (actually - it's wmaker - without any bells and whistles), both have similar narrowed down set of services.

I'll appreciate any hint to make it work, since seems like I'm pretty close to the solution - the only thing left is to limit frequency fluctuation, I guess.

I found this particular thread useful:

https://forums.gentoo.org/viewtopic-t-1013630-start-0-postdays-0-postorder-asc-highlight-.html

and this doc is valuable for understanding how cpufreq works:

https://static.lwn.net/kerneldoc/admin-guide/pm/cpufreq.html

and this doc, which referring to pstate driver:

https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt

----------

## duane

I'd like to hear more about this if you find out anything. I had trouble getting my little acer e15 with an i5 processor to run cool at first, but setting p-state on seemed to cure it. My config looks basically like yours except that I don't have anything in modules and I'm still on the 4.9 kernel.

----------

## Pearlseattle

Could you please post the output of "lspci -k"?

I'm curious to see if you have a discrete GPU.

About P-state mentioned by "duane":

I experienced both sides: some CPUs worked perfectly with P-state, for others it was absolutely terrible.

Maybe you could post here as well the output of "cat /proc/cpuinfo | grep -i "model name""?

Cheers   :Very Happy: 

----------

## duane

 *Pearlseattle wrote:*   

> I experienced both sides: some CPUs worked perfectly with P-state, for others it was absolutely terrible.
> 
> Maybe you could post here as well the output of "cat /proc/cpuinfo | grep -i "model name""?

 

$ cat /proc/cpuinfo | grep -i "model name"

model name      : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

model name      : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

model name      : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

model name      : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz

I upgraded to the 4.14 kernel, by the way -- still running cool and mostly minimum frequency at rest, but the frequency does seem to jump around more.

----------

## krinn

your kernel is default set to use CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y 

you are also using intel_pstate :

#1 intel_pstate default is performance governor

#2 intel_pstate governors are only "performance" or "powersave", powersave should act like ondemand, so if you want ondemand governor using intel_pstate, you must set the governor to "powsersave"

try that:

```
cpupower frequency-set -g powersave
```

as example:

```
        Core [core-id]  :Actual Freq (Mult.)     C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp    VCore

        Core 1 [0]:     4017.07 (40.11x)      1.94    1.37       1       1    94.7    40   1.0562

        Core 2 [1]:     4039.04 (40.33x)      3.81    2.34       1    1.15    91.7    42   1.0610

        Core 3 [2]:     4027.67 (40.22x)         1    2.02       0       0    97.5    38   1.0586

        Core 4 [3]:     4026.77 (40.21x)   1.73    1.75       0       0    96.5    39   1.0614

cpupower frequency-set -g powersave

        Core [core-id]  :Actual Freq (Mult.)     C0%   Halt(C1)%  C3 %   C6 %   C7 %  Temp    VCore

        Core 1 [0]:     1670.19 (16.68x)      3.34    6.97       1       1    89.6    40   0.7628

        Core 2 [1]:     1610.09 (16.08x)      9.39    10.6       0       0    85.6    41   0.7628

        Core 3 [2]:     1924.77 (19.22x)         1    0.146      1       1    97.7    39   0.7653

        Core 4 [3]:     1732.43 (17.30x)   1.76    3.18       1       0    95.1    39   0.7616

```

and if you wonder why debian do like that, it's a binary distro they should always use more generic answer, so for them, best answer is default to ondemand which will work for non intel_pstate cpu

and when using intel_pstate, they certainly just enforce "powersave" governor.

and you endup with the "illusion" that they use "ondemand" because default set in their kernel, when they only do that for non intel_pstate user.

----------

## gryf

Ok, here is another portion of my findings.

Yesterday I was experiment with Xorg, since I've seen i915 near top of powertop, and switch X off completely just to have clear sight (although on Debian all measures I've done with X running). I discovered, that on bare system i7z readings are similar to the Debian ones, so multiplier is set firmly in 12x, frequency is around 1.2GHz and is stable (no fluctuation at all) and VCore is around 0.95V but temperature is like ~64°C (still higher than on Debian around 10°C)

I've launch Xorg again and kill all dockapps (I'm using wmaker, as wrote in original post), which I usually have, and than run them one by one. Quickly turns out that one of them was responsible for waking processor to often, and as the result, makes processor constantly switching to higher freq and voltage. For the record, this dockapp is x11-plugins/wmhdplop. I've removed it from my desktop.

Still, I thing I'm missing something, which I cannot track down - in Debian I still have 10°C less than on Gentoo, and pstate switching is more aggressive than in Debian. I'm still trying to figure out how to bring down the temperature for at least 10°C.

 *Pearlseattle wrote:*   

> Could you please post the output of "lspci -k"?
> 
> 

 

```
spasm ~ # lspci 

00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)

00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)

00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)

00:16.0 Communication controller: Intel Corporation 7 Series/C216 Chipset Family MEI Controller #1 (rev 04)

00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (Lewisville) (rev 04)

00:1a.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #2 (rev 04)

00:1b.0 Audio device: Intel Corporation 7 Series/C216 Chipset Family High Definition Audio Controller (rev 04)

00:1c.0 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 1 (rev c4)

00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)

00:1c.2 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 (rev c4)

00:1c.3 PCI bridge: Intel Corporation 7 Series/C216 Chipset Family PCI Express Root Port 4 (rev c4)

00:1c.5 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 6 (rev c4)

00:1d.0 USB controller: Intel Corporation 7 Series/C216 Chipset Family USB Enhanced Host Controller #1 (rev 04)

00:1f.0 ISA bridge: Intel Corporation QM77 Express Chipset LPC Controller (rev 04)

00:1f.2 RAID bus controller: Intel Corporation 82801 Mobile SATA Controller [RAID mode] (rev 04)

00:1f.3 SMBus: Intel Corporation 7 Series/C216 Chipset Family SMBus Controller (rev 04)

01:00.0 VGA compatible controller: NVIDIA Corporation GF108GLM [NVS 5200M] (rev a1)

03:00.0 Network controller: Broadcom Limited BCM4313 802.11bgn Wireless Network Adapter (rev 01)

0c:00.0 SD Host controller: O2 Micro, Inc. OZ600FJ0/OZ900FJ0/OZ600FJS SD/MMC Card Reader Controller (rev 05)

```

Indeed, I do have dual graphics system (Optimus), but I'm using intel graphics only, and nothing suspicious I've seen on powertop regarding GeForce. 

 *Pearlseattle wrote:*   

> I experienced both sides: some CPUs worked perfectly with P-state, for others it was absolutely terrible.
> 
> Maybe you could post here as well the output of "cat /proc/cpuinfo | grep -i "model name""?
> 
> 

 

I've already posted cpu model. It's i7-3740QM Ivy Bridge:

```
spasm ~ # lscpu

Architecture:        x86_64

CPU op-mode(s):      32-bit, 64-bit

Byte Order:          Little Endian

CPU(s):              8

On-line CPU(s) list: 0-7

Thread(s) per core:  2

Core(s) per socket:  4

Socket(s):           1

NUMA node(s):        1

Vendor ID:           GenuineIntel

CPU family:          6

Model:               58

Model name:          Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz

Stepping:            9

CPU MHz:             1215.532

CPU max MHz:         3700,0000

CPU min MHz:         1200,0000

BogoMIPS:            5382.17

Virtualization:      VT-x

L1d cache:           32K

L1i cache:           32K

L2 cache:            256K

L3 cache:            6144K

NUMA node0 CPU(s):   0-7

Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
```

 *krinn wrote:*   

> your kernel is default set to use CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
> 
> 

 

I'm already using powersave governor by default. Look at the output of cpupower command.

Also:

```
spasm ~ # cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 

powersave

powersave

powersave

powersave

powersave

powersave

powersave

powersave

```

----------

## duane

Have you tried PM_AUTOSLEEP, or PCIEASPM_POWERSAVE? Just shooting in the dark.

----------

## gryf

As a workaround, I currently disabled turbo boost, and gained ~5°C. I'm wondering if this can be a subject to take into account by governors.

 *duane wrote:*   

> Have you tried PM_AUTOSLEEP, or PCIEASPM_POWERSAVE? Just shooting in the dark.

 

I don't want PM_AUTOSLEEP, since it will suspend system. PCIEASPM_POWERSAVE I do have, and currently playing with different options (Power supersave instead of bios default) to see if that helps.

----------

## mociofiletto

Hi, I am experiencing the same issue with an Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz.

After a few minutes after gentoo is started, the fan speed goes to max (4200rpm) and the CPU temperature arises to around 90°C

I have installed thermald and but it seems to be unuseful

The default scaling governor is "performance" and the scaling driver is "intel_pstate"

The situation is as follows:

```
# cpupower frequency-set -g powersave

# cpupower monitor

    |Nehalem                    || SandyBridge        || Mperf              || Idle_Stats                              

CPU | C3   | C6   | PC3  | PC6  || C7   | PC2  | PC7  || C0   | Cx   | Freq || POLL | C1   | C1E  | C3   | C6   | C7s  

   0|  4,95|  1,94|  0,00|  0,00|| 16,09|  0,00|  0,00|| 65,74| 34,26|  2384||  0,11|  3,28|  3,18|  6,65|  2,36| 18,78

   4|  4,95|  1,94|  0,00|  0,00|| 16,09|  0,00|  0,00||  6,29| 93,71|  2362||  0,00|  5,63|  1,48|  4,35|  0,66| 81,62

   1|  3,85|  2,40|  0,00|  0,00|| 55,96|  0,00|  0,00||  9,55| 90,45|  2328||  0,39|  1,56|  2,27|  4,06|  2,34| 80,26

   5|  3,85|  2,40|  0,00|  0,00|| 55,96|  0,00|  0,00|| 20,60| 79,40|  2358||  0,00|  6,24|  2,97|  4,42|  1,36| 64,42

   2|  5,93|  2,51|  0,00|  0,00|| 56,11|  0,00|  0,00|| 13,89| 86,11|  2325||  0,00|  2,84|  4,13|  7,06|  3,25| 68,89

   6|  5,93|  2,51|  0,00|  0,00|| 56,11|  0,00|  0,00||  8,24| 91,76|  2373||  0,01|  2,93|  6,89|  5,11|  2,15| 74,71

   3|  9,38|  4,02|  0,00|  0,00|| 45,84|  0,00|  0,00||  6,04| 93,96|  2348||  0,02|  0,95|  6,65|  5,37|  4,59| 76,42

   7|  9,38|  4,02|  0,00|  0,00|| 45,84|  0,00|  0,00|| 28,82| 71,18|  2368||  0,00|  0,94|  5,70|  8,38|  1,43| 54,75
```

```
# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 

powersave

powersave

powersave

powersave

powersave

powersave

powersave

powersave
```

```
# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver

intel_pstate

intel_pstate

intel_pstate

intel_pstate

intel_pstate

intel_pstate

intel_pstate

intel_pstate
```

These are important settings in kernel's .config:

```
# grep -P "^[^#].*(FREQ|IDLE|PSTATE)" /usr/src/linux/.config

CONFIG_NO_HZ_IDLE=y

CONFIG_GENERIC_SMP_IDLE_THREAD=y

CONFIG_ACPI_CPU_FREQ_PSS=y

CONFIG_ACPI_PROCESSOR_IDLE=y

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_GOV_ATTR_SET=y

CONFIG_CPU_FREQ_GOV_COMMON=y

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

CONFIG_X86_INTEL_PSTATE=y

CONFIG_X86_PCC_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ_CPB=y

CONFIG_X86_AMD_FREQ_SENSITIVITY=m

CONFIG_CPU_IDLE=y

CONFIG_CPU_IDLE_GOV_LADDER=y

CONFIG_CPU_IDLE_GOV_MENU=y

CONFIG_INTEL_IDLE=y

CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
```

I am running kernel from gentoo-sources 4.14.52-gentoo and I'm thinking there is something wrong with pstate driver.

It seems the problem is present in 4.14 series. I will try to test older kernels and I will post here my results.

----------

## mociofiletto

Now I tested 4.9.95 using "ondemand" as default governor.

The system uses powersave as governor and intel_pstate as scaling driver, but the temperature is always too high as with 4.14 kernel:

```
# sensors

asus-isa-0000

Adapter: ISA adapter

cpu_fan:     4200 RPM

temp1:        +92.0°C  

acpitz-virtual-0

Adapter: Virtual device

temp1:        +92.0°C  (crit = +103.0°C)

coretemp-isa-0000

Adapter: ISA adapter

Physical id 0:  +94.0°C  (high = +84.0°C, crit = +100.0°C)

Core 0:         +82.0°C  (high = +84.0°C, crit = +100.0°C)

Core 1:         +85.0°C  (high = +84.0°C, crit = +100.0°C)

Core 2:         +93.0°C  (high = +84.0°C, crit = +100.0°C)

Core 3:         +93.0°C  (high = +84.0°C, crit = +100.0°C)

```

```
# uname -a

Linux [mybook_name] 4.9.95-gentoo #8 SMP PREEMPT Mon Jun 18 20:07:42 CEST 2018 x86_64 Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz GenuineIntel GNU/Linux

# cpupower frequency-info

analisi della CPU 0:

  driver: intel_pstate

  CPU che operano alla stessa frequenza hardware: 0

  CPU che è necessario siano coordinate dal software: 0

  latenza massima durante la transizione:  Cannot determine or is not supported.

  limiti hardware: 800 MHz - 3.40 GHz

  gestori disponibili: performance powersave

  gestore attuale: la frequenza deve mantenersi tra 800 MHz e 3.40 GHz.

                   Il gestore "powersave" può decidere quale velocità usare

                  in questo intervallo.

  current CPU frequency: 3.29 GHz (asserted by call to hardware)

  boost state support:

    Supported: yes

    Active: yes

# cpupower monitor

    |Nehalem                    || SandyBridge        || Mperf              || Idle_Stats                              

CPU | C3   | C6   | PC3  | PC6  || C7   | PC2  | PC7  || C0   | Cx   | Freq || POLL | C1-H | C1E- | C3-H | C6-H | C7s- 

   0|  9,50|  1,66|  0,00|  0,00|| 61,83|  0,00|  0,00||  7,72| 92,28|  3223||  0,02|  9,48|  3,22| 10,15|  2,44| 66,84

   4|  9,50|  1,66|  0,00|  0,00|| 61,83|  0,00|  0,00||  3,62| 96,38|  3202||  0,00|  1,55|  1,86|  6,39|  2,29| 84,18

   1|  3,08|  1,09|  0,00|  0,00|| 50,30|  0,00|  0,00||  4,00| 96,00|  3207||  0,20|  2,76|  6,24|  4,27|  1,50| 81,10

   5|  3,08|  1,09|  0,00|  0,00|| 50,30|  0,00|  0,00|| 15,79| 84,21|  3231||  0,00|  4,27| 16,18|  0,58|  0,83| 61,97

   2|  1,11|  0,92|  0,00|  0,00|| 47,71|  0,00|  0,00|| 13,60| 86,40|  3239||  0,00|  3,77|  0,67|  0,72|  0,25| 80,71

   6|  1,11|  0,92|  0,00|  0,00|| 47,71|  0,00|  0,00||  4,70| 95,30|  3213||  0,01| 18,86| 10,64|  4,25|  2,00| 59,44

   3|  2,18|  1,54|  0,00|  0,00||  6,71|  0,00|  0,00|| 80,45| 19,55|  3291||  0,00|  1,51|  2,16|  1,63|  1,71| 11,33

   7|  2,18|  1,54|  0,00|  0,00||  6,71|  0,00|  0,00||  3,07| 96,93|  3222||  0,01|  4,96|  1,78|  2,31|  0,96| 86,81

# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor 

powersave

powersave

powersave

powersave

powersave

powersave

powersave

powersave

#

# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver

intel_pstate

intel_pstate

intel_pstate

intel_pstate

intel_pstate

intel_pstate

intel_pstate

intel_pstate

#

# zcat /proc/config.gz | grep -P "^[^#].*(FREQ|IDLE|PSTATE)"

CONFIG_NO_HZ_IDLE=y

CONFIG_GENERIC_SMP_IDLE_THREAD=y

CONFIG_ACPI_CPU_FREQ_PSS=y

CONFIG_ACPI_PROCESSOR_IDLE=y

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_GOV_ATTR_SET=y

CONFIG_CPU_FREQ_GOV_COMMON=y

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_STAT_DETAILS=y

CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y

CONFIG_X86_INTEL_PSTATE=y

CONFIG_X86_PCC_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ=m

CONFIG_X86_ACPI_CPUFREQ_CPB=y

CONFIG_CPU_IDLE=y

CONFIG_CPU_IDLE_GOV_LADDER=y

CONFIG_CPU_IDLE_GOV_MENU=y

CONFIG_INTEL_IDLE=y

CONFIG_I7300_IDLE_IOAT_CHANNEL=y

CONFIG_I7300_IDLE=m

CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m

```

----------

## mociofiletto

I think the problem is intel_pstate always keeps CPU at its max frequency.

The temporary solution is to limit it to something that doesn't create overheating.

This is what I have done:

```
# echo 50 > /sys/devices/system/cpu/intel_pstate/max_perf_pct 
```

----------

## sao98021

i have a asus k53sv, intel i72670qm nvidia g540m bumblebee setup, i recently jumped up to 4.17 because i read about all the power savings changes like "some devices will get up to 10% more performance"

i like it, idles between 34-39c and all cpu cores drop to around 760-800, i do use p_state

if your interested https://pastebin.com/mFKteXR9 is the kernel config i'm using, it could get cleaned up alot as it's just a modified genkernel config

also, i see that some models of that laptop come with the optimus discrete gpu "we also advise that you pay an extra $99 for the Nvidia NVS 5200M discrete graphics chip."

i'm assuming your positive that your model does not, but may want to check if not.

----------

## n05ph3r42

I can also recommend to force powersave manager( disable all the rest in your kernel) + install thermald. Recently i added new info about it to power management r page: Also, for Intel processors used in laptops since 2011 you may want to enable

BTW as for nouveau - it forces higher voltage for GPU since about a year or two =>  it leads to + ~10c to CPU temp (one cooling chassis on my laptop, i DIY modified it, but it does a lil' - i already upgraded CPU which is 10TDP higher than designed)  so i disabled NV GPU at all.

----------

## mrgomm

I found this thread trying to solve a problem very similar for my laptop, (I own one with the same CPU BTW), the fan was driving me nuts since I installed Gentoo, I thought I followed all the guides and always it was the same, the sensor "Other" (I'm still not sure where it is in the motherboard, but I think it's close to the RAM and the wifi card) was around 10ºC hotter in Gentoo than Ubuntu, just enough to get the fan noisy all the time.  I just registered to say that in my case, after much digging, the solution came by using powertop and enabling all the optimizations at boot (just disabling after that a port, corresponding to my USB mouse).

I achieved that by creating a file callled /etc/local.d/powertop.start and there inside:

```

#!/bin/sh

powertop --auto-tune

# Disable auto shutoff on some devices f.e. USB mouse

echo 'on' > '/sys/bus/usb/devices/<ID>/power/control';

exit 0

```

After doing this, no more overheating/fan noise problems.

----------

