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: Ian.Jackson@eu.citrix.com, will.auld@intel.com,
	stefano.stabellini@eu.citrix.com, Wei Liu <wei.liu2@citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: [PATCH v9 3/3] tools, docs: add total/local memory bandwith monitoring
Date: Wed, 25 Feb 2015 10:33:38 +0000	[thread overview]
Message-ID: <1424860418.20243.81.camel@citrix.com> (raw)
In-Reply-To: <20150225102125.GA32643@pengc-linux.bj.intel.com>

On Wed, 2015-02-25 at 18:21 +0800, Chao Peng wrote:
> On Mon, Feb 23, 2015 at 04:24:32PM +0000, Ian Campbell wrote:
> > On Fri, 2015-02-13 at 13:09 +0000, Wei Liu wrote:
> > > On Mon, Feb 02, 2015 at 04:06:09PM +0800, Chao Peng wrote: 
> > > > +#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)?
> > 
> > If we assume not then obviously some h/w designer will implement it ;-)
> > 
> > The existing libxl_psr_cmt_get_l3_cache_size has uint32_t socketid
> > though, so we may as well do the same here and fixup everything at once
> > if it ever happens.
> 
> I didn't see any implementation for core-level in the near future from
> Intel side but perhaps it's good idea to consider it, at least for long
> time. Define the following types achieve this purpose?
> 
> libxl_psr_scope_type = Enumeration("psr_scope_type", [
>     (1, "SOCKET"),
>     ])
> 
> libxl_psr_scope = Struct("psr_scope", [
>     ("u", KeyedUnion(None, libxl_psr_scope_type, "type",
>             ("socket",  integer),
>            ])),
> ], dir=DIR_OUT)

That's probably overkill. Simply expanding the socketid parameter to
encode socket/cores (perhaps widening the type) would suffice, wouldn't
it?

All that can wait until there is an actual sub-socket feature to
actually support.
> 
> > 
> > > 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?
> > 
> > There is already an enum, but some of the values it has don't really fit
> > this interface (the "l3_cache_size" isn't really a stat which needs
> > sampling), cf my wonder in response to v8 "if wedging all of these
> > logically unrelated statistics into an umbrella psr interface at the
> > libxl level makes sense."
> > 
> > Perhaps just call this interface psr_cmt_get_sample, pass it the enum
> > and always return a tsc? Then other types of stats sampling would fit in
> > the future, hopefully.
> 
> For l3_cache_size the tsc will not actually be returned if tsc is NULL.

But it will be if tsc != NULL, right?

> For the time being, the interface sounds enough for both cache occupancy
> and memory bandwidth.
> 
> The question is that if I adopt this solution will I remove the original
> dedicated l3_cache_size interface? Most concern is api compatibility but
> I think it has never been used outside of xl.

We can leave the old interface in place (perhaps as a wrapper around the
new one) as a deprecated one for compatibility, that's fine.

If we are really sure it is unused (i.e. libvirt never used it) then we
could consider removing it, there's an extent to which ABI compatibility
is a bit like a tree falling in the woods...

Ian.

  reply	other threads:[~2015-02-25 10:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02  8:06 [PATCH v9 0/3] enable Memory Bandwidth Monitoring (MBM) for VMs Chao Peng
2015-02-02  8:06 ` [PATCH v9 1/3] tools: correct coding style for psr Chao Peng
2015-02-02  8:06 ` [PATCH v9 2/3] tools: code refactoring for MBM Chao Peng
2015-02-02  8:06 ` [PATCH v9 3/3] tools, docs: add total/local memory bandwith monitoring Chao Peng
2015-02-13 13:09   ` Wei Liu
2015-02-23 16:24     ` Ian Campbell
2015-02-25 10:21       ` Chao Peng
2015-02-25 10:33         ` Ian Campbell [this message]
2015-02-04  8:39 ` [PATCH v9 0/3] enable Memory Bandwidth Monitoring (MBM) for VMs Chao Peng
2015-02-04  8:53   ` Jan Beulich
2015-02-04 11:46     ` Chao Peng
2015-02-11 11:09 ` Chao Peng

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=1424860418.20243.81.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.