Bug 817444 - virsh nodeinfo reports wrong number of sockets
virsh nodeinfo reports wrong number of sockets
Status: CLOSED CURRENTRELEASE
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-29 23:23 EDT by purpleidea
Modified: 2016-03-23 17:19 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-23 17:19:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description purpleidea 2012-04-29 23:23:36 EDT
Description of problem:
virsh nodeinfo reports 1 socket, when there are most definitely four. I am most concerned that this could be perhaps affecting something else in virt* in case this is a library error and not just a display error.
Please let me know if you want me to provide other information. (Obviously there is a bug because I'm not nearly cool enough to have a one socket CPU with 48 cores)


Version-Release number of selected component (if applicable):
Centos 6.2

How reproducible:
100%
This is also reproducible on an identical "iron2" machine.

Steps to Reproduce:
1. Run: virsh nodeinfo
2.
3.
  
Actual results:

[root@iron1 ~]# virsh nodeinfo
CPU model:           x86_64
CPU(s):              48
CPU frequency:       1866 MHz
CPU socket(s):       1
Core(s) per socket:  6
Thread(s) per core:  2
NUMA cell(s):        4
Memory size:         66092028 kB



Expected results:

CPU socket(s): should show: 4

Additional info:

[root@iron1 ~]# virsh capabilities
<capabilities>

  <host>
    <uuid>00020003-0004-0005-0006-000700080009</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Nehalem</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='6' threads='2'/>
      <feature name='rdtscp'/>
      <feature name='x2apic'/>
      <feature name='dca'/>
      <feature name='xtpr'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='monitor'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
      <feature name='vme'/>
    </cpu>
    <migration_features>
      <live/>
      <uri_transports>
        <uri_transport>tcp</uri_transport>
      </uri_transports>
    </migration_features>
    <topology>
      <cells num='4'>
        <cell id='0'>
          <cpus num='12'>
            <cpu id='0'/>
            <cpu id='1'/>
            <cpu id='2'/>
            <cpu id='3'/>
            <cpu id='4'/>
            <cpu id='5'/>
            <cpu id='24'/>
            <cpu id='25'/>
            <cpu id='26'/>
            <cpu id='27'/>
            <cpu id='28'/>
            <cpu id='29'/>
          </cpus>
        </cell>
        <cell id='1'>
          <cpus num='12'>
            <cpu id='6'/>
            <cpu id='7'/>
            <cpu id='8'/>
            <cpu id='9'/>
            <cpu id='10'/>
            <cpu id='11'/>
            <cpu id='30'/>
            <cpu id='31'/>
            <cpu id='32'/>
            <cpu id='33'/>
            <cpu id='34'/>
            <cpu id='35'/>
          </cpus>
        </cell>
        <cell id='2'>
          <cpus num='12'>
            <cpu id='12'/>
            <cpu id='13'/>
            <cpu id='14'/>
            <cpu id='15'/>
            <cpu id='16'/>
            <cpu id='17'/>
            <cpu id='36'/>
            <cpu id='37'/>
            <cpu id='38'/>
            <cpu id='39'/>
            <cpu id='40'/>
            <cpu id='41'/>
          </cpus>
        </cell>
        <cell id='3'>
          <cpus num='12'>
            <cpu id='18'/>
            <cpu id='19'/>
            <cpu id='20'/>
            <cpu id='21'/>
            <cpu id='22'/>
            <cpu id='23'/>
            <cpu id='42'/>
            <cpu id='43'/>
            <cpu id='44'/>
            <cpu id='45'/>
            <cpu id='46'/>
            <cpu id='47'/>
          </cpus>
        </cell>
      </cells>
    </topology>
    <secmodel>
      <model>selinux</model>
      <doi>0</doi>
    </secmodel>
  </host>

  <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <emulator>/usr/libexec/qemu-kvm</emulator>
      <machine>rhel6.2.0</machine>
      <machine canonical='rhel6.2.0'>pc</machine>
      <machine>rhel6.1.0</machine>
      <machine>rhel6.0.0</machine>
      <machine>rhel5.5.0</machine>
      <machine>rhel5.4.4</machine>
      <machine>rhel5.4.0</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/libexec/qemu-kvm</emulator>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <pae/>
      <nonpae/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/libexec/qemu-kvm</emulator>
      <machine>rhel6.2.0</machine>
      <machine canonical='rhel6.2.0'>pc</machine>
      <machine>rhel6.1.0</machine>
      <machine>rhel6.0.0</machine>
      <machine>rhel5.5.0</machine>
      <machine>rhel5.4.4</machine>
      <machine>rhel5.4.0</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/libexec/qemu-kvm</emulator>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <deviceboot/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

</capabilities>

[root@iron1 ~]#
Comment 1 Jiri Denemark 2012-04-30 03:59:19 EDT
> [root@iron1 ~]# virsh nodeinfo
> CPU model:           x86_64
> CPU(s):              48
> CPU frequency:       1866 MHz
> CPU socket(s):       1
> Core(s) per socket:  6
> Thread(s) per core:  2
> NUMA cell(s):        4
> Memory size:         66092028 kB

This is correct, CPU sockets in nodeinfo are counted per NUMA cell and we can't change this because libvirt's public API contains a macro that counts all CPUs as cells * sockets * cores * threads. See documentation for virNodeInfo structure: http://www.libvirt.org/html/libvirt-libvirt.html#virNodeInfo

> [root@iron1 ~]# virsh capabilities
> <capabilities>
> 
>   <host>
>     <uuid>00020003-0004-0005-0006-000700080009</uuid>
>     <cpu>
>       <arch>x86_64</arch>
>       <model>Nehalem</model>
>       <vendor>Intel</vendor>
>       <topology sockets='1' cores='6' threads='2'/>

However, I believe we should fix capabilities XML to show sockets='4' here. See also related discussion upstream:
https://www.redhat.com/archives/libvir-list/2012-March/msg01123.html
Comment 2 purpleidea 2012-04-30 14:21:53 EDT
Hi Jiri,

Okay, thank you for the response. Sorry my bug was not as meaningful as I thought. FWIW:

[root@iron1 ~]# numastat 
                           node0           node1           node2           node3
numa_hit               759859462       811255273      1287634274       922956748
numa_miss                4087790         6793253         2567421         6412145
numa_foreign             4764728         4342527         4667721         6085633
interleave_hit              9957            9989            9965            9951
local_node             758826554       810175297      1286515022       921803909
other_node               5120698         7873229         3686673         7564984


Thanks!
James
Comment 3 Cole Robinson 2016-03-23 17:19:21 EDT
AFAICT the capabilities bit was eventually fixed upstream, so closing

Note You need to log in before you can comment on or make changes to this bug.