每次从睡眠中恢复后,CPU时钟变慢


7

我在Lenovo Y50-70上运行kubuntu 15.10,我的CPU时钟有一个非常烦人的问题:每当计算机从睡眠状态恢复时,CPU时钟的最大值就会降低,这不仅会发生一次,而且会在每次恢复的时钟都比较慢,直到从最初的3.6 GHz降低到〜600 MHz。

alain@alain-Y50-70:~$ sudo -i
[sudo] password for alain: 
root@alain-Y50-70:~# 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.60 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 800 MHz and 3.60 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 817 MHz (asserted by call to hardware).
  boost state support:
    Supported: yes
    Active: yes
root@alain-Y50-70:~# cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
100
root@alain-Y50-70:~# 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.60 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 800 MHz and 2.88 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 800 MHz (asserted by call to hardware).
  boost state support:
    Supported: yes
    Active: yes
root@alain-Y50-70:~# cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
80
root@alain-Y50-70:~# cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
60
root@alain-Y50-70:~# cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
40
root@alain-Y50-70:~# cat /sys/devices/system/cpu/intel_pstate/max_perf_pct                                 
40                                                                                                         
root@alain-Y50-70:~# 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.60 GHz                                                                      
  available cpufreq governors: performance, powersave                                                      
  current policy: frequency should be within 800 MHz and 1.44 GHz.                                         
                  The governor "powersave" may decide which speed to use                                   
                  within this range.                                                                       
  current CPU frequency is 699 MHz (asserted by call to hardware).                                         
  boost state support:                                                                                     
    Supported: yes                                                                                         
    Active: yes                                                                                            
root@alain-Y50-70:~# cat /sys/devices/system/cpu/intel_pstate/max_perf_pct                                 
40                                                                                                         
root@alain-Y50-70:~# 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.60 GHz                                                                      
  available cpufreq governors: performance, powersave                                                      
  current policy: frequency should be within 800 MHz and 1.44 GHz.                                         
                  The governor "powersave" may decide which speed to use                                   
                  within this range.                                                                       
  current CPU frequency is 605 MHz (asserted by call to hardware).                                         
  boost state support:                                                                                     
    Supported: yes                                                                                         
    Active: yes                                                                                            
root@alain-Y50-70:~#                                                                                       

我在上面的命令之间使计算机处于睡眠状态。如您所见,首先max_perf_pct逐步降低,直到达到40,然后保持40,但时钟速度继续降低。笔记本计算机是否已插入以及温度是否正常都没关系。

我认为它可能与此错误有关:https : //bugzilla.kernel.org/show_bug.cgi?id=90421


最大的问题是我找不到手动将最大时钟设置回3.6 GHz的方法。首先我尝试了cpupower frequency-set -u 3.60GHz

root@alain-Y50-70:~# cpupower frequency-set -u 3.60GHz
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
root@alain-Y50-70:~# 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.60 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 800 MHz and 1.44 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 699 MHz (asserted by call to hardware).
  boost state support:
    Supported: yes
    Active: yes
root@alain-Y50-70:~# cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
40

但这似乎是错误的方法,因为使用了Intel P-State驱动程序,因此我尝试echo 100 >/sys/devices/system/cpu/intel_pstate/max_perf_pct了无效:

root@alain-Y50-70:~# echo 100 >/sys/devices/system/cpu/intel_pstate/max_perf_pct
root@alain-Y50-70:~# 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.60 GHz
  available cpufreq governors: performance, powersave
  current policy: frequency should be within 800 MHz and 1.44 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency is 700 MHz (asserted by call to hardware).
  boost state support:
    Supported: yes
    Active: yes
root@alain-Y50-70:~# cat /sys/devices/system/cpu/intel_pstate/max_perf_pct
40

我也曾尝试过performance州长,但没有成功。

如何将最大时钟频率设置回3.6 GHz?


很奇怪,我在Lenovo Y50-70上的Arch Linux上遇到了完全相同的问题!直到大约一周前,它一直工作良好。我认为这与内核有关,因为我使用的是Liquorix补丁集(我在4.4.3内核中遇到了这个问题,并且在4.4.4中仍然存在)。您使用哪个内核?实际上,我不认为我会受到您在bugzilla中指出的错误的影响,因为它在两个星期之前和之前都可以正常工作。
弗拉德·弗罗洛夫

我用4.2.0-30-generic #36-Ubuntu SMP Fri Feb 26 00:58:07 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux。我不确定这个问题何时开始。
alain

一读二遍,似乎Bugtracker上的问题和提到的先例bugbugzilla.kernel.org/show_bug.cgi?id=66581正是我最终看到的。您是否尝试wrmsr 0x19a 0按照此线程bbs.archlinux.org/viewtopic.php?id=199922中的说明进行操作?(它并没有帮助我,但是有人报告说它对他们
有用

感谢您的建议,@ VladFrolov rdmsr返回wrmsr0 后为8,但不幸的是频率仍然相同。
alain

从该寄存器读取8表示未启用时钟调制。
Doug Smythies

Answers:


6

您遇到的问题已被多次报告。
请参考此bugzilla错误报告

该问题已经隔离到内核树中的特定提交。该提交还被反向移植到某些以前的稳定内核版本。
但是,实际的根本原因是Lenovo BIOS问题。从linux-pm电子邮件线程引用:

BIOS报告虚假的被动跳变点值,即0摄氏度...。要解决此虚假的BIOS,我们应通过检查跳变点值来禁用那些无效的跳变点,

如果返回一个或两个版本,则Lenovo将正常工作(已知4.2.0-19可以正常工作)。

您的问题与时钟调制(寄存器0x19A)无关,除非您的电池电量低于30%(未经证实,但值得怀疑)。

参考:
http :
//ubuntuforums.org/showthread.php?t=2316101奇怪的cpufreq缩放问题:无论调节器如何,
当电池电量不足30%时,i3在500Mhz时,最大cpufreq都会逐渐下降,http //marc.info/
? t = 145816738700001&r = 1&w = 2


我已经在Lenovo Y50-70的Arch Linux上测试了4.4.5和4.5.0-rc7内核。问题仍然存在。我将尝试4.4.0,因为一周前没有看到此问题,如果没有帮助,我将尝试4.3.0和4.2.0。
弗拉德·弗罗洛夫

是的,我知道问题一直存在于内核4.5-rc7中。请参阅Ubuntu论坛参考。
Doug Smythies

谢谢,是的,较旧的内核似乎可以工作。我测试了4.2.0-19、4.2.0-21,甚至4.2.0-27都可以,因此似乎已经在4.2.0-30中引入了。您知道是否已经有错误报告吗?
alain

对我来说,4.4.0、4.4.1、4.4.2和4.4.3正常工作!回归显示在4.4.4中,对我而言,则存在于4.4.5和4.5-rc7中。我猜想,Ubuntu向后移植了4.4.4补丁集中的某些内容……
Vlad Frolov

@alain根据Ubuntu更改日志changelogs.ubuntu.com/changelogs/pool/main/l/linux/…,在4.2.0-30.36、4.2.0-30.35和4.2.0-29中只有几个补丁,但是在4.2.0-28中有很多补丁。如果您可以尝试其中两个(4.2.0-28和4.2.0.-29),那就太好了。我试图从4.4.4补丁集还原一些补丁,但是我没有成功猜测。一旦找到导致问题的特定Ubuntu补丁集,我们就可以比较主线4.4.4和Ubuntu反向移植补丁集来查找麻烦。
弗拉德·弗罗洛夫
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.