1
0
mirror of https://gerrit.ovirt.org/vdsm synced 2026-02-05 12:46:23 +01:00
Files
vdsm/tests/caps_libvirt_intel_E5649.out
Amador Pahim 35a43da4fd Probe cpu count from new libvirt capabilities.
vdsm is using libvirt to get cpu count information. Libvirt was not
reporting the right information on AMD Bulldozer 62XX processors
or unusual cpu architectures. To fix it , libvirt people introduced[1]
the expanded capabilities topology output:

<capabilities>
  <host>
    <topology>
      <cells num='3'>
        <cell id='0'>
          <cpus num='4'> <!-- this is node with Hyperthreading -->
            <cpu id='0' socket_id='0' core_id='0' siblings='0-1'/>
            <cpu id='1' socket_id='0' core_id='0' siblings='0-1'/>
            <cpu id='2' socket_id='0' core_id='1' siblings='2-3'/>
            <cpu id='3' socket_id='0' core_id='1' siblings='2-3'/>
          </cpus>
        </cell>
        <cell id='1'>
          <cpus num='4'> <!-- this is node with modules (Bulldozer) -->
            <cpu id='4' socket_id='0' core_id='2' siblings='4-5'/>
            <cpu id='5' socket_id='0' core_id='3' siblings='4-5'/>
            <cpu id='6' socket_id='0' core_id='4' siblings='6-7'/>
            <cpu id='7' socket_id='0' core_id='5' siblings='6-7'/>
          </cpus>
         </cell>
        <cell id='2'>
          <cpus num='4'> <!-- this is a normal multi-core node -->
            <cpu id='8' socket_id='1' core_id='0' siblings='8'/>
            <cpu id='9' socket_id='1' core_id='1' siblings='9'/>
            <cpu id='10' socket_id='1' core_id='2' siblings='10'/>
            <cpu id='11' socket_id='1' core_id='3' siblings='11'/>
          </cpus>
         </cell>
      </cells>
    </topology>
  </host>
</capabilities>

As libvirt use a fallback fake topology when probing unusual cpu
architectures (for example, AMD 6200 series), new capabilities is
the only reasonable source of information for any cpu architecture[2].

vdsm must be changed to read cpu information from this new source.

- cpuThreads: To gather the number of threads, take the total number of
processors by counting the "<cpu ...>" lines in the NUMA topology
section.

- cpuCores : Count the siblings information. The number of distinct
siblings info determines the number of cores. On a bulldozer machine
all cores have separate core_ID but they share the siblings, as they're
threads.

- cpuSockets: Count the number of distinct "socket_id".

[1] - http://libvirt.org/git/?p=libvirt.git;a=commit;h=79a003f9b0042ef4d2cf
[2] - https://www.redhat.com/archives/libvir-list/2013-January/msg01140.html

Change-Id: I0e4a08cfcde6fb2e1ce4cf10478af72217c20ba5
Signed-off-by: Amador Pahim <apahim@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/11709
Reviewed-by: Dan Kenigsberg <danken@redhat.com>
2013-03-28 15:18:22 -04:00

146 lines
4.6 KiB
Plaintext

<capabilities>
<host>
<uuid>35373932-3337-435a-4a32-323430305750</uuid>
<cpu>
<arch>x86_64</arch>
<model>Westmere</model>
<vendor>Intel</vendor>
<topology sockets='1' cores='6' threads='2'/>
<feature name='rdtscp'/>
<feature name='pdpe1gb'/>
<feature name='dca'/>
<feature name='pcid'/>
<feature name='pdcm'/>
<feature name='xtpr'/>
<feature name='tm2'/>
<feature name='est'/>
<feature name='smx'/>
<feature name='vmx'/>
<feature name='ds_cpl'/>
<feature name='monitor'/>
<feature name='dtes64'/>
<feature name='pclmuldq'/>
<feature name='pbe'/>
<feature name='tm'/>
<feature name='ht'/>
<feature name='ss'/>
<feature name='acpi'/>
<feature name='ds'/>
<feature name='vme'/>
</cpu>
<power_management>
<suspend_disk/>
</power_management>
<migration_features>
<live/>
<uri_transports>
<uri_transport>tcp</uri_transport>
</uri_transports>
</migration_features>
<topology>
<cells num='2'>
<cell id='0'>
<cpus num='12'>
<cpu id='0' socket_id='0' core_id='0' siblings='0,12'/>
<cpu id='2' socket_id='0' core_id='8' siblings='2,14'/>
<cpu id='4' socket_id='0' core_id='2' siblings='4,16'/>
<cpu id='6' socket_id='0' core_id='10' siblings='6,18'/>
<cpu id='8' socket_id='0' core_id='1' siblings='8,20'/>
<cpu id='10' socket_id='0' core_id='9' siblings='10,22'/>
<cpu id='12' socket_id='0' core_id='0' siblings='0,12'/>
<cpu id='14' socket_id='0' core_id='8' siblings='2,14'/>
<cpu id='16' socket_id='0' core_id='2' siblings='4,16'/>
<cpu id='18' socket_id='0' core_id='10' siblings='6,18'/>
<cpu id='20' socket_id='0' core_id='1' siblings='8,20'/>
<cpu id='22' socket_id='0' core_id='9' siblings='10,22'/>
</cpus>
</cell>
<cell id='1'>
<cpus num='12'>
<cpu id='1' socket_id='1' core_id='0' siblings='1,13'/>
<cpu id='3' socket_id='1' core_id='8' siblings='3,15'/>
<cpu id='5' socket_id='1' core_id='2' siblings='5,17'/>
<cpu id='7' socket_id='1' core_id='10' siblings='7,19'/>
<cpu id='9' socket_id='1' core_id='1' siblings='9,21'/>
<cpu id='11' socket_id='1' core_id='9' siblings='11,23'/>
<cpu id='13' socket_id='1' core_id='0' siblings='1,13'/>
<cpu id='15' socket_id='1' core_id='8' siblings='3,15'/>
<cpu id='17' socket_id='1' core_id='2' siblings='5,17'/>
<cpu id='19' socket_id='1' core_id='10' siblings='7,19'/>
<cpu id='21' socket_id='1' core_id='1' siblings='9,21'/>
<cpu id='23' socket_id='1' core_id='9' siblings='11,23'/>
</cpus>
</cell>
</cells>
</topology>
<secmodel>
<model>selinux</model>
<doi>0</doi>
</secmodel>
<secmodel>
<model>dac</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.3.0</machine>
<machine canonical='rhel6.3.0'>pc</machine>
<machine>rhel6.2.0</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'/>
<pae/>
<nonpae/>
</features>
</guest>
<guest>
<os_type>hvm</os_type>
<arch name='x86_64'>
<wordsize>64</wordsize>
<emulator>/usr/libexec/qemu-kvm</emulator>
<machine>rhel6.3.0</machine>
<machine canonical='rhel6.3.0'>pc</machine>
<machine>rhel6.2.0</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>