[libvirt] Problem of host CPU topology parsing

Osier Yang jyang at redhat.com
Fri May 11 08:21:48 UTC 2012


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.

As a result, a domain without "cpuset" or "placement='auto'"
(which drives numad) will only be pinned to part of the
host CPUs (in the case of the 48 CPUS AMD machine, domain
process will be pinned to only the first 24 CPUs), which
cause the performance lost. And actually it's also functional
bug, as the "cpuset" specified by user could be truncated.

If a domain uses "placement='auto'", and the advisory
nodeset returned from numad has node(s) exceeds the wrong
max CPU number, the domain will fail to start, as the
bitmask passed to sched_setaffinity is fully filled with

"nodeinfo.cpus" has the right number though, but I'm not
sure if it should be used as the max CPU number.
VIR_NODEINFO_MAXCPUS is used in many places, and I'd never
want to fix something here, but break other things there.

Anyone has thought on how to sort the fucky topology out?

[1] http://fpaste.org/MTtz/

[2] http://fpaste.org/mtoA/, http://fpaste.org/EPLd/

[3] #define VIR_NODEINFO_MAXCPUS(nodeinfo) 


More information about the libvir-list mailing list