All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Peng <chao.p.peng@linux.intel.com>
To: Ian Campbell <ian.campbell@citrix.com>
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
Subject: Re: [PATCH v3 8/8] tools: add tools support for Intel CAT
Date: Wed, 1 Apr 2015 17:06:42 +0800	[thread overview]
Message-ID: <20150401090642.GB2696@pengc-linux.bj.intel.com> (raw)
In-Reply-To: <1427877666.2115.221.camel@citrix.com>

On Wed, Apr 01, 2015 at 09:41:06AM +0100, Ian Campbell wrote:
> On Wed, 2015-04-01 at 15:55 +0800, Chao Peng wrote:
> > On Tue, Mar 31, 2015 at 05:28:54PM +0100, Ian Campbell wrote:
> > > On Thu, 2015-03-26 at 20:38 +0800, Chao Peng wrote:
> > > > This is the xc/xl changes to support Intel Cache Allocation
> > > > Technology(CAT). Two commands are introduced:
> > > > - xl psr-cat-cbm-set [-s socket] <domain> <cbm>
> > > >   Set cache capacity bitmasks(CBM) for a domain.
> > > > - xl psr-cat-show <domain>
> > > >   Show Cache Allocation Technology information.
> > > 
> > > Please could you show an example of the output from this one.
> > 
> > I did put the sample output in the cover letter, but sounds like here is
> > the right place.
> 
> Sorry, I didn't think to look there at the time.
> 
> > > 
> > > > 
> > > > Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
> > > > ---
> > > > +
> > > > +=item B<psr-cat-cbm-set> [I<OPTIONS>] [I<domain-id>]
> > > > +
> > > > +Set cache capacity bitmasks(CBM) for a domain.
> > > 
> > > What is the syntax of these bitmaps, and where do I pass them?
> > 
> > [I<cbm>] is missing here.
> > 
> > > 
> > > I think there is also a bunch of terminology (CBM, COS) which need
> > > explaining, otherwise no one will know how to use it. Perhaps that
> > > belongs in a separate document or the wiki though?
> > 
> > Sounds it's worthy to create docs/misc/xl-psr.markdown.
> 
> I think the syntax of I<cbm> needs to be in this document, for sure, but
> I suspect that this stuff is complex enough that a more complete
> overview in a separate document might be useful too (possibly it should
> cover other related things, like the existing stuff like CMT and MBM
> too, assuming they are related enough?

Yes, they are also in the plan.

> 
> > 
> > > > +
> > > > +#define LIBXL_PSR_TARGET_ALL (~0U)
> > > > +int libxl_psr_cat_set_cbm(libxl_ctx *ctx, uint32_t domid,
> > > > +                          libxl_psr_cat_type type, uint32_t target,
> > > > +                          uint64_t cbm);
> > > > +int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
> > > > +                          libxl_psr_cat_type type, uint32_t target,
> > > > +                          uint64_t *cbm_r);
> > > 
> > > What are the units of the various cbm*
> 
> ?
> 
> > > 
> > > If they are now more precisely typed (i.e. not the opaque data from last
> > > time) then is the type parameter still needed?
> > 
> > 'type' is still used because in the future the possible value can be
> > L3_CODE_CBM/L3_DATA_CBM or even L2_CBM. We want to keep it common.
> 
> OK. And all future "cat_type" values will all have similar
> types/semantics?

Yes, they will. 

> 
> > > > +int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, uint32_t socket,
> > > > +                              uint32_t *cos_max_r, uint32_t *cbm_len_r);
> > > 
> > > Is there going to be any user documentation regarding what cos and cbm
> > > are and how to interpret them and set them?
> > 
> > So I'd like to create docs/misc/xl-psr.markdown to answer all these
> > questions.
> 
> OK.
> 
> 
> > > 
> > > > +    printf("%5d%25s", dominfo->domid, domain_name);
> > > > +    free(domain_name);
> > > > +
> > > > +    if (!libxl_psr_cat_get_cbm(ctx, dominfo->domid,
> > > > +                               LIBXL_PSR_CAT_TYPE_L3_CBM, socket, &cbm))
> > > > +         printf("%#16"PRIx64, cbm);
> > > > +
> > > > +    printf("\n");
> > > > +}
> > > > +
> > > > +static int psr_cat_print_socket(uint32_t domid, uint32_t socket)
> > > > +{
> > > > +    uint32_t l3_cache_size, cos_max, cbm_len;
> > > > +    int rc;
> > > > +
> > > > +    rc = libxl_psr_cmt_get_l3_cache_size(ctx, socket, &l3_cache_size);
> > > > +    if (rc) {
> > > > +        fprintf(stderr, "Failed to get l3 cache size for socket:%d\n", socket);
> > > > +        return -1;
> > > > +    }
> > > > +
> > > > +    rc = libxl_psr_cat_get_l3_info(ctx, socket, &cos_max, &cbm_len);
> > > 
> > > Would an interface which returns a list with information for all sockets
> > > not be more convenient?
> > 
> > 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.

Chao

  reply	other threads:[~2015-04-01  9:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-26 12:38 [PATCH v3 0/8] enable Cache Allocation Technology (CAT) for VMs Chao Peng
2015-03-26 12:38 ` [PATCH v3 1/8] x86: clean up psr boot parameter parsing Chao Peng
2015-03-26 20:42   ` Andrew Cooper
2015-03-26 12:38 ` [PATCH v3 2/8] x86: improve psr scheduling code Chao Peng
2015-03-27 18:15   ` Andrew Cooper
2015-03-26 12:38 ` [PATCH v3 3/8] x86: detect and initialize Intel CAT feature Chao Peng
2015-03-27 18:31   ` Andrew Cooper
2015-04-13 10:51     ` Jan Beulich
2015-04-13 10:58       ` Andrew Cooper
2015-03-26 12:38 ` [PATCH v3 4/8] x86: add support for COS/CBM manangement Chao Peng
2015-03-27 20:16   ` Andrew Cooper
2015-03-31  8:40     ` Chao Peng
2015-03-26 12:38 ` [PATCH v3 5/8] x86: add scheduling support for Intel CAT Chao Peng
2015-03-26 12:38 ` [PATCH v3 6/8] xsm: add CAT related xsm policies Chao Peng
2015-03-26 12:38 ` [PATCH v3 7/8] tools/libxl: introduce libxl_count_physical_sockets Chao Peng
2015-03-30 14:51   ` Wei Liu
2015-03-31  8:51     ` Chao Peng
2015-03-31 16:11       ` Ian Campbell
2015-03-26 12:38 ` [PATCH v3 8/8] tools: add tools support for Intel CAT Chao Peng
2015-03-31 16:28   ` Ian Campbell
2015-04-01  7:55     ` Chao Peng
2015-04-01  8:41       ` Ian Campbell
2015-04-01  9:06         ` Chao Peng [this message]
2015-04-01  9:23           ` Ian Campbell
2015-04-02  3:15             ` Chao Peng
2015-04-07  8:57               ` 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=20150401090642.GB2696@pengc-linux.bj.intel.com \
    --to=chao.p.peng@linux.intel.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.campbell@citrix.com \
    --cc=keir@xen.org \
    --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.