]> git.ipfire.org Git - thirdparty/libvirt.git/commit
hostcpu: add support for reporting die_id in NUMA topology
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 16 Dec 2019 18:10:29 +0000 (18:10 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 16 Jan 2020 15:11:55 +0000 (15:11 +0000)
commit7b79ee2f78bbf2af76df2f6466919e19ae05aeeb
treef1fef53749a2b15e18bb9958faa89d282f3c13a2
parent4cf8dd0c57330e9141333a1b9f4e318e3c83a289
hostcpu: add support for reporting die_id in NUMA topology

Update the host CPU code to report the die_id in the NUMA topology
capabilities. On systems with multiple dies, this fixes the bug
where CPU cores can't be distinguished:

 <cpus num='12'>
   <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
   <cpu id='1' socket_id='0' core_id='1' siblings='1'/>
   <cpu id='2' socket_id='0' core_id='0' siblings='2'/>
   <cpu id='3' socket_id='0' core_id='1' siblings='3'/>
 </cpus>

Notice how core_id is repeated within the scope of the same socket_id.

It now reports

 <cpus num='12'>
   <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
   <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
   <cpu id='2' socket_id='0' die_id='1' core_id='0' siblings='2'/>
   <cpu id='3' socket_id='0' die_id='1' core_id='1' siblings='3'/>
 </cpus>

So core_id is now unique within a (socket_id, die_id) pair.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
15 files changed:
docs/schemas/capability.rng
src/conf/capabilities.c
src/conf/capabilities.h
src/libvirt_linux.syms
src/util/virhostcpu.c
src/util/virhostcpu.h
tests/vircaps2xmldata/vircaps-aarch64-basic.xml
tests/vircaps2xmldata/vircaps-x86_64-basic.xml
tests/vircaps2xmldata/vircaps-x86_64-caches.xml
tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
tests/vircaps2xmldata/vircaps-x86_64-resctrl-cmt.xml
tests/vircaps2xmldata/vircaps-x86_64-resctrl-fake-feature.xml
tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml
tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml
tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml