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

[libvirt] The problem of CPU index

Hi all,

In the function qemuMonitorJSONExtractCPUInfo(),
it assumes that CPU indexes should be contiguous.
As the following:
       if (cpu != i) {
                           _("unexpected cpu index %d expecting %d"),
                           i, cpu);
            goto cleanup;

For x86, in what kind of situation will cause this error?

Actually, on ppc64, the CPU indexes always are not contiguous,
because smt is always disabled because of hardware's limitation for KVM.

For example, smt=4, CPUs=64, cores=16.

If with SMT enabled, 0~3 will run on core 0, 4~7 will run on core 1, ....
If SMT is disabled, only one thread is active. It should be 0, 4, 8,....

CPU information on my machine 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
Model:                 8246-L2C
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              4096K
L4 cache:              4096K
NUMA node0 CPU(s):     0,36,40,44,48,52,56,60
NUMA node1 CPU(s):     4,8,12,16,20,24,28,32

Actually, only 16 CPUs are online.
All we get CPUs are 0,4,8,...,60.

If possible, could this assumption be removed?


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