2

I am running Ubuntu Mate 15.10 64bit (kernel 4.2.0) on a Lenovo y5070 with an i7-4710HQ cpu. I noticed recently (possibly after a recent dist-upgrade) that certain programs were really slow. After a bit of investigation it appears that intel_pstate switches to the "powersave" governor by default which correctly scales down my cpufreq to about 600 MHz when I'm not doing anything intensive. However, it no longer scales up the cpufreq when I do something intensive.

To fix this I set GOVERNOR="performance" in:

/etc/init.d/cpufrequtils. 

After booting, cpufreq correctly stays at around 2.5 GHz and the governor is correctly set to "performance". However, after a minute the governor is automatically changed back to "powersave" and the cpufreq drops again. If I then manually set the governor with cpufreq-set it returns to 2.5 GHz.

The second issue I noticed was that every time I suspend and wake my laptop, the max cpufreq drops by an incremental amount (these increments are the same each time):

before suspending:

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

after first wake:

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

after second wake:

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

etc.

Note: the governor is still set to "performance".

Attempting to set the cpufreq max with cpufreq-set:

for ((i=0;i<$(nproc);i++)); do sudo cpufreq-set -c $i -u 3.50GHz; done

has no effect.

Lastly, I also attempted to disable intel_pstate in grub and set the acpi config to "performance"; this suffers from the same suspend/wake problem.

Any insight would be appreciated!

Edit 1: I have tried this which suggests that the problem may be that clock modulation automatically enables on wake, which conflicts with intel_pstate. Indeed it seems that clock modulation is enabled, but disabling it with:

sudo wrmsr -a 0x19a 0x0

does not noticeably change the frequencies, and I am still unable to change the max cpufreq value.

Edit 2: @DougSmythies on my pc those files are elsewhere, these are the respective printouts (I've excluded frequencies for the other 7 cores, they're identical). Note also that I am currently using the acpi driver:

cat /sys/devices/system/cpu/cpu*/cpufreq/cpu_min_freq
800000 

cat /sys/devices/system/cpu/cpu*/cpufreq/cpu_max_freq
2501000

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq                                                 
2501000 

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq                                                 
800000

I can't find the intel_pstate file anywhere in /sys/devices.

Edit 3: @DougSmythies I have rebooted with the intel_pstate driver and suspended and woken the machine up. The cores are running at about 2000 now on performance mode. The max freq is 2.1 GHz according to cpufreq-info; it was 3.5 GHz before suspending. Here is the output of the files your requested (just for cpu0, they're all the same):

$cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq 
3500000
$cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq                                                 
800000
$cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 
2100000
$cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 
800000

$grep . /sys/devices/system/cpu/intel_pstate/*                                                                                                                                                                                                      
/sys/devices/system/cpu/intel_pstate/max_perf_pct:60
/sys/devices/system/cpu/intel_pstate/min_perf_pct:22
/sys/devices/system/cpu/intel_pstate/no_turbo:0
/sys/devices/system/cpu/intel_pstate/num_pstates:28
/sys/devices/system/cpu/intel_pstate/turbo_pct:36
jeicher
  • 21
  • 3
  • Could you edit your question adding a bunch of information. Outputs from:`cat /sys/devices/system/cpu/cpufreq/policy*/cpuinfo_max_freq` ; `cat /sys/devices/system/cpu/cpufreq/policy*/cpuinfo_min_freq` ; `cat /sys/devices/system/cpu/cpufreq/policy*/scaling_max_freq` ; `cat /sys/devices/system/cpu/cpufreq/policy*/scaling_min_freq` `grep . /sys/devices/system/cpu/intel_pstate/*` – Doug Smythies Feb 28 '16 at 16:37
  • From a bug for core i7-5775c some people posted a linux cmdline that forces the cpu to always stay at maximum speed: processor.max_cstate=0 intel_idle.max_cstate=0 idle=poll – iugamarian Feb 28 '16 at 16:42
  • Upon re-boot that the governor changes from `performance` to `powersave` after 1 minute is normal and done via `/etc/init.d/ondemand` – Doug Smythies Feb 28 '16 at 19:49
  • @iugamarian thanks, I'll explore that option. Does tha command rely on a particular driver (e.g. intel_pstate vs acpi)? – jeicher Feb 29 '16 at 11:36
  • @DougSmythies I've added Edit 2 above with some system info. I realise that the 1 minute thing is correct behaviour, so I changed the governor to 'performance' in /etc/init.d/ondemand also. This works. My main issue is not really at boot, but rather the incremental reduction in frequency after waking from suspend. – jeicher Feb 29 '16 at 12:00
  • Sorry, I meant while running with the intel_pstate frequency scaling driver, and while you have the problem. – Doug Smythies Feb 29 '16 at 15:04
  • 1
    Possible duplicate of [Enable full performance on Sandy Bridge laptop](http://askubuntu.com/questions/591594/enable-full-performance-on-sandy-bridge-laptop) – Fabby Mar 06 '16 at 15:26
  • @DougSmythies check Edit 3 – jeicher Mar 09 '16 at 16:50
  • @Fabby I don't think this is a duplicate of [Enable full performance on Sandy Bridge laptop](http://askubuntu.com/questions/591594/enable-full-performance-on-sandy-bridge-laptop). That question is about enabling the performance governor in general. My issue is primarily that after suspending my pc the maximum frequency is lowered incrementally; setting the governor to performance has no effect. I have clarified the question somewhat to make the distinction clear. – jeicher Mar 09 '16 at 16:53
  • 1
    Try going back a kernel version or two. see [this](http://ubuntuforums.org/showthread.php?t=2316101). – Doug Smythies Mar 09 '16 at 17:04
  • Close vote as duplicate retracted. – Fabby Mar 09 '16 at 22:34
  • Please see, and possibly contribute to, [here](https://bugzilla.kernel.org/show_bug.cgi?id=114551) – Doug Smythies Mar 15 '16 at 18:27
  • @DougSmythies Done. – jeicher Mar 16 '16 at 14:55
  • By way of an update, I have performed a fresh install of 16.04 (kernel 4.4.0-21-generic) and the bug has disappeared. – jeicher Apr 21 '16 at 21:24

1 Answers1

0

You're possbily affected by this bug:

https://bugzilla.kernel.org/show_bug.cgi?id=114551

The patch only landed in the mainline kernel v 4.6. In due course, maybe it'll be backported to 16.04LTS, or in Feb 2017, it should arrive in the next LTS Enablement Stack:

https://wiki.ubuntu.com/Kernel/LTSEnablementStack#Kernel.2FSupport.A16.04.x_Ubuntu_Kernel_Support

JPvRiel
  • 356
  • 2
  • 8