xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: "Xu, Dongxiao" <dongxiao.xu@intel.com>
Cc: "keir@xen.org" <keir@xen.org>,
	"Ian.Campbell@citrix.com" <Ian.Campbell@citrix.com>,
	"stefano.stabellini@eu.citrix.com"
	<stefano.stabellini@eu.citrix.com>,
	"andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"Ian.Jackson@eu.citrix.com" <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	"JBeulich@suse.com" <JBeulich@suse.com>,
	"dgdegra@tycho.nsa.gov" <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH v4 7/7] tools: enable Cache QoS Monitoring feature for libxl/libxc
Date: Wed, 4 Dec 2013 09:14:52 +0100	[thread overview]
Message-ID: <1386144892.3926.34.camel@Abyss> (raw)
In-Reply-To: <40776A41FC278F40B59438AD47D147A9118CD7AD@SHSMSX104.ccr.corp.intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 3329 bytes --]

On mer, 2013-12-04 at 02:44 +0000, Xu, Dongxiao wrote:
> > -----Original Message-----
> > From: Dario Faggioli [mailto:dario.faggioli@citrix.com]

> > Would it be possible to split this patch in 3, one for libxc, one for
> > libxl and one for xl?
> 
> Originally the patch is split (by functional), and later I merged them according to Andrew's suggestion.
> I think merge is okay since the logic is simple and straightforward.
> 
Oh, sorry for not noticing that. My personal preference is to always
split, even if logic is trivial, but again, that's just me. :-)

> > > diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> > > index c7dceda..fdca92d 100644
> > > --- a/tools/libxl/libxl.h
> > > +++ b/tools/libxl/libxl.h
> > > @@ -285,6 +285,7 @@
> > >
> > >  #include <libxl_uuid.h>
> > >  #include <_libxl_list.h>
> > > +#include <xenctrl.h>
> > >
> > Is this really necessary? I think it shouldn't... <xenctrl.h> is already
> > included in "libxl_internal.h", which you are including yourself below,
> > so...
> 
> libxl.h will reference "sysctl_cqminfo_t", which is defined in xenctrl.h.
> I didn't see libxl_internal.h is included in libxl.h, can you help to point it out?
> 
I see. No, all I said is that your new file, libxl_pqos.c, already
includes xenctrl.h, and hence I was asking whether that is not enough
and if not, why, and you just answered.

TBH, it still looks wrong to me. It does not happen for any other
similar situations and data type (or at least situations and data type
that look similar enough to me). What we do there, is defining a libxl
counterpart of the xc_* type, use it in the libxl interface and
translate between the twos _inside_ the libxl function, which is
implemented somewhere where libxl_internal.h, and then xenctrl.h, is
included, and have no problem seeing the xc_* type declaration.

Look, for example at libxl_get_physinfo(), xc_physinfo(), xc_physinfo_t.

Or you think your case is somewhat different? If yes, how?

> > > +int libxl_pqos_attach(libxl_ctx *ctx, uint32_t domid, const char * qos_type)
> > > +{
> > > +    int rc;
> > > +    uint32_t flags = 0;
> > > +
> > > +    if (!strncmp(qos_type, "cqm", 3))
> > > +        flags |= XEN_DOMCTL_pqos_cqm;
> > > +    else {
> > > +        rc = -EINVAL;
> > > +        LIBXL__LOG(ctx, XTL_ERROR, "%s", msg[EINVAL]);
> > >
> > I think new code should use the LOG() / LOGE() variant of the logging
> > macros.
> 
> I saw a lot of existing code still uses LIBXL__LOG() function.
> Besides, if we use LOGE(), we need to pass another variable "gc" to the function...
> Is this a guideline that we will stick to LOG()/LOGE() and deprecate calling of LIBXL__LOG() in later code?
> 
I don't think it's written anywhere yet, but I'm not sure. Anyway, I've
seen similar requests on this list (even got one! :-P) from some time
now.

As per the new gc parameter, that's not true, all you need is adding a
GC_INIT(ctx); call at the beginning of the function and a GC_FREE at the
end.

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

      reply	other threads:[~2013-12-04  8:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  8:47 [PATCH v4 0/7] enable Cache QoS Monitoring (CQM) feature Dongxiao Xu
2013-12-03  8:47 ` [PATCH v4 1/7] x86: detect and initialize Cache QoS Monitoring feature Dongxiao Xu
2013-12-03 11:46   ` Andrew Cooper
2013-12-03 12:54     ` Jan Beulich
2013-12-03 13:45       ` Andrew Cooper
2013-12-03 14:01         ` Jan Beulich
2013-12-03 20:32   ` Konrad Rzeszutek Wilk
2013-12-04 11:37     ` Ian Jackson
2013-12-03  8:47 ` [PATCH v4 2/7] x86: dynamically attach/detach CQM service for a guest Dongxiao Xu
2013-12-03  8:47 ` [PATCH v4 3/7] x86: initialize per socket cpu map Dongxiao Xu
2013-12-03  9:56   ` Dario Faggioli
2013-12-03  8:47 ` [PATCH v4 4/7] x86: collect CQM information from all sockets Dongxiao Xu
2013-12-03 11:52   ` Andrew Cooper
2013-12-03  8:47 ` [PATCH v4 5/7] x86: enable CQM monitoring for each domain RMID Dongxiao Xu
2013-12-03  8:47 ` [PATCH v4 6/7] xsm: add platform QoS related xsm policies Dongxiao Xu
2013-12-03 13:53   ` Daniel De Graaf
2013-12-03  8:47 ` [PATCH v4 7/7] tools: enable Cache QoS Monitoring feature for libxl/libxc Dongxiao Xu
2013-12-03 12:17   ` Dario Faggioli
2013-12-04  2:44     ` Xu, Dongxiao
2013-12-04  8:14       ` Dario Faggioli [this message]

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=1386144892.3926.34.camel@Abyss \
    --to=dario.faggioli@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=dongxiao.xu@intel.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).