From: Wei Liu Subject: Re: [PATCH v9 3/3] tools, docs: add total/local memory bandwith monitoring Date: Fri, 13 Feb 2015 13:09:11 +0000 Message-ID: <20150213130911.GX13644@zion.uk.xensource.com> References: <1422864369-13982-1-git-send-email-chao.p.peng@linux.intel.com> <1422864369-13982-4-git-send-email-chao.p.peng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1422864369-13982-4-git-send-email-chao.p.peng@linux.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: wei.liu2@citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com List-Id: xen-devel@lists.xenproject.org On Mon, Feb 02, 2015 at 04:06:09PM +0800, Chao Peng wrote: > Add Memory Bandwidth Monitoring(MBM) for VMs. Two types of monitoring > are supported: total and local memory bandwidth monitoring. To use it, > CMT should be enabled in hypervisor. > > Signed-off-by: Chao Peng > --- > Changes in v9: > 1. Refactor code in xc_psr_cmt_get_data. Preferably this should be in a separate patch. With the line "No functional change" in commit message when appropriate. [...] > */ > #define LIBXL_HAVE_PSR_CMT 1 > + > +/* > + * LIBXL_HAVE_PSR_MBM > + * > + * If this is defined, the Memory Bandwidth Monitoring feature is supported. > + */ > +#define LIBXL_HAVE_PSR_MBM 1 > #endif > > typedef char **libxl_string_list; > @@ -1463,6 +1470,16 @@ int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx, > uint32_t *l3_cache_occupancy); > #endif > > +#ifdef LIBXL_HAVE_PSR_MBM > +int libxl_psr_cmt_type_supported(libxl_ctx *ctx, libxl_psr_cmt_type type); > +int libxl_psr_cmt_get_mem_bandwidth_sample(libxl_ctx *ctx, > + uint32_t domid, > + uint32_t socketid, > + bool total, > + uint64_t *sample_r, > + uint64_t *tsc_r); Should the interface be only limited to socket level? Do you (Intel) has plan to provide bandwidth sampling on finer grain level (say, core level)? I also assume that you will never have third type of memory bandwidth? I.e. do we need to change boolean total to a enum? Wei.