观察:
我有一台带有AMD双核CPU(Turion II Neo N40L)的HP服务器,它可以将频率从800扩展到1500 MHz。频率缩放可在FreeBSD 9和Linux内核3.5的Ubuntu 12.04下使用。但是,当我将FreeBSD 9放在Ubuntu之上的KVM环境中时,频率缩放不起作用。来宾(因此,FreeBSD)不会检测最小和最大频率,因此在CPU占用率较高时不会扩展任何内容。在主机(因此是Ubuntu)上,KVM进程使用了80%到140%的CPU资源,但没有发生频率缩放,频率保持在800 MHz,尽管当我在同一Ubuntu机器上运行任何其他进程时,按需调速器很快将频率扩展到1500 MHz!
关注和问题:
我不了解CPU可能如何虚拟化,以及是否由来宾执行适当的扩展。它是否需要向来宾显示一些CPU功能才能起作用?
Apendix:
在下面的Red Hat发布说明倾向于认为,频率缩放出来工作,即使在虚拟化环境中(参见第6.2.2和6.2.3),认为注未能解决其虚拟化技术与(KVM,Xen的这项工作等?)
有关信息,cpufreq-info
Ubuntu上的输出为:
$ cpufreq-info
cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: powernow-k8
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 8.0 us.
hardware limits: 800 MHz - 1.50 GHz
available frequency steps: 1.50 GHz, 1.30 GHz, 1000 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 1.50 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 800 MHz.
cpufreq stats: 1.50 GHz:14.79%, 1.30 GHz:1.07%, 1000 MHz:0.71%, 800 MHz:83.43% (277433)
analyzing CPU 1:
driver: powernow-k8
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 8.0 us.
hardware limits: 800 MHz - 1.50 GHz
available frequency steps: 1.50 GHz, 1.30 GHz, 1000 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance
current policy: frequency should be within 800 MHz and 1.50 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 800 MHz.
cpufreq stats: 1.50 GHz:14.56%, 1.30 GHz:1.06%, 1000 MHz:0.79%, 800 MHz:83.59% (384089)
我希望此功能起作用的原因是:节省能源,运行安静(较少发热量)以及好奇心,以便更好地了解为什么不起作用以及如何使其起作用。
cpufreq-info
在主机操作系统上运行,可能会抱怨没有可用的驱动程序。
cpufreq-info
不抱怨并输出适当的信息,因此完全支持CPU(当然有某种方式!)。使用的驱动程序是powernow-k8,这也是逻辑的。