Re: Add hyperthreaded sibling info to virsh capabilities

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

 



On 10/17/2012 03:06 PM, Dusty Mabe wrote:
> Hi,
> 
> Would it be possible to augment the output produced in virsh
> capabilities to also provide the hyperthreaded sibling of a processor?
> For example the information would look something like:
> 
> 
>     <topology>
> 
>       <cells num='2'>
>         <cell id='0'>
>           <cpus num='8'>
>             <cpu id='1' sibling='9'/>

Indeed, that sounds useful, and it is strictly additive so there is no
technical reason preventing that addition.

> I notice that you guys are actually using some of the numactl stuff
> (numa.h) to query for the cpus on a given node and I have combed
> through that code to see if it provided any info about hyperthreaded
> siblings but from what I can tell it does not. I have tinkered around
> with the hwloc libraries (http://www.open-mpi.org/projects/hwloc/) and
> have written a short program to print out each logical cpu and its
> hyperthreaded sibling (see attached)

We haven't used hwloc before, but if that is the only way to get at the
sibling information, it sounds like it might be a reasonable additional
requirement for libvirt.

On Fedora 17, I see:

 hwloc               x86_64         1.4.1-2.fc17          updates
  1.1 M
 hwloc-devel         x86_64         1.4.1-2.fc17          updates
  150 k

so it looks like -lhwloc is currently bundled alongside the hwloc
command line executable; the library itself is decently small:

-rwxr-xr-x. 1 root root 163168 Apr 18 16:27 /usr/lib64/libhwloc.so.5.0.1

so I wonder if Fedora packaging should split that up so we only drag in
the library instead of the whole command line utility.  But that's a
concern for Fedora, not this list.

> Would you guys ever consider adding something like this? I would be
> willing to help create a patch if I had some guidance.

Absolutely!  It sounds like there's several major places to touch to add
this in:
configure.ac - check for presence of hwloc
libvirt.spec.in - require hwloc on new-enough Fedora
docs - document the new XML
docs/schemas - accept the new XML during RNG validation
src/nodeinfo.c - use the new library, when availalble, to get at the new
information
tests - add a new xml file that demonstrates the RNG changes accept the
new XML

You may find it helpful to read http://libvirt.org/hacking.html

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]