All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Chao Peng <chao.p.peng@linux.intel.com>
Cc: wei.liu2@citrix.com, will.auld@intel.com,
	stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v10 4/4] tools, docs: add total/local memory bandwith monitoring
Date: Mon, 2 Mar 2015 13:48:43 +0000	[thread overview]
Message-ID: <1425304123.21151.26.camel@citrix.com> (raw)
In-Reply-To: <1424940339-11455-5-git-send-email-chao.p.peng@linux.intel.com>

On Thu, 2015-02-26 at 16:45 +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 <chao.p.peng@linux.intel.com>

This looks good. I have one question and one small comment/idea:

[...]
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index 09d819f..54043ee 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -2688,6 +2688,8 @@ int xc_resource_op(xc_interface *xch, uint32_t nr_ops, xc_resource_op_t *ops);
>  #if defined(__i386__) || defined(__x86_64__)
>  enum xc_psr_cmt_type {
>      XC_PSR_CMT_L3_OCCUPANCY,
> +    XC_PSR_CMT_TOTAL_MEM_BANDWIDTH,
> +    XC_PSR_CMT_LOCAL_MEM_BANDWIDTH,

Is "bandwidth" still the correct term here (and more importantly in the
libxl interface e.g. enum), given that we now do the sampling at the
application level and just expose the current count from Xen via libxl?

I'm not sure what I better term would be though. "count"?

> @@ -167,6 +194,16 @@ int xc_psr_cmt_get_data(xc_interface *xch, uint32_t rmid, uint32_t cpu,
>      entries[nr].rsvd = 0;
>      nr++;
>  
> +    if ( tsc != NULL )
> +    {
> +        tsc_entry = &entries[nr];
> +        entries[nr].u.cmd = XEN_RESOURCE_OP_MSR_READ;
> +        entries[nr].idx = MSR_IA32_TSC;
> +        entries[nr].val = 0;
> +        entries[nr].rsvd = 0;
> +        nr++;
> +    }

Perhaps consider an assertion here that nr <= the number of elements in
the array (i.e. ARRAY_SIZE(entries))? (Either added here or in the patch
which switched to using nr++)

Ian.

  reply	other threads:[~2015-03-02 13:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  8:45 [PATCH v10 0/4] enable Memory Bandwidth Monitoring (MBM) for VMs Chao Peng
2015-02-26  8:45 ` [PATCH v10 1/4] tools: correct coding style for psr Chao Peng
2015-02-26  8:45 ` [PATCH v10 2/4] tools/libxc: code refactoring in xc_psr_cmt_get_data Chao Peng
2015-03-02 13:19   ` Ian Campbell
2015-02-26  8:45 ` [PATCH v10 3/4] tools/libxl: code refactoring for MBM Chao Peng
2015-02-26  8:45 ` [PATCH v10 4/4] tools, docs: add total/local memory bandwith monitoring Chao Peng
2015-03-02 13:48   ` Ian Campbell [this message]
2015-03-03  8:00     ` Chao Peng
2015-03-03 10:09       ` Ian Campbell
2015-03-04  1:04         ` Chao Peng
2015-03-04 10:07           ` Ian Campbell
2015-03-05  0:47             ` Chao Peng
2015-03-02 14:47 ` [PATCH v10 0/4] enable Memory Bandwidth Monitoring (MBM) for VMs Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425304123.21151.26.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=will.auld@intel.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.