From: Ian Campbell Subject: Re: [PATCH v10 6/6] tools: enable Cache QoS Monitoring feature for libxl/libxc Date: Thu, 3 Apr 2014 13:52:22 +0100 Message-ID: <1396529542.4211.97.camel@kazak.uk.xensource.com> References: <1395815722-143165-1-git-send-email-dongxiao.xu@intel.com> <1395815722-143165-7-git-send-email-dongxiao.xu@intel.com> <1395933234.22909.145.camel@kazak.uk.xensource.com> <40776A41FC278F40B59438AD47D147A91197D0F6@SHSMSX104.ccr.corp.intel.com> <1395999834.22909.251.camel@kazak.uk.xensource.com> <40776A41FC278F40B59438AD47D147A911980DBA@SHSMSX104.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <40776A41FC278F40B59438AD47D147A911980DBA@SHSMSX104.ccr.corp.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: "Xu, Dongxiao" Cc: "keir@xen.org" , "stefano.stabellini@eu.citrix.com" , "andrew.cooper3@citrix.com" , "Ian.Jackson@eu.citrix.com" , "xen-devel@lists.xen.org" , "JBeulich@suse.com" , "dgdegra@tycho.nsa.gov" List-Id: xen-devel@lists.xenproject.org On Thu, 2014-04-03 at 11:31 +0000, Xu, Dongxiao wrote: > > -----Original Message----- > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > > Sent: Friday, March 28, 2014 5:44 PM > > To: Xu, Dongxiao > > Cc: xen-devel@lists.xen.org; keir@xen.org; JBeulich@suse.com; > > Ian.Jackson@eu.citrix.com; stefano.stabellini@eu.citrix.com; > > andrew.cooper3@citrix.com; konrad.wilk@oracle.com; dgdegra@tycho.nsa.gov > > Subject: Re: [PATCH v10 6/6] tools: enable Cache QoS Monitoring feature for > > libxl/libxc > > > > On Fri, 2014-03-28 at 00:53 +0000, Xu, Dongxiao wrote: > > > > -----Original Message----- > > > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > > > > Sent: Thursday, March 27, 2014 11:14 PM > > > > To: Xu, Dongxiao > > > > Cc: xen-devel@lists.xen.org; keir@xen.org; JBeulich@suse.com; > > > > Ian.Jackson@eu.citrix.com; stefano.stabellini@eu.citrix.com; > > > > andrew.cooper3@citrix.com; konrad.wilk@oracle.com; > > dgdegra@tycho.nsa.gov > > > > Subject: Re: [PATCH v10 6/6] tools: enable Cache QoS Monitoring feature for > > > > libxl/libxc > > > > > > > > On Wed, 2014-03-26 at 14:35 +0800, Dongxiao Xu wrote: > > > > [...] > > > > > +int libxl_pqos_attach(libxl_ctx *ctx, uint32_t domid, libxl_pqos_type > > > > qos_type); > > > > > +int libxl_pqos_detach(libxl_ctx *ctx, uint32_t domid, libxl_pqos_type > > > > qos_type); > > > > > +libxl_cqminfo * libxl_getcqminfo(libxl_ctx *ctx, unsigned int *l3c_total, > > > > > + unsigned int *nr_domains, unsigned int *nr_rmids, unsigned int > > > > *nr_sockets); > > > > [...] > > > > > +libxl_cqminfo = Struct("cqminfo", [ > > > > > + ("valid", uint32), > > > > > + ("l3c", uint64), > > > > > + ]) > > > > > > > > libxl_getcqminfo seems to have a strange mixture of returning an info > > > > struct and returning things via pointers passed as integers. why is > > > > that? > > > > > > The returned info is a unit data structure containing the L3 cache usage data for > > certain RMID on certain socket. > > > These pointers passed integers tell caller the number of such units are > > returned. > > > > > > This follows one existing function: > > > libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out); > > > where the return value is the unit dominfo data structure, and > > *nb_domain_out tells caller how many data structure units are returned. > > > > But libxl_getqminfo has three such nr_* pointers as parameters, which > > one is the length of the returned array? What are the other two? How > > does one enumerate the things which the other nr_* refer to? > > The size is calculated by nr_domains*nr_sockets. The nr_rmids is to > show how many RMIDs a system has. How do I find the info for socket i and domain j then? Please can you add a doc comment to this function to explain. Is domains in this context a Xen domain or some other type of hardware related domain? Or maybe the result of this function should be something more structured like: struct cqpcpuinfo { uint??_t socket, domain; uint32_t valid; /* why not a bool? */ uint32_t l3c; }; struct cqminfo { int nr_rmids; int nr_sockets; int nr_domains; cqmcpuifo *info; /* indexed by ... }; ? Or even a three level thing with top-level, sockets and domains (or domains then sockets): struct cqminfo { ... int nr_sockets struct cqsocketinfo { int nr_domains ... } } Also can valid be a bool? and what is "l3c", I guess it has something to do with the l3 cache, but please can you name it something more descriptive.