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

Re: [Xen-devel] [PATCH v3 8/8] tools: add tools support for Intel CAT



On Wed, Apr 01, 2015 at 10:23:01AM +0100, Ian Campbell wrote:
> On Wed, 2015-04-01 at 17:06 +0800, Chao Peng wrote:
> > > > If this one returns all sockets but not a specified socket data (which 
> > > > I agreed)
> > > > and not consider legacy cmt code, then I think I can make
> > > > libxl_count_physical_sockets() private and move it to libxl/libxl_psr.c.
> > > 
> > > What is the legacy cmt code? But otherwise I agree, yes.
> > 
> > In libxl/xl_cmdimpl.c, psr_cmt_show also calculates the socket count
> > itself. If we want to refactor it with new libxl_count_physical_sockets
> > then libxl_count_physical_sockets should be public, otherwise it can be
> > private to libxl_psr.c only. From my side, both directions sound OK.
> 
> Ah, so we would want a "return a list of all sockets" variant of
> libxl_psr_cmt_get_cache_occupancy too? I think that's fine, we need to
> keep the old interface but we could easily add a new one, e.g.
> libxl_psr_cmt_get_all_cache_occupancy (insert the word "sockets" if you
> like).

The libxl_psr_cmt_get_cache_occupancy is actually not used in xl anymore
and should be considered as obsolete. Substitute is
libxl_psr_cmt_get_sample which is the common API for both cache
occupancy and memory bandwidth(For the latter the routine will be called
twice). So if we really want to do everything batch in libxl then
perhaps we should do that for libxl_psr_cmt_get_sample.

The other candidate is libxl_psr_cmt_get_l3_cache_size, which can also
do batch in libxl. 

While there is also drawback: If both
libxl_psr_cmt_get_sample/libxl_psr_cmt_get_l3_cache_size do their
batches in libxl, then libxl_count_physical_sockets will be called twice
in libxl which may bring performance drop.

Another solution is only do batch for libxl_psr_cmt_get_l3_cache_size.
It returns all sockets's cache size and meantime the socket number. Once
we get socket number, other functions(Both libxl_psr_cmt_get_sample for
CMT/MBM and libxl_psr_cat_get_l3_info/libxl_psr_cat_get_cbm for CAT)
can be called socket by socket in xl.

Chao
> 
> So both interfaces would be something like:
>    int libxl_psr_....(ctx, domid, TYPE **list_r, int *nr);
> 
> And on success *list_r points to a newly allocated array and *nr is the
> number of elements in that array. TYPE depends on which op it is, so for
> cache_occupancy it seems a uint32_t.
> 
> Is the socket address space always contiguous and starting at zero? If
> not then the array might need to contain (socket,TYPE) structs.
> 
> Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.