From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v3 8/8] tools: add tools support for Intel CAT Date: Wed, 1 Apr 2015 10:23:01 +0100 Message-ID: <1427880181.2115.244.camel@citrix.com> References: <1427373505-9303-1-git-send-email-chao.p.peng@linux.intel.com> <1427373505-9303-9-git-send-email-chao.p.peng@linux.intel.com> <1427819334.2115.194.camel@citrix.com> <20150401075549.GA2696@pengc-linux.bj.intel.com> <1427877666.2115.221.camel@citrix.com> <20150401090642.GB2696@pengc-linux.bj.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150401090642.GB2696@pengc-linux.bj.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chao Peng Cc: keir@xen.org, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com, JBeulich@suse.com, wei.liu2@citrix.com, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org 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). 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.