每次从睡眠状态恢复后 CPU 时钟速度都会变慢

每次从睡眠状态恢复后 CPU 时钟速度都会变慢

我在联想 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?

答案1

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

该问题已隔离到内核树中的特定提交。该提交也已反向移植到一些以前的稳定内核版本。
但是,实际的真正根本原因是联想 BIOS 问题。引用自 linux-pm 电子邮件线程:

BIOS 报告了错误的被动跳变点值,即 0 摄氏度...为了解决这个错误的 BIOS,我们应该通过检查跳变点值来禁用这些无效的跳变点,

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

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

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

答案2

尝试切换调速器并使用“性能”。
此页面上的说明:https://www.perl.com/article/fixing-a-sluggish-linux-after-suspend-resume/

相关内容