[libvirt] Problem about CPU index

Hi all, In this function qemuMonitorJSONExtractCPUInfo(), It assumes that cpu index is always contiguous. if (cpu != i) { virReportError(VIR_ERR_INTERNAL_ERROR, _("unexpected cpu index %d expecting %d"), i, cpu); goto cleanup; } For x86, in what kind of situation does this error happen? This assumption causes the problem for ppc64. For ppc64, it's quite different from x86. SMT is needed to be disabled because of hardware's limitation. So, only one thread per core is online. These threads are not contiguous. For example, smt=4, 64 CPUs and 16 Cores CPU information is as the following: Architecture: ppc64 Byte Order: Big Endian CPU(s): 64 On-line CPU(s) list: 0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60 Off-line CPU(s) list: 1-3,5-7,9-11,13-15,17-19,21-23,25-27,29-31,33-35,37-39,41-43,45-47,49-51,53-55,57-59,61-63 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 16 NUMA node(s): 2 All CPUs we get are only 0,4, ..., 60. If possible, can this assumption be removed? Thanks. -- Li Zhang IBM China Linux Technology Centre

On 02/25/2013 10:22 PM, Li Zhang wrote:
Hi all,
In this function qemuMonitorJSONExtractCPUInfo(),
It assumes that cpu index is always contiguous.
If possible, can this assumption be removed?
Sure - patches welcome. It would be best if you can submit the patch, since you are the one being hit by the issue, and can test if your patch works. Asking anyone else to do the work when they can't reproduce the problem is going to be slower. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 2013年02月27日 07:28, Eric Blake wrote:
Hi all,
In this function qemuMonitorJSONExtractCPUInfo(),
It assumes that cpu index is always contiguous.
If possible, can this assumption be removed? Sure - patches welcome. It would be best if you can submit the patch, since you are the one being hit by the issue, and can test if your patch works. Asking anyone else to do the work when they can't reproduce the
On 02/25/2013 10:22 PM, Li Zhang wrote: problem is going to be slower.
Sure, I will send out patch. Thanks a lot. :)
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (3)
-
Eric Blake
-
Li Zhang
-
Li Zhang