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

Re: [libvirt] getFreeMemory reporting incorrectly?



On Thu, Jun 11, 2009 at 02:13:17PM -0400, Hany Fahim wrote:
> My apologies. Here it is:
> Xen 3.3:
> 
> [root node1 ~]# xm info
> total_memory           : 3063
> free_memory            : 128
> node_to_cpu            : node0:0-1
> node_to_memory         : node0:128
> xen_major              : 3
> xen_minor              : 3
> xen_extra              : .1

> 
> Xen 3.0.3:
> 
> [root node2 ~]# xm info
> total_memory           : 2046
> free_memory            : 256
> node_to_cpu            : node0:0
> xen_major              : 3
> xen_minor              : 1
> xen_extra              : .2-128.1.6.el5


This shows that the Hypervisor  is giving correct info back with both 
versions. So the problem must be at the libvirt space, and I believe
I know what the problem is.

The version of Xen in RHEL5 has

struct xen_sysctl_availheap {
    /* IN variables. */
    uint32_t min_bitwidth;  /* Smallest address width (zero if don't care). */
    uint32_t max_bitwidth;  /* Largest address width (zero if don't care). */
    int32_t  node;          /* NUMA node of interest (-1 for all nodes). */
    /* OUT variables. */
    uint64_t avail_bytes;   /* Bytes available in the specified region. */
};

While upstream Xen has

struct xen_sysctl_availheap {
    /* IN variables. */
    uint32_t min_bitwidth;  /* Smallest address width (zero if don't care). */
    uint32_t max_bitwidth;  /* Largest address width (zero if don't care). */
    int32_t  node;          /* NUMA node of interest (-1 for all nodes). */
    /* OUT variables. */
    uint64_aligned_t avail_bytes;/* Bytes available in the specified region. */
};

Notice the 'avail_bytes' field is now aligned, so its 4 bytes further
down from where libvirt is expecting it to be. 

We'll have to provide a fix in libvirt to use the new alignment for 
newer Xen.

Regards,
Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


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