[libvirt] libxl: calculating free pages in libvirt

Dario Faggioli raistlin at linux.it
Thu Jun 6 13:53:13 UTC 2013


Hi Jim,

As I told you in Dublin, I'm looking into libvirt a bit, with the main
purpose of implementing the NUMA interface for the libxl driver.

While at it I noticed that libxlNodeGetFreeMemory() uses the value
contained in phy_info.free_pages to check how many pages of free memory
we have.

However, starting from (Xen's git) commit bec8f17e, the number of free
pages should be computed like this:

 (phy_info.free_pages - phy_info.outstanding_pages)

to take the memory claiming mechanism introduced by Oracle properly into
account. You can see an example of that, for instance, looking at the
output_physinfo() function in tools/libxl/xl_cmdimpl.c (in the Xen
codebase, of course :-) ).

Said commit is from last May, and the claim mechanism altogether --which
includes adding the outstanding_pages field to the libxl_physinfo struct
in libxl-- was introduced during the 4.3 development cycle.

So, forgive the possibly dumb question, but what's the preferred way to
fix this in libvirt, without breaking build with old libxl versions?
(Provided this is something libvirt cares about, does it?)

For other features added within this last dev cycle, libxl has a
`#define LIBXL_HAVE_<foo>' (e.g., LIBXL_HAVE_DOMAIN_NODEAFFINITY), but I
don't see one for this particular field... Konrad, Ian, am I missing it?
If no, should we add it?

Thanks and Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130606/1848c5d2/attachment-0001.sig>


More information about the libvir-list mailing list