[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] Fix wrong nodeinfo->mhz when cpufreq is enabled



On Tue, Feb 02, 2010 at 06:15:50PM +0100, Thomas Treutner wrote:
> Hi,
> 
> I've written a little patch to fix wrong nodeinfo->mhz when the Linux
> kernel module cpufreq and a typical governor like ondemand are loaded.
> nodeinfo->mhz is then too low as libvirt just reads /proc/cpuinfo,
> entry "cpu MHz". This patch reads
> 
>         /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
> 
> if existing and corrects nodeinfo->mhz if the value found is higher.
> Using cpu0 is a crude hack but as discussed on IRC, considering different
> governors/maximum frequencies per cpu/core would require changing the
> nodeinfo struct, which would break the API.

  Right, just checked on my laptop (idle) and got cpu MHz : 800.000
while /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq indicates
a 2.2GHz model, we really need to fix this

> Some more info: https://bugzilla.redhat.com/show_bug.cgi?id=559762
> 
> Please have a careful look at my patch, my last C is quite some time ago.
> I tried to stick to linuxNodeInfoCPUPopulate, but f.e., checking for
> "&& *p == '\0'" after virStrToLong_ui doesn't work and I'm wondering why
> scaling_max_freq may not be terminated with by NUL? I also hope the file
> handling is correct, but please have a look.
> 
> There is still some todo: Some logging would be helpful, maybe one of you
> could point out which function best to use?
> 
> This is my first patch, so hopefully it follows in the next mail ;-)

  Okay, we will review but this clearly need to be fixed :-)

    thanks !

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]