From: George Dunlap <george.dunlap@eu.citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v4 1/7] libxl: get rid of the SEDF scheduler
Date: Wed, 8 Jul 2015 14:21:15 +0100 [thread overview]
Message-ID: <559D23CB.6000800@eu.citrix.com> (raw)
In-Reply-To: <20150707164332.19145.17551.stgit@Solace.station>
On 07/07/2015 05:43 PM, Dario Faggioli wrote:
> only the interface is left in place, for backward
> compile-time compatibility, but every attempt to
> use it would throw an error.
>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
> ---
> Cc: George Dunlap <george.dunlap@eu.citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> Changes from v3:
> - drop George's Rev-by: which should not be there since v2;
> - better grouping of fields in libxl_domain_sched_params, as
> suggested during review;
> - improved comment for ERROR_FEATURE_REMOVED, as suggested
> during review.
>
> Changes from v2:
> - introduce and use ERROR_FEATURE_REMOVED, as requested
> during review;
> - mark the SEDF only parameter as deprecated in libxl_types.idl,
> as requested during review.
> ---
> tools/libxl/libxl.c | 73 ++-----------------------------------------
> tools/libxl/libxl_create.c | 61 ------------------------------------
> tools/libxl/libxl_types.idl | 8 ++++-
> 3 files changed, 11 insertions(+), 131 deletions(-)
>
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 3a83903..38aff8d 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -5728,73 +5728,6 @@ static int sched_credit2_domain_set(libxl__gc *gc, uint32_t domid,
> return 0;
> }
>
> -static int sched_sedf_domain_get(libxl__gc *gc, uint32_t domid,
> - libxl_domain_sched_params *scinfo)
> -{
> - uint64_t period;
> - uint64_t slice;
> - uint64_t latency;
> - uint16_t extratime;
> - uint16_t weight;
> - int rc;
> -
> - rc = xc_sedf_domain_get(CTX->xch, domid, &period, &slice, &latency,
> - &extratime, &weight);
> - if (rc != 0) {
> - LOGE(ERROR, "getting domain sched sedf");
> - return ERROR_FAIL;
> - }
> -
> - libxl_domain_sched_params_init(scinfo);
> - scinfo->sched = LIBXL_SCHEDULER_SEDF;
> - scinfo->period = period / 1000000;
> - scinfo->slice = slice / 1000000;
> - scinfo->latency = latency / 1000000;
> - scinfo->extratime = extratime;
> - scinfo->weight = weight;
> -
> - return 0;
> -}
> -
> -static int sched_sedf_domain_set(libxl__gc *gc, uint32_t domid,
> - const libxl_domain_sched_params *scinfo)
> -{
> - uint64_t period;
> - uint64_t slice;
> - uint64_t latency;
> - uint16_t extratime;
> - uint16_t weight;
> -
> - int ret;
> -
> - ret = xc_sedf_domain_get(CTX->xch, domid, &period, &slice, &latency,
> - &extratime, &weight);
> - if (ret != 0) {
> - LOGE(ERROR, "getting domain sched sedf");
> - return ERROR_FAIL;
> - }
> -
> - if (scinfo->period != LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT)
> - period = (uint64_t)scinfo->period * 1000000;
> - if (scinfo->slice != LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT)
> - slice = (uint64_t)scinfo->slice * 1000000;
> - if (scinfo->latency != LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT)
> - latency = (uint64_t)scinfo->latency * 1000000;
> - if (scinfo->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT)
> - extratime = scinfo->extratime;
> - if (scinfo->weight != LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT)
> - weight = scinfo->weight;
> -
> - ret = xc_sedf_domain_set(CTX->xch, domid, period, slice, latency,
> - extratime, weight);
> - if ( ret < 0 ) {
> - LOGE(ERROR, "setting domain sched sedf");
> - return ERROR_FAIL;
> - }
> -
> - return 0;
> -}
> -
> static int sched_rtds_domain_get(libxl__gc *gc, uint32_t domid,
> libxl_domain_sched_params *scinfo)
> {
> @@ -5873,7 +5806,8 @@ int libxl_domain_sched_params_set(libxl_ctx *ctx, uint32_t domid,
>
> switch (sched) {
> case LIBXL_SCHEDULER_SEDF:
> - ret=sched_sedf_domain_set(gc, domid, scinfo);
> + LOG(ERROR, "SEDF scheduler no longer available");
> + ret=ERROR_FEATURE_REMOVED;
> break;
> case LIBXL_SCHEDULER_CREDIT:
> ret=sched_credit_domain_set(gc, domid, scinfo);
> @@ -5909,7 +5843,8 @@ int libxl_domain_sched_params_get(libxl_ctx *ctx, uint32_t domid,
>
> switch (scinfo->sched) {
> case LIBXL_SCHEDULER_SEDF:
> - ret=sched_sedf_domain_get(gc, domid, scinfo);
> + LOG(ERROR, "SEDF scheduler no longer available");
> + ret=ERROR_FEATURE_REMOVED;
> break;
> case LIBXL_SCHEDULER_CREDIT:
> ret=sched_credit_domain_get(gc, domid, scinfo);
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 9c2303c..3f31a3b 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -50,61 +50,6 @@ int libxl__domain_create_info_setdefault(libxl__gc *gc,
> return 0;
> }
>
> -static int sched_params_valid(libxl__gc *gc,
> - uint32_t domid, libxl_domain_sched_params *scp)
> -{
> - int has_weight = scp->weight != LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT;
> - int has_period = scp->period != LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT;
> - int has_slice = scp->slice != LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT;
> - int has_extratime =
> - scp->extratime != LIBXL_DOMAIN_SCHED_PARAM_EXTRATIME_DEFAULT;
> -
> - /* The sedf scheduler needs some more consistency checking */
> - if (libxl__domain_scheduler(gc, domid) == LIBXL_SCHEDULER_SEDF) {
> - if (has_weight && (has_period || has_slice))
> - return 0;
> - /* If you want a real-time domain, with its own period and
> - * slice, please, do provide both! */
> - if (has_period != has_slice)
> - return 0;
> -
> - /*
> - * Idea is, if we specify a weight, then both period and
> - * slice has to be zero. OTOH, if we do specify a period and
> - * slice, it is weight that should be zeroed. See
> - * docs/misc/sedf_scheduler_mini-HOWTO.txt for more details
> - * on the meaningful combinations and their meanings.
> - */
> - if (has_weight) {
> - scp->slice = 0;
> - scp->period = 0;
> - }
> - else if (!has_period) {
> - /* No weight nor slice/period means best effort. Parameters needs
> - * some mangling in order to properly ask for that, though. */
> -
> - /*
> - * Providing no weight does not make any sense if we do not allow
> - * the domain to run in extra time. On the other hand, if we have
> - * extra time, weight will be ignored (and zeroed) by Xen, but it
> - * can't be zero here, or the call for setting the scheduling
> - * parameters will fail. So, avoid the latter by setting a random
> - * weight (namely, 1), as it will be ignored anyway.
> - */
> -
> - /* We can setup a proper best effort domain (extra time only)
> - * iff we either already have or are asking for some extra time. */
> - scp->weight = has_extratime ? scp->extratime : 1;
> - scp->period = 0;
> - } else {
> - /* Real-time domain: will get slice CPU time over every period */
> - scp->weight = 0;
> - }
> - }
> -
> - return 1;
> -}
> -
> int libxl__domain_build_info_setdefault(libxl__gc *gc,
> libxl_domain_build_info *b_info)
> {
> @@ -888,12 +833,6 @@ static void initiate_domain_create(libxl__egc *egc,
> ret = libxl__domain_build_info_setdefault(gc, &d_config->b_info);
> if (ret) goto error_out;
>
> - if (!sched_params_valid(gc, domid, &d_config->b_info.sched_params)) {
> - LOG(ERROR, "Invalid scheduling parameters\n");
> - ret = ERROR_INVAL;
> - goto error_out;
> - }
> -
> for (i = 0; i < d_config->num_disks; i++) {
> ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]);
> if (ret) goto error_out;
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index e1632fa..378d6e3 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -68,6 +68,7 @@ libxl_error = Enumeration("error", [
> (-22, "ABORTED"),
> (-23, "NOTFOUND"),
> (-24, "DOMAIN_DESTROYED"), # Target domain ceased to exist during op
> + (-25, "FEATURE_REMOVED"), # For functionality that has been removed
> ], value_namespace = "")
>
> libxl_domain_type = Enumeration("domain_type", [
> @@ -356,10 +357,15 @@ libxl_domain_sched_params = Struct("domain_sched_params",[
> ("weight", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT'}),
> ("cap", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_CAP_DEFAULT'}),
> ("period", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT'}),
> + ("budget", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_BUDGET_DEFAULT'}),
> +
> + # The following three parameters ('slice', 'latency' and 'extratime') are deprecated,
> + # and will have no effect if used, since the SEDF scheduler has been removed.
> + # Note that 'period' was an SDF parameter too, but it is still effective as it is
> + # now used (together with 'budget') by the RTDS scheduler.
> ("slice", integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT'}),
> ("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'}),
> ])
>
> libxl_vnode_info = Struct("vnode_info", [
>
next prev parent reply other threads:[~2015-07-08 13:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 16:43 [PATCH v4 0/7] get rid of the SEDF Dario Faggioli
2015-07-07 16:43 ` [PATCH v4 1/7] libxl: get rid of the SEDF scheduler Dario Faggioli
2015-07-08 9:24 ` Ian Campbell
2015-07-08 13:21 ` George Dunlap [this message]
2015-07-08 14:00 ` Ian Campbell
2015-07-07 16:43 ` [PATCH v4 2/7] tools: python: get rid of the SEDF scheduler bindings Dario Faggioli
2015-07-07 16:43 ` [PATCH v4 3/7] libxc: get rid of the SEDF scheduler Dario Faggioli
2015-07-07 16:43 ` [PATCH v4 4/7] xen: " Dario Faggioli
2015-07-07 16:44 ` [PATCH v4 5/7] xen: kill sched_sedf.c Dario Faggioli
2015-07-07 16:44 ` [PATCH v4 6/7] xl: get rid of the SEDF scheduler Dario Faggioli
2015-07-07 16:44 ` [PATCH v4 7/7] docs: " Dario Faggioli
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=559D23CB.6000800@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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).