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

[Libvir] [PATCH] an irregular value is set as 'CPU Affinity' by virsh vcpupin



Hi,

There is a difference between 'CPU Affinity' of 'virsh vcpuinfo' and
'CPU Affinity' of 'xm vcpu-list' when I set the vcpu affinity by 
'virsh vcpupin'. i.e. 'xm vcpu-list' shows wrong value.
But there is no difference between them when I set by 'xm vcpu-pin'.

   (a) set by 'virsh vcpupin'
   # virsh vcpupin guest_dom 0 1
   # virsh vcpuinfo guest_dom
   VCPU:           0
   CPU:            1
   State:          blocked
   CPU time:       17.1s
   CPU Affinity:   -y------

   # xm vcpu-list guest_dom
   Name                 ID VCPUs   CPU State   Time(s) CPU Affinity
   guest_dom            13     0     1   -b-      17.1 any cpu

   (b) set by 'xm vcpu-pin'
   # xm vcpu-pin guest_dom 0 0
   # virsh vcpuinfo guest_dom
   VCPU:           0
   CPU:            0
   State:          blocked
   CPU time:       17.1s
   CPU Affinity:   y-------

   # xm vcpu-list guest_dom
   Name                 ID VCPUs   CPU State   Time(s) CPU Affinity
   guest_dom            13     0     0   -b-      17.1 0

I guess that the allocated memory to cpumap must be 8-byte for Xen 
because "xc_vcpu_setaffinity libxc/xc_domain.c" is using uint64_t 
as cpumap. But the libvirt is allocating only maplen size for cpumap.
    virsh +--- cpumaplen  ---+
           (more than 1-byte)
    xen   +----------------- 8-byte -----------------+
                           (uint64_t)

Then, an irregular value is set to the buffer that is more than the
number of physical CPU, because libvirt initialize maplen size only
(i.e. not initialize 8-byte buffer).

So, I changed the size of cpumap and the value of nr_cpus
at xen_internal.c.

Regards,
Saori Fukuta

Attachment: cpumap_allocate.patch
Description: Binary data


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