From: Dario Faggioli <dario.faggioli@citrix.com>
To: Chong Li <lichong659@gmail.com>
Cc: Chong Li <chong.li@wustl.edu>,
wei.liu2@citrix.com, Sisu Xi <xisisu@gmail.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
xen-devel@lists.xen.org,
Ian Campbell <Ian.Campbell@eu.citrix.com>,
mengxu@cis.upenn.edu, dgolomb@seas.upenn.edu
Subject: Re: [PATCH v1 3/4] libxl: enabling XL to set per-VCPU parameters of a domain for RTDS scheduler
Date: Tue, 12 May 2015 12:01:56 +0200 [thread overview]
Message-ID: <1431424916.2978.42.camel@citrix.com> (raw)
In-Reply-To: <1431018326-3239-4-git-send-email-chong.li@wustl.edu>
[-- Attachment #1.1: Type: text/plain, Size: 5456 bytes --]
[Adjusting the Cc list:
- removing hypervisor only people
- adding more tools maintainers
- adding George]
On Thu, 2015-05-07 at 12:05 -0500, Chong Li wrote:
> Change sched_rtds_domain_get/set functions to support per-VCPU settings for RTDS scheduler.
>
More on this patch (I had to run yesterday).
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 44bd8e2..8284ce1 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> +/* Consistent with XEN_LEGACY_MAX_VCPUS xen/arch-x86/xen.h*/
> +#define LIBXL_XEN_LEGACY_MAX_VCPUS 32
> +
Kill this. Nothing good can possibly come from relying on things like
this (i.e., copying constants --and even worse arch specific ones, in
this case!-- around).
> int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid,
> libxl_domain_sched_params *params);
> int libxl_domain_sched_params_set(libxl_ctx *ctx, uint32_t domid,
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 117b61d..806316a 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -347,6 +347,16 @@ libxl_domain_restore_params = Struct("domain_restore_params", [
> ("checkpointed_stream", integer),
> ])
>
> +libxl_rtds_vcpu = Struct("vcpu",[
>
^Struct("rtds_vcpu",[
> + ("period", uint64, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT'}),
> + ("budget", uint64, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT'}),
> + ("index", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_VCPU_INDEX_DEFAULT'}),
>
Call this last member vcpuid, if you want to be able to pass a
sparse/incomplete array, and hence you need to know to what vcpu each
element refers to, or just get rid of it, it you always pass all the
elements.
I'd go with the former.
> + ])
> +
> +libxl_domain_sched_rtds_params = Struct("domain_sched_rtds_params",[
>
I'd call this something like "vcpus_sched_rtds_params". Well, actually,
I don't think this is needed at all (see below).
> + ("vcpus", Array(libxl_rtds_vcpu, "num_vcpus")),
> + ])
> +
> libxl_domain_sched_params = Struct("domain_sched_params",[
> ("sched", libxl_scheduler),
> ("weight", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT'}),
> @@ -356,6 +366,7 @@ libxl_domain_sched_params = Struct("domain_sched_params",[
> ("latency", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT'}),
> ("extratime", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT'}),
> ("budget", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT'}),
> + ("rtds", libxl_domain_sched_rtds_params),
> ])
>
I've got the same concerns I've already expressed about the hypervisor
interface. Doing things like this, we will have
libxl_domain_sched_params that hosts both per-domain and per-vcpu
parameters, without a clear way to know what happens if one specifies
both.
Also, if at some point other schedulers want to support per-vcpu
parameters, the said information duplication (and ambiguity) will apply
to them too!
Finally, I don't think I would call the way the result returned by a
call to libxl_domain_sched_params_{get,set}() changes backward
compatible, which OTOH is something we want to retain in libxl.
So, if API compatibility/stability wasn't an issue, fiddling with
libxl_domain_sched_params would probably be the best solution. Since it
is, I'd leave that alone as much as possible, and introduce something
completely new, for dealing with per-vcpu parameters. Something like
this:
typedef struct libxl_vcpu_sched_params {
libxl_domain_sched_params vcpus[];
int num_vcpus;
} libxl_vcpu_sched_params;
[*]
And I'll deal with this in new API functions:
int libxl_vcpu_sched_params_get(libxl_ctx *ctx, uint32_t domid,
libxl_domain_vcpu_params *params);
int libxl_vcpu_sched_params_set(libxl_ctx *ctx, uint32_t domid,
const libxl_vcpu_sched_params *params);
At this point, if, say, Credit2 wants to start supporting per-vcpu
scheduling parameters, we're all set for that!
What do the tools' maintainers think?
The only thing I'm not sure about, in the described scenario, is what a
call to libxl_domain_sched_params_get() should return for a scheduler
which supports per-vcpu parameters, and actually has different
scheduling parameters for the various vcpus...
I mean, a call to libxl_domain_sched_params_set() can be interpreted
like 'set the passed params for all the vcpus', _get(), I don't know...
perhaps it should return some sort of ERROR_INVAL, to inform the caller
that it is libxl_vcpu_sched_params_get() that should be used?
Again, tools maintainers? :-)
Oh, and in any case, you need to mark that something is being added to
the libxl API using the '#define LIBXL_HAVE_*' mechanism. Look for
examples in libxl.h, there are several. If going for my proposal, I'd
call the constant LIBXL_HAVE_VCPU_SCHED_PARAMS.
Regards,
Dario
[*] I don't like the fact that the vcpus[] array is of
'libxl_domain_sched_params' type, especially the *domain* part of the
type name, but I don't think we can change that, for the said API
stability reasons.
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-05-12 10:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 17:05 [PATCH v1 0/4] Enabling XL to set per-VCPU parameters of a domain for RTDS scheduler Chong Li
2015-05-07 17:05 ` [PATCH v1 1/4] xen: enabling " Chong Li
2015-05-08 7:49 ` Jan Beulich
2015-05-10 22:04 ` Chong Li
2015-05-11 6:57 ` Jan Beulich
2015-05-14 22:27 ` Chong Li
2015-05-15 14:42 ` Dario Faggioli
2015-05-11 13:11 ` Dario Faggioli
2015-05-14 22:15 ` Chong Li
2015-05-07 17:05 ` [PATCH v1 2/4] libxc: " Chong Li
2015-05-11 13:27 ` Dario Faggioli
2015-05-07 17:05 ` [PATCH v1 3/4] libxl: " Chong Li
2015-05-11 14:06 ` Dario Faggioli
2015-05-15 15:24 ` Chong Li
2015-05-15 23:09 ` Dario Faggioli
2015-05-12 10:01 ` Dario Faggioli [this message]
2015-05-15 16:35 ` Chong Li
2015-05-15 23:02 ` Dario Faggioli
2015-05-22 17:57 ` Chong Li
2015-05-07 17:05 ` [PATCH v1 4/4] xl: " Chong Li
2015-05-14 14:24 ` Meng Xu
2015-05-14 14:39 ` Dario Faggioli
2015-05-14 14:43 ` Meng Xu
2015-05-11 9:56 ` [PATCH v1 0/4] Enabling " Dario Faggioli
2015-05-14 17:08 ` Chong Li
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=1431424916.2978.42.camel@citrix.com \
--to=dario.faggioli@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=chong.li@wustl.edu \
--cc=dgolomb@seas.upenn.edu \
--cc=lichong659@gmail.com \
--cc=mengxu@cis.upenn.edu \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
--cc=xisisu@gmail.com \
/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).