英特尔 pstate 处理器频率非常高,即使在空闲时也是如此

英特尔 pstate 处理器频率非常高,即使在空闲时也是如此

我在配备 i7-4710HQ 处理器的华硕笔记本电脑上运行 Ubuntu。我对 cpu-freq 缩放有些问题。当我使用 intel-pstate 驱动程序时,频率总是很高(2.5GHz 时为 90%)。我读过帖子空闲时 CPU 频率高并更改内核行参数以禁用 intel-pstate 驱动程序,并且 CPU 频率缩放工作正常,但系统即使在 AC 上也不使用 turbo 模式 (3.5GHz)。

intel-pstate驱动程序可以正常工作吗?

下面是我使用 cpufreq_histogram 进行的一些测试。

全新启动,无需启动任何附加程序。

old cpufreq driver:
sudo ./cpufreq_histogram.sh 300
Collecting data for 300 seconds...
# NumSamples = 300; Min = 800.00; Max = 2100.00
# Mean = 856.000000; Variance = 36864.000000; SD = 192.000000; Median 800.000000
# each ∎ represents a count of 3
  800.0000 -   930.0000 [   284]: ∎∎∎∎∎ ... ∎∎∎∎∎ (94.67%)
  930.0000 -  1060.0000 [     2]:  (0.67%)
 1060.0000 -  1190.0000 [     0]:  (0.00%)
 1190.0000 -  1320.0000 [     3]: ∎ (1.00%)
 1320.0000 -  1450.0000 [     1]:  (0.33%)
 1450.0000 -  1580.0000 [     1]:  (0.33%)
 1580.0000 -  1710.0000 [     1]:  (0.33%)
 1710.0000 -  1840.0000 [     5]: ∎ (1.67%)
 1840.0000 -  1970.0000 [     1]:  (0.33%)
 1970.0000 -  2100.0000 [     2]:  (0.67%)

intel_pstate driver:
sudo ./cpufreq_histogram.sh 300
[sudo] hasło użytkownika mariusz: 
Collecting data for 300 seconds...
# NumSamples = 300; Min = 868.90; Max = 3500.30
# Mean = 2062.607000; Variance = 536898.224651; SD = 732.733393; Median 1789.700000
# each ∎ represents a count of 1
  868.9000 -  1132.0400 [    14]: ∎∎∎∎∎∎∎∎∎∎∎∎∎∎ (4.67%)
 1132.0400 -  1395.1800 [    30]: ∎∎∎∎∎ ... ∎∎∎∎∎ (10.00%)
 1395.1800 -  1658.3200 [    84]: ∎∎∎∎∎ ... ∎∎∎∎∎ (28.00%)
 1658.3200 -  1921.4600 [    41]: ∎∎∎∎∎ ... ∎∎∎∎∎ (13.67%)
 1921.4600 -  2184.6000 [    16]: ∎∎∎∎∎ ... ∎∎∎∎∎ (5.33%)
 2184.6000 -  2447.7400 [    20]: ∎∎∎∎∎ ... ∎∎∎∎∎ (6.67%)
 2447.7400 -  2710.8800 [    38]: ∎∎∎∎∎ ... ∎∎∎∎∎ (12.67%)
 2710.8800 -  2974.0200 [     6]: ∎∎∎∎∎∎ (2.00%)
 2974.0200 -  3237.1600 [     8]: ∎∎∎∎∎∎∎∎ (2.67%)
 3237.1600 -  3500.3000 [    43]: ∎∎∎∎∎ ... ∎∎∎∎∎ (14.33%)

全新开始 - 带有 html5 视频解码的 chromium 浏览器。

Old cpufreq driver:
sudo ./cpufreq_histogram.sh 300
Collecting data for 300 seconds...
# NumSamples = 300; Min = 800.00; Max = 2300.00
# Mean = 974.666667; Variance = 44691.555556; SD = 211.403774; Median 900.000000
# each ∎ represents a count of 2
  800.0000 -   950.0000 [   182]: ∎∎∎∎∎ ... ∎∎∎∎∎ (60.67%)
  950.0000 -  1100.0000 [    71]: ∎∎∎∎∎ ... ∎∎∎∎∎ (23.67%)
 1100.0000 -  1250.0000 [    28]: ∎∎∎∎∎∎∎∎∎∎∎∎∎∎ (9.33%)
 1250.0000 -  1400.0000 [     9]: ∎∎∎∎ (3.00%)
 1400.0000 -  1550.0000 [     0]:  (0.00%)
 1550.0000 -  1700.0000 [     2]: ∎ (0.67%)
 1700.0000 -  1850.0000 [     4]: ∎∎ (1.33%)
 1850.0000 -  2000.0000 [     3]: ∎ (1.00%)
 2000.0000 -  2150.0000 [     0]:  (0.00%)
 2150.0000 -  2300.0000 [     1]:  (0.33%)


intel_pstate driver:
sudo ./cpufreq_histogram.sh 300
Collecting data for 300 seconds...
# NumSamples = 300; Min = 800.00; Max = 3146.60
# Mean = 1847.854333; Variance = 230391.093281; SD = 479.990722; Median 1787.150000
# each ∎ represents a count of 1
  800.0000 -  1034.6600 [    13]: ∎∎∎∎∎∎∎∎∎∎∎∎∎ (4.33%)
 1034.6600 -  1269.3200 [    25]: ∎∎∎∎∎ ... ∎∎∎∎∎ (8.33%)
 1269.3200 -  1503.9800 [    33]: ∎∎∎∎∎ ... ∎∎∎∎∎ (11.00%)
 1503.9800 -  1738.6400 [    73]: ∎∎∎∎∎ ... ∎∎∎∎∎ (24.33%)
 1738.6400 -  1973.3000 [    42]: ∎∎∎∎∎ ... ∎∎∎∎∎ (14.00%)
 1973.3000 -  2207.9600 [    31]: ∎∎∎∎∎ ... ∎∎∎∎∎ (10.33%)
 2207.9600 -  2442.6200 [    32]: ∎∎∎∎∎ ... ∎∎∎∎∎ (10.67%)
 2442.6200 -  2677.2800 [    46]: ∎∎∎∎∎ ... ∎∎∎∎∎ (15.33%)
 2677.2800 -  2911.9400 [     2]: ∎∎ (0.67%)
 2911.9400 -  3146.6000 [     3]: ∎∎∎ (1.00%) 

答案1

最后我找到了解决办法。

intel_pstate 驱动程序在某些 Intel Hswell 及更高版本的处理器上存在一些问题。Arch Linux 用户注意到这是 intel_pstate 和内核内部计时器的问题。当计时器设置为 300Hz(arch 中的默认值)时,intel_pstate 驱动程序过于敏感。在 Ubuntu 中,通用内核中的计时器设置为 250Hz。

当我测试 linux-lowlatency 内核(将 CONFIG_HZ 设置为 1000)时,问题似乎消失了(似乎,因为我已经在 4.11 lowlatency 内核中测试过,解决方案并没有解决这个问题)。chrome html5video 解码的电池寿命从 2.5 小时增加到 4.5 小时。下面是我使用 lowlatency 4.10.0 内核进行的测试。

Collecting data for 62 seconds... 
# NumSamples = 62; Min = 799.80; Max = 3325.80
# Mean = 1332.198387; Variance = 413667.275965; SD = 643.169710; Median 1091.200000
# each ∎ represents a count of 1
  799.8000 -  1052.4000 [    29]: ∎∎∎∎∎∎∎...∎∎∎∎∎∎∎ (46.77%)
 1052.4000 -  1305.0000 [    14]: ∎∎∎∎∎∎∎∎∎∎∎∎∎∎ (22.58%)
 1305.0000 -  1557.6000 [     3]: ∎∎∎ (4.84%)
 1557.6000 -  1810.2000 [     5]: ∎∎∎∎∎ (8.06%)
 1810.2000 -  2062.8000 [     3]: ∎∎∎ (4.84%)
 2062.8000 -  2315.4000 [     0]:  (0.00%)
 2315.4000 -  2568.0000 [     5]: ∎∎∎∎∎ (8.06%)
 2568.0000 -  2820.6000 [     0]:  (0.00%)
 2820.6000 -  3073.2000 [     0]:  (0.00%)
 3073.2000 -  3325.8000 [     3]: ∎∎∎ (4.84%)

相关内容