6

I have a Dell XPS 13 (developer edition) which I bought some years ago with Ubuntu 12.04 preinstalled.

I've upgraded to Ubuntu 16.04 and since then I noticed my computer became way slower than before on certain heavy tasks.

I also noticed that my computer became much less noisy on heavy tasks, and it looks like my i7's Turbo boost does not kick in.

Sending work to 4 procs, turbostat shows:

 CPU Avg_MHz   %Busy Bzy_MHz TSC_MHz
   -     602  100.00     603    2595
   0     611  100.00     611    2597
   1     594  100.00     595    2594
   2     610  100.00     612    2594
   3     594  100.00     595    2594

I'm not an expert but it looks like turbo does not work, right?

How am I supposed to make it work? All the stuff I found online only say to use turbostat, but that does not really help to solve the problem.

Any idea?

I use burnK7 to generate CPU load. Note that at the beginning the Bzy_MHz column goes close to 3 Ghz, but then stabilizes near 1 Ghz. Is this normal?

My processor: Intel® Core™ i7-3687U CPU @ 2.10GHz × 4

OS: Ubuntu 16.04.1 LTS 64 bits

Under heavy-load i7z displays:

i7z

It says turbo mode is enabled, but the frequency is very low, and I'm sure for the exact same task (here compiling Scala code) the computer was much more noisy/fast before upgrading Ubuntu. Why does it happen?

I turned off thermald with:

sudo service thermald stop

I also get the following output from cpupower:

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: 0.97 ms.
  hardware limits: 800 MHz - 3.30 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 1.98 GHz and 1.98 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 1.10 GHz.
  boost state support:
    Supported: yes
    Active: yes
    25500 MHz max turbo 4 active cores
    25500 MHz max turbo 3 active cores
    25500 MHz max turbo 2 active cores
    25500 MHz max turbo 1 active cores

I noticed that frequency should be within 1.98 GHz and 1.98 GHz. is actually a moving target range, and may be affected by thermald start/stops.

I now get a weird result:

  current policy: frequency should be within 3.30 GHz and 3.30 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz.

Note that the values in files like /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq seem to be constantly changing.


Some extra turbostat outputs.

The first is at the beginning of a load phase. At the beginning the frequency is high.

$ sudo turbostat --debug sleep 10
turbostat version 4.8 26-Sep, 2015 - Len Brown <lenb@kernel.org>
CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3a:9 (6:58:9)
CPUID(6): APERF, DTS, PTM, EPB
RAPL: 3855 sec. Joule Counter Range, at 17 Watts
cpu2: MSR_PLATFORM_INFO: 0x80815f0011a00
8 * 100 = 800 MHz max efficiency frequency
26 * 100 = 2600 MHz base frequency
cpu2: MSR_IA32_POWER_CTL: 0x0014005d (C1E auto-promotion: DISabled)
cpu2: MSR_TURBO_RATIO_LIMIT: 0x1f1f1f21
31 * 100 = 3100 MHz max turbo 4 active cores
31 * 100 = 3100 MHz max turbo 3 active cores
31 * 100 = 3100 MHz max turbo 2 active cores
33 * 100 = 3300 MHz max turbo 1 active cores
cpu2: MSR_CONFIG_TDP_NOMINAL: 0x00000015 (base_ratio=5)
cpu2: MSR_CONFIG_TDP_LEVEL_1: 0x00080070 (PKG_MIN_PWR_LVL1=0 PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=112)
cpu2: MSR_CONFIG_TDP_LEVEL_2: 0x001a00c8 (PKG_MIN_PWR_LVL2=0 PKG_MAX_PWR_LVL2=0 LVL2_RATIO=10 PKG_TDP_LVL2=200)
cpu2: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0)
cpu2: MSR_TURBO_ACTIVATION_RATIO: 0x00000014 (MAX_NON_TURBO_RATIO=20 lock=0)
cpu2: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x1e008405 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked: pkg-cstate-limit=5: pc7s)
cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
cpu0: MSR_RAPL_POWER_UNIT: 0x000a1003 (0.125000 Watts, 0.000015 Joules, 0.000977 sec.)
cpu0: MSR_PKG_POWER_INFO: 0x00000088 (17 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
cpu0: MSR_PKG_POWER_LIMIT: 0x800080fa00dc80c8 (locked)
cpu0: PKG Limit #1: ENabled (25.000000 Watts, 28.000000 sec, clamp DISabled)
cpu0: PKG Limit #2: ENabled (31.250000 Watts, 0.000977* sec, clamp DISabled)
cpu0: MSR_PP0_POLICY: 0
cpu0: MSR_PP0_POWER_LIMIT: 0x80000000 (locked)
cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_PP1_POLICY: 0
cpu0: MSR_PP1_POWER_LIMIT: 0x80000000 (locked)
cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00691200 (105 C)
cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x880a0908 (95 C)
cpu0: MSR_IA32_THERM_STATUS: 0x880c0008 (93 C +/- 1)
cpu2: MSR_IA32_THERM_STATUS: 0x880a0008 (95 C +/- 1)
    Core     CPU Avg_MHz   %Busy Bzy_MHz TSC_MHz     SMI  CPU%c1  CPU%c3  CPU%c6  CPU%c7 CoreTmp  PkgTmp Pkg%pc2 Pkg%pc3 Pkg%pc6 Pkg%pc7 PkgWatt CorWatt GFXWatt
       -       -    1900   79.17    2406    2594       0   15.12    0.11    0.00    5.60      93      93    0.00    0.00    0.00    0.00   10.51    6.86    0.37
       0       0    1893   78.90    2405    2594       1   16.29    0.16    0.00    4.65      89      93    0.00    0.00    0.00    0.00   10.51    6.86    0.37
       0       1    2016   84.01    2406    2594       1   11.18
       1       2    1982   82.61    2405    2594       1   10.78    0.06    0.00    6.55      93
       1       3    1710   71.16    2408    2594       1   22.23
10.001067 sec

The second is after a while under load - the frequency decreases:

$ sudo turbostat --debug sleep 10
turbostat version 4.8 26-Sep, 2015 - Len Brown <lenb@kernel.org>
CPUID(0): GenuineIntel 13 CPUID levels; family:model:stepping 0x6:3a:9 (6:58:9)
CPUID(6): APERF, DTS, PTM, EPB
RAPL: 3855 sec. Joule Counter Range, at 17 Watts
cpu2: MSR_PLATFORM_INFO: 0x80815f0011a00
8 * 100 = 800 MHz max efficiency frequency
26 * 100 = 2600 MHz base frequency
cpu2: MSR_IA32_POWER_CTL: 0x0014005d (C1E auto-promotion: DISabled)
cpu2: MSR_TURBO_RATIO_LIMIT: 0x1f1f1f21
31 * 100 = 3100 MHz max turbo 4 active cores
31 * 100 = 3100 MHz max turbo 3 active cores
31 * 100 = 3100 MHz max turbo 2 active cores
33 * 100 = 3300 MHz max turbo 1 active cores
cpu2: MSR_CONFIG_TDP_NOMINAL: 0x00000015 (base_ratio=5)
cpu2: MSR_CONFIG_TDP_LEVEL_1: 0x00080070 (PKG_MIN_PWR_LVL1=0 PKG_MAX_PWR_LVL1=0 LVL1_RATIO=8 PKG_TDP_LVL1=112)
cpu2: MSR_CONFIG_TDP_LEVEL_2: 0x001a00c8 (PKG_MIN_PWR_LVL2=0 PKG_MAX_PWR_LVL2=0 LVL2_RATIO=10 PKG_TDP_LVL2=200)
cpu2: MSR_CONFIG_TDP_CONTROL: 0x00000000 ( lock=0)
cpu2: MSR_TURBO_ACTIVATION_RATIO: 0x00000014 (MAX_NON_TURBO_RATIO=20 lock=0)
cpu2: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x1e008405 (UNdemote-C3, UNdemote-C1, demote-C3, demote-C1, locked: pkg-cstate-limit=5: pc7s)
cpu0: MSR_IA32_ENERGY_PERF_BIAS: 0x00000006 (balanced)
cpu0: MSR_RAPL_POWER_UNIT: 0x000a1003 (0.125000 Watts, 0.000015 Joules, 0.000977 sec.)
cpu0: MSR_PKG_POWER_INFO: 0x00000088 (17 W TDP, RAPL 0 - 0 W, 0.000000 sec.)
cpu0: MSR_PKG_POWER_LIMIT: 0x800080fa00dc80c8 (locked)
cpu0: PKG Limit #1: ENabled (25.000000 Watts, 28.000000 sec, clamp DISabled)
cpu0: PKG Limit #2: ENabled (31.250000 Watts, 0.000977* sec, clamp DISabled)
cpu0: MSR_PP0_POLICY: 0
cpu0: MSR_PP0_POWER_LIMIT: 0x80000000 (locked)
cpu0: Cores Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_PP1_POLICY: 0
cpu0: MSR_PP1_POWER_LIMIT: 0x80000000 (locked)
cpu0: GFX Limit: DISabled (0.000000 Watts, 0.000977 sec, clamp DISabled)
cpu0: MSR_IA32_TEMPERATURE_TARGET: 0x00691200 (105 C)
cpu0: MSR_IA32_PACKAGE_THERM_STATUS: 0x881b0908 (78 C)
cpu0: MSR_IA32_THERM_STATUS: 0x881e0008 (75 C +/- 1)
cpu2: MSR_IA32_THERM_STATUS: 0x881b0008 (78 C +/- 1)
    Core     CPU Avg_MHz   %Busy Bzy_MHz TSC_MHz     SMI  CPU%c1  CPU%c3  CPU%c6  CPU%c7 CoreTmp  PkgTmp Pkg%pc2 Pkg%pc3 Pkg%pc6 Pkg%pc7 PkgWatt CorWatt GFXWatt
       -       -      30    2.79    1091    2594       0    6.92    0.30    0.00   89.99      70      71    1.60    0.03    1.48   47.85    3.65    0.71    0.29
       0       0      22    1.97    1133    2594       0    6.34    0.12    0.00   91.58      70      71    1.60    0.03    1.48   47.85    3.65    0.71    0.29
       0       1      38    3.09    1224    2594       0    5.22
       1       2      25    2.45    1016    2594       0    8.67    0.47    0.00   88.40      70
       1       3      37    3.67    1006    2594       0    7.45
10.001501 sec

At the beginning of the load phase, it seems my CPUs can become very hot, close to 105°, which is the junction temp of CPUs, and then a system prevents them to cook themselves and decrease significantly the frequency to a minimum.

I'd like to have a less hot processor on heavy load, and, when it's becoming hot, decrease the processor less significantly. Is that possible?


Related issues I opened to solve my problem (may contain additional information not mentioned here that could be useful):

  • There is confusing and somewhat contradictory information in your various questions. Your second turbostat output above shows very very low load. You need to stop getting to such a high temperature with your computer, or it will eventually break down. You need some thermal management such as thermald or tlp, however you will need to tweak the nominal parameters for it to work properly without oscillating. – Doug Smythies Jul 21 '16 at 15:32
  • @DougSmythies I can ensure you that the 2nd turbostat is during a heavy task. After many tests I got a setup that seems a nice workaroud. I run sudo ./smm 30a3 to disable bios fan control. I used i8kctl fan -1 2 to force the fans to run full-speed all the time. Then it seems I get better results by disabling pstate-driver (when freq slow down, it slows down less, around 2ghz instead of 800mhz with pstate driver). It's a bit noisy to have full-speed fans but at least I can work. – Sebastien Lorber Jul 21 '16 at 15:42
  • @DougSmythies honnestly at this point I'm desesperate. I have to go back to work. Time is money and I've lost more time waiting for my computer or trying to fix the problem than my computer cost :'( If you have a solution so that when my cpu gets hot the fans run full-speed and the cpu doesn't slow more that necessary I would be happy. – Sebastien Lorber Jul 21 '16 at 15:46
  • Even with i8kmon I can't get result I want: when cpu gets hot, fans go fast, then fans go slow, then cpu is very hot, then cpu slows down to 800mhz, then it cools,and then it says at 800mhz while the cpu is not hot, and the fans still slow. All that, under heavy load (burnKx or Scala project compilation). I was only able to get a "lower slowdown" when the fans run full-speed all the time. – Sebastien Lorber Jul 21 '16 at 15:49
  • 1
    At this point, I'm not sure what else to suggest. If you do not want to clean your computer vents or use thermald or an equivalent, then if it were me, I would: Set a very low maximum CPU frequency; Fully load all 4 CPU's; Gradually increase the maximum CPU frequency until the package temperature hit some limit, say 85 degrees C; And thereafter use that as my manually determined safe Maximum CPU frequency. – Doug Smythies Jul 21 '16 at 21:43
  • thanks for your help @DougSmythies I'll try to clean my vents soon if I find the tooling to open my laptop. I'm monitoring my temp for current workaround and it seems to go fine for now, but my laptop has always been quite hot. I'll try to find a solution sooner or later but can't invest more time in it right now – Sebastien Lorber Jul 21 '16 at 22:34
  • @DougSmythies this is likely a strange hardware problem http://askubuntu.com/q/801226/453923 – Sebastien Lorber Jul 25 '16 at 16:38

2 Answers2

2

I wonder if the CPU is being throttled by the powerclamp. If you run top, you may see kidle_inject threads running, if so, the CPU is being power clamped as a thermal constraint, hence you will see apparent 100% utilization combined with a low CPU frequency.

  • Hmm I don't have any kidle_inject (also sudo rmmod intel_powerclamp says that module is not currently loaded). Any idea? Also, can you tell me how to interpret the results of Turbostat please? It seems on some occasion the Bzy_MHz can be close to 2.7Ghz (turbo boost of my cpu) but it soon goes back to a lower level – Sebastien Lorber Jul 20 '16 at 13:44
  • turboboost is opportunistic, the CPU will scale to the turboboost upper pstate(s) if the thermal properties allow. Depending on the CPU, this may be 1 or more CPUs. If the package gets too hot, the boosted pstate will be dropped. Like all pstates, Turboboost is a voltage/cpu freq combo, so you may see the top frequency drop in/out depending on the exact load at that instance and/or thermal limits. – Colin Ian King Jul 20 '16 at 14:43
  • sensors report my cores are close to 85° under heavy load and limit seems to be around 105°. Does it justify not using turbo? Also still not sure how to know for sure turbo mode is enabled. Maybe mine is enabled but actually is often not used – Sebastien Lorber Jul 20 '16 at 15:11
  • with the modern intel-pstate cpu governor the choice to go into turbo is made by the processor itself. Turbo is opportunistic, it is used when the CPU can manage to use it. It does seem bizarre that the top speed you see is so low compared to the 2.1 GHz base freq and the 3.3 GHz top turboboost freq. I wonder if the CPU is being throttled by thermald – Colin Ian King Jul 20 '16 at 15:17
  • added some extra data to the question. Disabling thermald doesn't seem to help. I don't really understand how all these stuff fit together but there's something that does not work well :( – Sebastien Lorber Jul 20 '16 at 15:33
  • OK, so my current guess is that the CPU is scaling the P states (cpu freq and voltage) according to the demand, perhaps it is that the burnK7 can't max out the CPUs since it's hand optimized for AMD Athlon/Duron CPUs. How about using stress-ng --cpu 0 and seeing what happens instead? – Colin Ian King Jul 20 '16 at 16:04
  • it does not seem to help :( I'm going crazyyyy – Sebastien Lorber Jul 20 '16 at 17:05
  • I think, due to extreme temperature, Clock Modulation has been enabled. The intel_pstate driver is fundamentally incompatible with Clock Modulation resulting in your CPUs "sticking" at a frequency below the minimum for your processor. From your data it looks to me as though your modulation level is 75%. I would suggest you switch to the acpi_cpufreq CPU frequency scaling driver (at least as a test). See here for how. – Doug Smythies Jul 20 '16 at 18:21
  • That sounds like the reason. Nice one Doug. – Colin Ian King Jul 21 '16 at 19:31
  • @SebastienLorber I've seen turbo get limited at ~80 degrees C on some Toshiba laptops if you select "Performance" as the Turbo setting in the BIOS. With "Maximum Performance" selected in the BIOS settings it would get to 100C! This, as others have suggested, is the most likely reason for it limiting the frequency, as Turbo can be limited by power consumption or temperature, and is dealt with outside of the OS control in a lot of cases (hence the mention of BIOS settings, rather than just turbo on/off). – David Gardner Jul 22 '16 at 18:25
  • Actually I'm not even sure it's a turbo problem, because my cpu frequency often gets capped to like 800mhz, under load, while my cpus are not hot (governor max is not 800mhz but strangely I couldn't set it above 2.1ghz). Also tried to look at my bios but it looks like there's no setting I'm allowed to change regarding turbo. – Sebastien Lorber Jul 23 '16 at 09:50
  • @SebastienLorber I'd recommend trying different kernel versions if possible, as I've seen problems on servers where CPU speeds were stuck at very low levels and wouldn't increase under load. An alternative kernel version worked OK, but the problem wasn't possible to consistently replicate so it may have been something else... – David Gardner Jul 25 '16 at 07:46
  • yes @DavidGardner I'll try that. I think I'm going to reinstall a fresh Ubuntu version and see what happens, because otherwise it seems very complicated to find the reason for my problems... – Sebastien Lorber Jul 25 '16 at 08:32
  • @DavidGardner this looks like a hardware problem see http://askubuntu.com/q/801226/453923 – Sebastien Lorber Jul 25 '16 at 16:39
  • I wonder if it's a microcode issue. Can you check if you have the latest installed: sudo apt-get install intel-microcode – Colin Ian King Jul 26 '16 at 06:14
-2

I had the same issue with my i5.Check your driver utility. 16.04 needs additional drivers for intel processors. i think installing intel-microcode will do the trick just fine (after a reboot ofc). Let me know how it turns out.

fixxxera
  • 355
  • microcode is not a driver and it is not related to the question. – Pilot6 Jul 20 '16 at 11:45
  • microcode may not be a driver but it pops up in DRIVER manager (if it works). It did work for me so its kinda related. – fixxxera Jul 20 '16 at 11:47
  • What did work for you? You can easily find what microcode is and that it does not "work" a way you may think. – Pilot6 Jul 20 '16 at 11:55