All of lore.kernel.org
 help / color / mirror / Atom feed
* Physical node info from libxl
@ 2010-05-07 11:12 Gihan Munasinghe
  2010-05-11 15:16 ` Stefano Stabellini
  0 siblings, 1 reply; 2+ messages in thread
From: Gihan Munasinghe @ 2010-05-07 11:12 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com

Guys

Looking at the libxl I can't see anywhere I can get a node info structure..
basically the physical info of the Node e.g - total_ram, free ram, no 
cpu etc

With the current xen version(3.3), I am pulling these data directly from 
xenctrl

     long int pagesize;
     xc_physinfo_t physinfo = {0};
     pagesize = sysconf(_SC_PAGE_SIZE);
     result = xc_physinfo(xc_handle, &physinfo);
     nodeinfo->cpu_hz = ((unsigned long long)physinfo.cpu_khz) * 1000ULL;
     nodeinfo->num_cpus = physinfo.nr_cpus;
     nodeinfo->tot_mem = ((unsigned long long) physinfo.total_pages) * 
pagesize ;
     nodeinfo->free_mem = ((unsigned long long) physinfo.free_pages) * 
pagesize ;
 
But I think having this code in libxl make more sense. So can I suggest 
a new structure like

typedef struct libxl_physinfo{
    long long cpu_hz;
    long long total_memorykb;
    long long free_memorykb;
    int num_cpus;
    /*Any more suggestions*/
}libxl_physinfo;

and a method
libxl_physinfo *libxl_physical_info(struct libxl_ctx *ctx);

This can be used in something like "xl info" as well  What you guys think?

Thanks

-- 
Gihan Munasinghe
R&D Team Leader
Flexiant Ltd.
www.flexiant.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Physical node info from libxl
  2010-05-07 11:12 Physical node info from libxl Gihan Munasinghe
@ 2010-05-11 15:16 ` Stefano Stabellini
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Stabellini @ 2010-05-11 15:16 UTC (permalink / raw)
  To: Gihan Munasinghe; +Cc: xen-devel@lists.xensource.com

On Fri, 7 May 2010, Gihan Munasinghe wrote:
> Guys
> 
> Looking at the libxl I can't see anywhere I can get a node info structure..
> basically the physical info of the Node e.g - total_ram, free ram, no 
> cpu etc
> 
> With the current xen version(3.3), I am pulling these data directly from 
> xenctrl
> 
>      long int pagesize;
>      xc_physinfo_t physinfo = {0};
>      pagesize = sysconf(_SC_PAGE_SIZE);
>      result = xc_physinfo(xc_handle, &physinfo);
>      nodeinfo->cpu_hz = ((unsigned long long)physinfo.cpu_khz) * 1000ULL;
>      nodeinfo->num_cpus = physinfo.nr_cpus;
>      nodeinfo->tot_mem = ((unsigned long long) physinfo.total_pages) * 
> pagesize ;
>      nodeinfo->free_mem = ((unsigned long long) physinfo.free_pages) * 
> pagesize ;
>  
> But I think having this code in libxl make more sense. So can I suggest 
> a new structure like
> 
> typedef struct libxl_physinfo{
>     long long cpu_hz;
>     long long total_memorykb;
>     long long free_memorykb;
>     int num_cpus;
>     /*Any more suggestions*/
> }libxl_physinfo;
> 
> and a method
> libxl_physinfo *libxl_physical_info(struct libxl_ctx *ctx);
> 
> This can be used in something like "xl info" as well  What you guys think?
> 

In xen-unstable 'xl info' and libxl_get_physinfo are already
implemented, in particular we have:

struct libxl_physinfo {
    uint32_t threads_per_core;
    uint32_t cores_per_socket;

    uint32_t max_cpu_id;
    uint32_t nr_cpus;
    uint32_t cpu_khz;

    uint64_t total_pages;
    uint64_t free_pages;
    uint64_t scrub_pages;

    uint32_t nr_nodes;
    uint32_t hw_cap[8];
    uint32_t phys_cap;
};

are you satisfied with the results?
You might want to checkout xen-unstable in the future because the most
recent developments in all xen areas are there, so you might find that
some features are already implemented.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-11 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-07 11:12 Physical node info from libxl Gihan Munasinghe
2010-05-11 15:16 ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.