[libvirt] Problem of host CPU topology parsing

Osier Yang jyang at redhat.com
Fri May 11 09:08:19 UTC 2012


On 2012年05月11日 16:47, Michal Privoznik wrote:
> On 11.05.2012 10:40, Osier Yang wrote:
>> On 2012年05月11日 16:35, Daniel P. Berrange wrote:
>>> On Fri, May 11, 2012 at 04:21:48PM +0800, Osier Yang wrote:
>>>> Hi,
>>>>
>>>> We have problem of host CPU topology parsing on special
>>>> platforms (general platforms are fine). E.g.
>>>>
>>>> On a AMD machine with 48 CPUs [1] (4 sockets, 6 cores indeed
>>>> [2]), VIR_NODEINFO_MAXCPUS [3] will always return 24 as the
>>>> total CPU number.
>>>
>>> If it is returning 24, then surely we have the 'nodes' value
>>> wrong in the virNodeInfo ? It sounds like it should have been
>>> set to 2  (4 * 6 * 2 =>   48)
>>
>>      /* nodeinfo->sockets is supposed to be a number of sockets per NUMA
>> node,
>>       * however if NUMA nodes are not composed of whole sockets, we just lie
>>       * about the number of NUMA nodes and force apps to check
>> capabilities XML
>>       * for the actual NUMA topology.
>>       */
>>      if (nodeinfo->sockets % nodeinfo->nodes == 0)
>>          nodeinfo->sockets /= nodeinfo->nodes;
>>      else
>>          nodeinfo->nodes = 1;
>>
>> Jirka said this was for a fix, but I don't quite understand it,
>> what does the "nodeinfo.nodes" mean actually? Shouldn't it
>> be 8 (for the 48 CPUs machine) instead? But then we will be
>> wrong again with using VIR_NODEINFO_MAXCPUS.
>
> Why do you think it will be wrong? My understanding is that
> VIR_NODEINFO_MAXCPUS just tell the max number of possible cpus not the
> actual. So if it's over 48 we are safe.

No, one example of the potetial problems is command "virsh vcpuinfo",
the current problem is the display of CPU is truncated, if we change
it to 8, then it's extended.

> Btw: the code above seems like a hack to me.
>
> Michal

Regards,
Osier




More information about the libvir-list mailing list