<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-01-11 17:38 GMT+08:00 Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Jan 11, 2017 at 06:52:45AM +0000, Qiao, Liyong wrote:<br>
> Hi,<br>
><br>
> I observe that virsh capabilities give wrong cpu topology on a multiple sockets host<br>
><br>
> taget@jfz1r04h13:~/libvirt$ lscpu<br>
> Architecture: x86_64<br>
> CPU op-mode(s): 32-bit, 64-bit<br>
> Byte Order: Little Endian<br>
> CPU(s): 72<br>
> On-line CPU(s) list: 0-71<br>
> Thread(s) per core: 2<br>
> Core(s) per socket: 18<br>
> Socket(s): 2 <------------------------<br>
> NUMA node(s): 2<br>
> Vendor ID: GenuineIntel<br>
> CPU family: 6<br>
> Model: 63<br>
> Model name: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz<br>
> Stepping: 2<br>
> CPU MHz: 1201.660<br>
> CPU max MHz: 3600.0000<br>
> CPU min MHz: 1200.0000<br>
> BogoMIPS: 4590.78<br>
> Virtualization: VT-x<br>
> L1d cache: 32K<br>
> L1i cache: 32K<br>
> L2 cache: 256K<br>
> L3 cache: 46080K<br>
> NUMA node0 CPU(s): 0-17,36-53<br>
> NUMA node1 CPU(s): 18-35,54-71<br>
><br>
> But output of virsh capabilities only gives.<br>
><br>
> <topology sockets='1' cores='18' threads='2'/><br>
<br>
The 'sockets' value is basically "sockets-per-NUMA-node".<br>
<br>
><br>
> looking into code and got this:<br>
> <a href="https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/util/virhostcpu.c;h=f29f3122acee018b9fd7dca06fd7ae1fc118b210;hb=HEAD#l703" rel="noreferrer" target="_blank">https://libvirt.org/git/?p=<wbr>libvirt.git;a=blob;f=src/util/<wbr>virhostcpu.c;h=<wbr>f29f3122acee018b9fd7dca06fd7ae<wbr>1fc118b210;hb=HEAD#l703</a><br>
><br>
> should we change it into<br>
><br>
> 704<<a href="https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/util/virhostcpu.c;h=f29f3122acee018b9fd7dca06fd7ae1fc118b210;hb=HEAD#l704" rel="noreferrer" target="_blank">https://libvirt.org/git/?<wbr>p=libvirt.git;a=blob;f=src/<wbr>util/virhostcpu.c;h=<wbr>f29f3122acee018b9fd7dca06fd7ae<wbr>1fc118b210;hb=HEAD#l704</a>> *sockets += nodesockets;<br>
><br>
><br>
> This also affect nodeinfo.sockets.<br>
<br>
BOth the <topology> summary and nodeinfo data is really a broken<br>
design as it can't cope with asymetric topologies. We recommend<br>
apps to completely ignore this data, and instead look at the fine<br>
grained topology info in the capabilities:<br>
<br>
<topology><br>
<cells num='2'><br>
<cell id='0'><br>
...<br>
<cpus num='6'><br>
<cpu id='0' socket_id='0' core_id='0' siblings='0'/><br>
<cpu id='1' socket_id='0' core_id='2' siblings='1'/><br>
<cpu id='2' socket_id='0' core_id='4' siblings='2'/><br>
<cpu id='6' socket_id='0' core_id='1' siblings='6'/><br>
<cpu id='7' socket_id='0' core_id='3' siblings='7'/><br>
<cpu id='8' socket_id='0' core_id='5' siblings='8'/><br>
</cpus><br>
</cell><br>
...<br>
</cells><br>
</topology><br>
<br>
<br></blockquote><div> </div><div>Thanks Daniel, it's really good to know this.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards,<br>
Daniel<br>
<span class="HOEnZb"><font color="#888888">--<br>
|: <a href="http://berrange.com" rel="noreferrer" target="_blank">http://berrange.com</a> -o- <a href="http://www.flickr.com/photos/dberrange/" rel="noreferrer" target="_blank">http://www.flickr.com/photos/<wbr>dberrange/</a> :|<br>
|: <a href="http://libvirt.org" rel="noreferrer" target="_blank">http://libvirt.org</a> -o- <a href="http://virt-manager.org" rel="noreferrer" target="_blank">http://virt-manager.org</a> :|<br>
|: <a href="http://entangle-photo.org" rel="noreferrer" target="_blank">http://entangle-photo.org</a> -o- <a href="http://search.cpan.org/~danberr/" rel="noreferrer" target="_blank">http://search.cpan.org/~<wbr>danberr/</a> :|<br>
<br>
--<br>
libvir-list mailing list<br>
<a href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvir-list" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/libvir-list</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>天涯无处不重逢</div><div><span style="color:rgb(0,0,0);font-family:"Microsoft YaHei",Verdana,arial,sans-serif">a leaf duckweed belongs to the sea , where not to meet in life </span><br></div></div></div>
</div></div>