Linux 大幅降低 CPU 频率(i5-4300U CPU)

Linux 大幅降低 CPU 频率(i5-4300U CPU)

目前正在处理一个问题,正在寻找一些指导。
我们当前的设置是运行 Ubuntu 14.04 的双核 (i5-4300U) Advantech 盒子。

我见过一些罕见的情况,CPU 核心从 ~2GHz 开始立即降频到 250 MHz,并且一直保持这个频率,直到我重新启动系统。
请注意,cpuinfo_min_freq设置为 800MHz,并且电源调节调节器设置为省电。

我最初的反应是,这与温度有关,但从温度来看,核心温度通常在 30 摄氏度左右,而当最新事件发生时,核心温度高达 30 摄氏度以上。这似乎不是太剧烈的跳跃,也不是超出健康范围。请参阅随附的屏幕截图。

CPU 频率

核心温度

几个问题:

  • 除了温度之外,还有其他因素会导致 CPU 频率降低吗?
  • 它会降低到最低设置以下,这看起来很奇怪吗?是什么原因造成的?
  • 关于这个设置还有其他一般见解或我应该研究的事情吗?

    >>:~$ uname -a
    
    Linux host 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:06:37 UTC 2016 i686 i686 i686 GNU/Linux
    
    
    >>:~$ cat /proc/cpuinfo
    processor   : 0
    vendor_id   : GenuineIntel
    cpu family  : 6
    model       : 69
    model name  : Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
    stepping    : 1
    microcode   : 0x16
    cpu MHz     : 1899.902
    cache size  : 3072 KB
    physical id : 0
    siblings    : 4
    core id     : 0
    cpu cores   : 2
    apicid      : 0
    initial apicid  : 0
    fdiv_bug    : no
    f00f_bug    : no
    coma_bug    : no
    fpu     : yes
    fpu_exception   : yes
    cpuid level : 13
    wp      : yes
    flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
    bugs        :
    bogomips    : 4988.23
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 39 bits physical, 48 bits virtual
    power management:
    
    processor   : 1
    vendor_id   : GenuineIntel
    cpu family  : 6
    model       : 69
    model name  : Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
    stepping    : 1
    microcode   : 0x16
    cpu MHz     : 1901.953
    cache size  : 3072 KB
    physical id : 0
    siblings    : 4
    core id     : 1
    cpu cores   : 2
    apicid      : 2
    initial apicid  : 2
    fdiv_bug    : no
    f00f_bug    : no
    coma_bug    : no
    fpu     : yes
    fpu_exception   : yes
    cpuid level : 13
    wp      : yes
    flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
    bugs        :
    bogomips    : 4988.23
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 39 bits physical, 48 bits virtual
    power management:
    
    processor   : 2
    vendor_id   : GenuineIntel
    cpu family  : 6
    model       : 69
    model name  : Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
    stepping    : 1
    microcode   : 0x16
    cpu MHz     : 1899.902
    cache size  : 3072 KB
    physical id : 0
    siblings    : 4
    core id     : 0
    cpu cores   : 2
    apicid      : 1
    initial apicid  : 1
    fdiv_bug    : no
    f00f_bug    : no
    coma_bug    : no
    fpu     : yes
    fpu_exception   : yes
    cpuid level : 13
    wp      : yes
    flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
    bugs        :
    bogomips    : 4988.23
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 39 bits physical, 48 bits virtual
    power management:
    
    processor   : 3
    vendor_id   : GenuineIntel
    cpu family  : 6
    model       : 69
    model name  : Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz
    stepping    : 1
    microcode   : 0x16
    cpu MHz     : 1902.246
    cache size  : 3072 KB
    physical id : 0
    siblings    : 4
    core id     : 1
    cpu cores   : 2
    apicid      : 3
    initial apicid  : 3
    fdiv_bug    : no
    f00f_bug    : no
    coma_bug    : no
    fpu     : yes
    fpu_exception   : yes
    cpuid level : 13
    wp      : yes
    flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm xsaveopt dtherm ida arat pln pts
    bugs        :
    bogomips    : 4988.23
    clflush size    : 64
    cache_alignment : 64
    address sizes   : 39 bits physical, 48 bits virtual
    power management:
    

答案1

支持该速度吗?

250MHz 是受支持的频率吗?查看这里应该会显示可用的频率(250MHz 将显示为 250000):

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies

您看到的速度准确吗?

忽略设置的最小值应该是多少,如果甚至不支持 250MHz,那么我猜测您使用的频率监视程序有问题,或者频率守护进程(内核?)有问题。

您正在使用什么来监视 CPU 频率? (来自 cpufrequtils),或者直接从或cpufreq-info读取“cpu MHz”行/proc/cpuinfo

cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq

或取决于你的驱动程序(在scaling_driver文件中)

cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq

当问题出现时,我肯定会检查所有这些。

当问题发生时,检查整体性能也是值得的。将基准测试与 CPU 正常运行时的速度进行比较,可以帮助确认它是否真的变慢了,还是只是“说”它很慢。好的基准测试包括:

  • openssl speed md5(感谢戴维·施瓦茨)
  • cryptsetup benchmark
  • 其中一个基准来自hardinfoUbuntu 的帮助 wikiDebianGitHub
    • archlinux 的 wiki 上有一个不错的页面基准测试一般来说
  • 只需观察dd虚拟“文件”上的 GB/s 速度就足够了(尽管在我刚才的测试中,每次运行它都会变化 ~0.5GB/s):

    if=/dev/zero of=/dev/null bs=1M count=10000
    10000+0 records in
    10000+0 records out
    10485760000 bytes (10 GB, 9.8 GiB) copied, 1.69302 s, 6.2 GB/s
    

如果它似乎是所有来源都确认的问题,我会尝试不同的内核。

相关内容