From: Ian Campbell <ian.campbell@citrix.com>
To: Chao Peng <chao.p.peng@linux.intel.com>
Cc: keir@xen.org, stefano.stabellini@eu.citrix.com,
andrew.cooper3@citrix.com,
Dario Faggioli <dario.faggioli@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 v5 12/13] tools: add tools support for Intel CAT
Date: Tue, 21 Apr 2015 15:01:14 +0100 [thread overview]
Message-ID: <1429624874.4743.101.camel@citrix.com> (raw)
In-Reply-To: <20150421094956.GD4453@pengc-linux.bj.intel.com>
On Tue, 2015-04-21 at 17:49 +0800, Chao Peng wrote:
> On Tue, Apr 21, 2015 at 03:24:37AM +0200, Dario Faggioli wrote:
> > On Fri, 2015-04-17 at 22:33 +0800, Chao Peng wrote:
> > > This is the xc/xl changes to support Intel Cache Allocation
> > > Technology(CAT). Two commands are introduced:
> > > - xl psr-cat-hwinfo
> > > Show CAT hardware information.
> >
> > > Examples:
> > > [root@vmm-psr vmm]# xl psr-cat-hwinfo
> > > Cache Allocation Technology (CAT):
> > > Socket ID : 0
> > > L3 Cache : 12288KB
> > > Maximum COS : 15
> > > CBM length : 12
> > > Default CBM : 0xfff
> > >
> > Or, you can rename the psr-cmt-hwinfo command, added in the previous
> > patch, to 'psr-hwinfo' and make it accept options, e.g.,
> >
> > "-m, --cmt show Cache Monitoring Technology (CMT) hardware info"
> > "-c, --cat show Cache Allocation Technology (CAT) hardware info"
> >
> > By default (i.e., no options provided), it can just print all the hw
> > info.
> >
> > Not a big deal, but I think that would make a better command line
> > interface. Tools' maintainers' call, I guess.
>
> Thanks for suggestion.
FWIW I think this is a good idea.
> > > --- a/tools/libxl/libxl.h
> > > +++ b/tools/libxl/libxl.h
> >
> > > +#ifdef LIBXL_HAVE_PSR_CAT
> > > +
> > > +#define LIBXL_PSR_TARGET_ALL (~0U)
> > > +int libxl_psr_cat_set_cbm(libxl_ctx *ctx, uint32_t domid,
> > > + libxl_psr_cbm_type type, uint32_t target,
> > > + uint64_t cbm);
> > > +int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
> > > + libxl_psr_cbm_type type, uint32_t target,
> > > + uint64_t *cbm_r);
> > > +
> > The same applies here: I'd rename taget to socket.
> >
> > Then there's that LIBXL_PSR_TARGET_ALL. So, target (or socket, if you'll
> > rename it) is an integer representing _which_one_ socket to act on.
> > However, there is a special value to mean "all sockets".
> >
> > Another possibility would be to offer an API that "natively" allows for
> > operating on multiple sockets, by using libxl_bitmap-s, as it happens in
> > many other places, in libxl itself (e.g., setting and getting vcpu
> > affinity).
> >
> > That means target would become a libxl_bitmap, and, in the
> > implementation, you'll apply the operation on all the sockets
> > corresponding to a set bit in there. Only one bit set means just that
> > socket, all bits means all sockets.
> >
> > This looks like a better interface to me (no need for special ~0U
> > values), it'd make the implementation more linear, and is more
> > consistent with how other similar situations are handled in libxl.
> > However, I appreciate that one may find it overkill... I guess it
> > depends whether we expect the prevalent usage pattern to be almost
> > always about single sockets --and maybe on all sockets, from time to
> > time-- or if we see value in being able to specify more than one and
> > less than all sockets.
> >
> > For instance, now that we have vNUMA, if a domain has 4 vNUMA nodes,
> > each one mapped to a physical NUMA node, it looks to me like it would
> > make sense to set CAT to, say, 0x0F, on the sockets corresponding to the
> > physical NODEs. With the interface in this patch, that would require
> > calling libxl_psr_cat_set_cbm() 4 times, with the libxl_bitmap approach,
> > just once, after setting up the bitmap properly.
> >
> > Thoughts?
>
> I do like this suggestion and I have ever considered it actually. The
> only thing prevents me is that we need an extra _get_socket_count in xl
> for TARGET_ALL case. So libxl__count_physical_sockets is needed to be
> public. If Ian/Wei have no concerns for this, then I'm glad to do this.
I don't think you need libxl__count_physical_sockets for this, the
existing xl code for similar things just uses libxl_bitmap_set_any to
handle the all case.
With that in mind Dario's suggestion does seem like a good improvement
to the interface.
Ian.
next prev parent reply other threads:[~2015-04-21 14:01 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 14:33 [PATCH v5 00/13] enable Cache Allocation Technology (CAT) for VMs Chao Peng
2015-04-17 14:33 ` [PATCH v5 01/13] x86: add socket_to_cpumask Chao Peng
2015-04-17 14:33 ` [PATCH v5 02/13] x86: improve psr scheduling code Chao Peng
2015-04-20 15:42 ` Dario Faggioli
2015-04-17 14:33 ` [PATCH v5 03/13] x86: detect and initialize Intel CAT feature Chao Peng
2015-04-20 16:13 ` Dario Faggioli
2015-04-21 9:39 ` Chao Peng
2015-04-17 14:33 ` [PATCH v5 04/13] x86: maintain COS to CBM mapping for each socket Chao Peng
2015-04-17 14:33 ` [PATCH v5 05/13] x86: add COS information for each domain Chao Peng
2015-04-20 15:50 ` Andrew Cooper
2015-04-17 14:33 ` [PATCH v5 06/13] x86: expose CBM length and COS number information Chao Peng
2015-04-17 14:33 ` [PATCH v5 07/13] x86: dynamically get/set CBM for a domain Chao Peng
2015-04-20 15:52 ` Andrew Cooper
2015-04-21 9:42 ` Chao Peng
2015-04-17 14:33 ` [PATCH v5 08/13] x86: add scheduling support for Intel CAT Chao Peng
2015-04-17 14:33 ` [PATCH v5 09/13] xsm: add CAT related xsm policies Chao Peng
2015-04-17 14:33 ` [PATCH v5 10/13] tools/libxl: minor name changes for CMT commands Chao Peng
2015-04-20 16:07 ` Dario Faggioli
2015-04-21 13:56 ` Ian Campbell
2015-04-17 14:33 ` [PATCH v5 11/13] tools/libxl: add command to show CMT hardware info Chao Peng
2015-04-21 0:37 ` Dario Faggioli
2015-04-21 9:42 ` Chao Peng
2015-04-21 13:57 ` Ian Campbell
2015-04-17 14:33 ` [PATCH v5 12/13] tools: add tools support for Intel CAT Chao Peng
2015-04-21 1:24 ` Dario Faggioli
2015-04-21 9:49 ` Chao Peng
2015-04-21 14:01 ` Ian Campbell [this message]
2015-04-21 14:39 ` Dario Faggioli
2015-04-22 13:09 ` Chao Peng
2015-04-21 15:15 ` Dario Faggioli
2015-04-22 13:37 ` Chao Peng
2015-04-17 14:33 ` [PATCH v5 13/13] docs: add xl-psr.markdown Chao Peng
2015-04-21 14:05 ` 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=1429624874.4743.101.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=chao.p.peng@linux.intel.com \
--cc=dario.faggioli@citrix.com \
--cc=dgdegra@tycho.nsa.gov \
--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.