[libvirt] virsh nodeinfo CPU detection questions

Peter Krempa pkrempa at redhat.com
Tue Jan 29 16:04:53 UTC 2013


On 01/29/13 16:52, Scott Sullivan wrote:
> I have a machine with four AMD Opteron(TM) 6272 processors:
>
> http://www.amd.com/us/products/server/processors/6000-series-platform/6200/Pages/6200-series-processors.aspx#5
>
>
> I use 'virsh nodeinfo' to determine the amount of physical CPUs, and CPU
> cores. What values should I be looking at in the output of nodeinfo to
> determine this? With 1.X libvirts the output values have changed from
> 0.9.4:
>
> 0.9.4:
> [root at host ~]# virsh nodeinfo
> CPU model: x86_64
> CPU(s): 64
> CPU frequency: 2099 MHz
> CPU socket(s): 4
> Core(s) per socket: 8
> Thread(s) per core: 2
> NUMA cell(s): 1
> Memory size: 24713980 kB
> [root at host28 ~]#

This version probably didn't detect the NUMA nodes correctly.

>
> 1.0.1:
> [root at host ~]# virsh nodeinfo
> CPU model: x86_64
> CPU(s): 64
> CPU frequency: 2099 MHz
> CPU socket(s): 1
> Core(s) per socket: 8
> Thread(s) per core: 2
> NUMA cell(s): 4
> Memory size: 24713980 KiB
> [root at host28 ~]#
>
> As you can see, the CPU socket and NUMA cells values have changed in
> these two versions, on the same machine. To get the physical CPU count,
> is it safe to assume this?
>
> Numa cell(s) X CPU Socket(s) == physical CPUs present

To detect the total physical count of processors (packages) you can't 
rely on this output.

You should refer to the recently added topology information in the 
capabilities XML (accessible through the command "virsh capabilities"). 
The NUMA topology section there holds information (specially 
"socket_id") that allow you to count the number of physical sockets on 
the machine.

Unfortunately, this output will be part of tomorrows release :)

>
> However, I am not positive what formula I should use to determine the
> CPU core count. On this processor, it has 16 cores. Would that mean I
> can do this?

To determine the core count, you also need to refer to the information 
in capabilities. Unfortunately AMD processors (especially Bulldozer ones 
cannot be detected reliably with the code as it is now).

>
> Core(s) per socket X Thread(s) per core: == CPU cores
>
> Thanks in advance for clarifying.
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list




More information about the libvir-list mailing list