CPU频率在conky中是如何工作的?

Mit*_*tro 2 arch-linux xfce conky cpu-frequency

我正在设置 conky 并且我想添加 CPU 频率,但是如果我把

${freq_g cpu0} Ghz
Run Code Online (Sandbox Code Playgroud)

我得到 1.2Ghz。这是为什么?我的 CPU 是 2.8Ghz。

slm*_*slm 5

来自conky 手册页

中央处理器 (cpuN)

CPU 使用率(百分比)。对于 SMP 机器,可以提供 CPU 编号作为参数。${cpu cpu0} 是总使用量,${cpu cpuX} (X >= 1) 是单个 CPU。

freq_g (n)

以 GHz 为单位返回 CPU #n 的频率。CPU 从 1 开始计数。如果省略,则该参数默认为 1。

您很可能启用了SpeedStep 之类的功能,它就像汽车上的调速器,调节 CPU 内内核的速度。

您可以通过查看此命令的输出来确认这是正在发生的:

% less /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 37
model name      : Intel(R) Core(TM) i5 CPU       M 560  @ 2.67GHz
stepping        : 5
cpu MHz         : 1199.000
...
Run Code Online (Sandbox Code Playgroud)

重要的 2 个数字是 2.67GHz,即我的 CPU 额定运行的 GHz,然后是数字 1199.00,这是我的 Linux 笔记本电脑上的调控器设置允许我的 CPU 运行的频率。

您可以看到当前配置的调控器如下:

# available governors
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors 
powersave ondemand userspace performance 

# which one am I using?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 
powersave

# what's my current frequency scaling?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 
1199000

# what maximum is available?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 
2667000

# what's the minimum?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 
1199000

# what scaling frequencies can my CPU support?
% sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies 
2667000 2666000 2533000 2399000 2266000 2133000 1999000 1866000 1733000 1599000 1466000 1333000 1199000 
Run Code Online (Sandbox Code Playgroud)

您可以使用上面列出的调控器之一执行以下操作来覆盖调控器:

% sudo sh -c "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
Run Code Online (Sandbox Code Playgroud)

参考