From: Dario Faggioli <raistlin@linux.it>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian.Jackson@citrix.com,
Juergen Gross <juergen.gross@ts.fujitsu.com>,
George.Dunlap@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH 3 of 5 V2] libxl: make it possible to explicitly specify default sched params
Date: Wed, 30 May 2012 09:26:33 +0200 [thread overview]
Message-ID: <1338362793.2609.20.camel@Abyss> (raw)
In-Reply-To: <274de8e1e0d116070d34.1338299821@cosworth.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 3909 bytes --]
On Tue, 2012-05-29 at 14:57 +0100, Ian Campbell wrote:
> int libxl_sched_sedf_domain_set(libxl_ctx *ctx, uint32_t domid,
> - libxl_sched_sedf_domain *scinfo)
> + libxl_domain_sched_params *scinfo)
> {
> - xc_domaininfo_t domaininfo;
> - int rc;
> -
> - rc = xc_domain_getinfolist(ctx->xch, domid, 1, &domaininfo);
> - if (rc < 0) {
> - LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
> + 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) {
> + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain sched sedf");
> return ERROR_FAIL;
> }
> - if (rc != 1 || domaininfo.domain != domid)
> - return ERROR_INVAL;
> -
> -
> - rc = xc_sedf_domain_set(ctx->xch, domid, scinfo->period * 1000000,
> - scinfo->slice * 1000000, scinfo->latency * 1000000,
> - scinfo->extratime, scinfo->weight);
> - if ( rc < 0 ) {
> +
> + if (scinfo->period != LIBXL_DOMAIN_SCHED_PARAM_PERIOD_DEFAULT)
> + period = scinfo->period * 1000000;
> + if (scinfo->slice != LIBXL_DOMAIN_SCHED_PARAM_SLICE_DEFAULT)
> + slice = scinfo->slice * 1000000;
> + if (scinfo->latency != LIBXL_DOMAIN_SCHED_PARAM_LATENCY_DEFAULT)
> + latency = 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);
>
I only tested this on your last version of this series (and I am still
trying to find the time to test this new one) and this wasn't working.
Reason should be the fact that the SEDF code in Xen wants you to put a
domain either in the "proper-EDF" state _or_ in the
"weighted-best-effort-state", and it discriminates this by checking
whether you're passing a slice+period _or_ a weight.
IOW, if your domain has a slice+period and wants a weight, either you
set slice and period to zero, or the whole thing will fail. In fact,
with this code, the new parameter set will include both the slice+period
(as the domain has them set) and the new weight that is being set by the
call... Does this sound right?
That's why the current int main_sched_sedf(int argc, char **argv) is
doing this:
if (opt_p) {
scinfo.period = period;
scinfo.weight = 0;
}
if (opt_s) {
scinfo.slice = slice;
scinfo.weight = 0;
}
if (opt_l)
scinfo.latency = latency;
if (opt_e)
scinfo.extratime = extra;
if (opt_w) {
scinfo.weight = weight;
scinfo.period = 0;
scinfo.slice = 0;
}
That being said, I'm not sure at what level we want to enforce something
like the above. The lowest level toolstack seems fine to me, which would
mean putting something like the code above in the config file parsing...
If you agree, I'll try that and let you know whether or not it works.
Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/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
next prev parent reply other threads:[~2012-05-30 7:26 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-29 13:56 [PATCH 0 of 5 V2] libxl: make it possible to explicitly specify default sched params Ian Campbell
2012-05-29 13:56 ` [PATCH 1 of 5 V2] libxl: add internal function to get a domain's scheduler Ian Campbell
2012-05-31 13:19 ` George Dunlap
2012-05-31 15:11 ` Ian Jackson
2012-06-01 9:51 ` Ian Campbell
2012-05-29 13:57 ` [PATCH 2 of 5 V2] libxl: rename libxl_sched_params to libxl_domain_sched_params Ian Campbell
2012-05-31 13:21 ` George Dunlap
2012-05-31 15:12 ` Ian Jackson
2012-05-29 13:57 ` [PATCH 3 of 5 V2] libxl: make it possible to explicitly specify default sched params Ian Campbell
2012-05-30 7:26 ` Dario Faggioli [this message]
2012-05-30 7:35 ` Ian Campbell
2012-05-30 8:00 ` Dario Faggioli
2012-06-01 10:14 ` Ian Campbell
2012-06-01 10:26 ` Dario Faggioli
2012-05-31 13:47 ` George Dunlap
2012-05-31 15:13 ` Ian Jackson
2012-05-29 13:57 ` [PATCH 4 of 5 V2] libxl: move libxl__sched_set_params into libxl.c Ian Campbell
2012-05-31 13:48 ` George Dunlap
2012-05-31 15:14 ` Ian Jackson
2012-05-29 13:57 ` [PATCH 5 of 5 V2] libxl: expose a single get/setter for domain scheduler parameters Ian Campbell
2012-05-31 13:51 ` George Dunlap
2012-05-31 15:15 ` Ian Jackson
2012-06-01 11:07 ` [PATCH 0 of 5 V2] libxl: make it possible to explicitly specify default sched params Ian Campbell
2012-06-01 18:08 ` Ian Jackson
2012-06-01 18:47 ` Ian Campbell
2012-06-01 19:14 ` Ian Campbell
2012-06-02 7:40 ` Ian Campbell
2012-06-02 6:37 ` Dario Faggioli
2012-06-02 7:41 ` Ian Campbell
2012-06-06 10:38 ` Ian Jackson
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=1338362793.2609.20.camel@Abyss \
--to=raistlin@linux.it \
--cc=George.Dunlap@citrix.com \
--cc=Ian.Jackson@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=juergen.gross@ts.fujitsu.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).