cpufreq 性能模块?

cpufreq 性能模块?

我没有看到 cpufreq 性能模块:

$ ll /lib/modules/2.6.32-358.2.1.el6.x86_64/kernel/drivers/cpufreq/
total 88<br/>
-rwxr--r--. 1 root root 20576 Mar 12 18:26 cpufreq_conservative.ko
-rwxr--r--. 1 root root 27096 Mar 12 18:26 cpufreq_ondemand.ko
-rwxr--r--. 1 root root  5336 Mar 12 18:26 cpufreq_powersave.ko
-rwxr--r--. 1 root root 14120 Mar 12 18:26 cpufreq_stats.ko
-rwxr--r--. 1 root root 10920 Mar 12 18:26 freq_table.ko

然后,进一步在线搜索表明它应该是内核的一部分而不是可加载模块(对于CentOS 5)?
http://lists.centos.org/pipermail/centos/2010-July/097217.html

我现在使用的是 CentOS 6。

这是否意味着我必须从源代码重新编译内核才能启用 cpufreq 性能?

更新#1:由于某些原因,我在 CentOS 6 上看不到该文件夹​​(David 提到):

$ ll /sys/devices/system/cpu/cpu0/
total 0<br/>
drwxr-xr-x. 6 root root    0 Mar 14 23:41 cache
drwxr-xr-x. 6 root root    0 Mar 15 01:29 cpuidle
-r--------. 1 root root 4096 Mar 14 23:41 crash_notes
drwxr-xr-x. 2 root root    0 Mar 15 01:29 microcode
lrwxrwxrwx. 1 root root    0 Mar 15 01:29 node0 -> ../../node/node0
drwxr-xr-x. 2 root root    0 Mar 15 01:29 thermal_throttle
drwxr-xr-x. 2 root root    0 Mar 14 23:41 topology

更新 #2:

$ sudo cpufreq-set -c 0 -g performance
Error setting new values. Common errors:
- Do you have proper administration rights? (super-user?)
- Is the governor you requested available and modprobed?
- Trying to set an invalid policy?
- Trying to set a specific frequency, but userspace governor is not available,
   for example because of hardware which cannot be set to a specific frequency
   or because the userspace governor isn't loaded?

答案1

即使你从下面的命令看到它:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors 

这并不意味着它会起作用。

如果您使用性能调节器,则要求使用 cpufreq_performance 编译内核。

先前关于如果它列出您就可以使用它的评论是不正确的,错误的。

您可以通过以下方式验证

watch grep \"cpu MHz\" /proc/cpuinfo

当然是使用 sudo。如果 FREQ 发生变化,则说明它正在运行。

必需 - cpufreq_performance.ko 模块<--您可以通过运行来检查以确保它存在。

首先确保 acpi-cpufreq.ko 可用。

ls /lib/modules/{kernel version}/kernel/arch/x86/kernel/cpu/cpufreq/

ls /lib/modules/{kernel version}/kernel/drivers/cpufreq/

如果 cpufreq_performance.ko 模块不存在,则意味着您需要编译它。

答案2

据我所见(在我的 Fedora Box 上),性能调节器已被编译到系统中,因此您可以使用它。

我可以使用以下命令检查可用的调控器

cat /sys/设备/系统/cpu/cpu0/cpufreq/scaling_available_governors

(即使它没有被编译为模块,它也会显示性能调节器)。

相关内容