* [PATCH 0 of 2 v3] Sanity checking of scheduling parameters
@ 2012-06-08 9:08 Dario Faggioli
2012-06-08 9:08 ` [PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set Dario Faggioli
2012-06-08 9:08 ` [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters Dario Faggioli
0 siblings, 2 replies; 10+ messages in thread
From: Dario Faggioli @ 2012-06-08 9:08 UTC (permalink / raw)
To: xen-devel; +Cc: George Dunlap, Juergen Gross, Ian Jackson, Ian Campbell
Hi,
This small series achieves two goals:
- check the return value of libxl_domain_sched_params_set() in
libxl__build_post() and deal with the error, if that is the
case (patch #1);
- check and ensue we are passing along a meaningful set of sedf
scheduling parameters when they come directly from the config file
(patch #2)
Tested on both credit and sedf schedulers.
Changes from v2:
* actually propagate the error correctly instead of always returning
INVAL (in patch #1).
Changes from v1:
* patch #1: it was not there at all in v1! :-P
* patch #2: the if-s have been moved into an helper function. Also,
they only happen if the domain is actually being scheduled with
sedf (IanC, yes, I decided to do it... At the end of the day, it is
simple enough I think).
Thanks and 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)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set
2012-06-08 9:08 [PATCH 0 of 2 v3] Sanity checking of scheduling parameters Dario Faggioli
@ 2012-06-08 9:08 ` Dario Faggioli
2012-06-08 11:10 ` Ian Jackson
2012-06-08 9:08 ` [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters Dario Faggioli
1 sibling, 1 reply; 10+ messages in thread
From: Dario Faggioli @ 2012-06-08 9:08 UTC (permalink / raw)
To: xen-devel; +Cc: George Dunlap, Juergen Gross, Ian Jackson, Ian Campbell
So that the caller (e.g., libxl__build_post() ) knows and can deal with it.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -173,9 +173,11 @@ int libxl__build_post(libxl__gc *gc, uin
char *dom_path, *vm_path;
xs_transaction_t t;
char **ents, **hvm_ents;
- int i;
+ int i, rc;
- libxl_domain_sched_params_set(CTX, domid, &info->sched_params);
+ rc = libxl_domain_sched_params_set(CTX, domid, &info->sched_params);
+ if (rc)
+ return rc;
libxl_cpuid_apply_policy(ctx, domid);
if (info->cpuid != NULL)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters
2012-06-08 9:08 [PATCH 0 of 2 v3] Sanity checking of scheduling parameters Dario Faggioli
2012-06-08 9:08 ` [PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set Dario Faggioli
@ 2012-06-08 9:08 ` Dario Faggioli
2012-06-08 11:10 ` Ian Jackson
1 sibling, 1 reply; 10+ messages in thread
From: Dario Faggioli @ 2012-06-08 9:08 UTC (permalink / raw)
To: xen-devel; +Cc: George Dunlap, Juergen Gross, Ian Jackson, Ian Campbell
As it happens in the implementation of `xl sched-sedf -d ...', some
consistency checking is needed for the scheduling parameters when
they come from the config file.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -550,6 +550,31 @@ vcpp_out:
return rc;
}
+static int sched_params_valid(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;
+ libxl_domain_sched_params sci;
+
+ libxl_domain_sched_params_get(ctx, domid, &sci);
+
+ /* The sedf scheduler needs some more consistency checking */
+ if (sci.sched == LIBXL_SCHEDULER_SEDF) {
+ if (has_weight && (has_period || has_slice))
+ return 0;
+
+ if (has_weight) {
+ scp->slice = 0;
+ scp->period = 0;
+ }
+ if (has_period || has_slice)
+ scp->weight = 0;
+ }
+
+ return 1;
+}
+
static void parse_config_data(const char *config_source,
const char *config_data,
int config_len,
@@ -644,6 +669,10 @@ static void parse_config_data(const char
b_info->sched_params.latency = l;
if (!xlu_cfg_get_long (config, "extratime", &l, 0))
b_info->sched_params.extratime = l;
+ if (!sched_params_valid(&b_info->sched_params)) {
+ fprintf(stderr, "Invalid scheduling parameters\n");
+ exit(1);
+ }
if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
b_info->max_vcpus = l;
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters
2012-06-08 9:08 ` [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters Dario Faggioli
@ 2012-06-08 11:10 ` Ian Jackson
2012-06-08 11:11 ` George Dunlap
0 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2012-06-08 11:10 UTC (permalink / raw)
To: Dario Faggioli
Cc: George Dunlap, Juergen Gross, Ian Campbell,
xen-devel@lists.xen.org
Dario Faggioli writes ("[PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters"):
> As it happens in the implementation of `xl sched-sedf -d ...', some
> consistency checking is needed for the scheduling parameters when
> they come from the config file.
Thanks, I am happy with this from a libxl point of view. I would like
to see an ack from George from a scheduler point of view.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Thanks,
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set
2012-06-08 9:08 ` [PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set Dario Faggioli
@ 2012-06-08 11:10 ` Ian Jackson
0 siblings, 0 replies; 10+ messages in thread
From: Ian Jackson @ 2012-06-08 11:10 UTC (permalink / raw)
To: Dario Faggioli
Cc: George Dunlap, Juergen Gross, Ian Campbell,
xen-devel@lists.xen.org
Dario Faggioli writes ("[PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set"):
> So that the caller (e.g., libxl__build_post() ) knows and can deal with it.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters
2012-06-08 11:10 ` Ian Jackson
@ 2012-06-08 11:11 ` George Dunlap
2012-06-08 14:26 ` Ian Jackson
0 siblings, 1 reply; 10+ messages in thread
From: George Dunlap @ 2012-06-08 11:11 UTC (permalink / raw)
To: Ian Jackson
Cc: Juergen Gross, Dario Faggioli, Ian Campbell,
xen-devel@lists.xen.org
On 08/06/12 12:10, Ian Jackson wrote:
> Dario Faggioli writes ("[PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters"):
>> As it happens in the implementation of `xl sched-sedf -d ...', some
>> consistency checking is needed for the scheduling parameters when
>> they come from the config file.
> Thanks, I am happy with this from a libxl point of view. I would like
> to see an ack from George from a scheduler point of view.
I think Dario knows more about what sedf wants than I do; and since it
only does anything when the domain is using sedf, I think it's fine.
So FWIW:
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters
2012-06-08 11:11 ` George Dunlap
@ 2012-06-08 14:26 ` Ian Jackson
2012-06-12 14:58 ` Ian Campbell
0 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2012-06-08 14:26 UTC (permalink / raw)
To: George Dunlap
Cc: Juergen Gross, Dario Faggioli, Ian Campbell,
xen-devel@lists.xen.org
George Dunlap writes ("Re: [Xen-devel] [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters"):
> On 08/06/12 12:10, Ian Jackson wrote:
> > Dario Faggioli writes ("[PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters"):
> >> As it happens in the implementation of `xl sched-sedf -d ...', some
> >> consistency checking is needed for the scheduling parameters when
> >> they come from the config file.
> > Thanks, I am happy with this from a libxl point of view. I would like
> > to see an ack from George from a scheduler point of view.
> I think Dario knows more about what sedf wants than I do; and since it
> only does anything when the domain is using sedf, I think it's fine.
>
> So FWIW:
>
> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Great, thanks.
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters
2012-06-08 14:26 ` Ian Jackson
@ 2012-06-12 14:58 ` Ian Campbell
2012-06-14 15:06 ` [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters [and 1 more messages] Ian Jackson
0 siblings, 1 reply; 10+ messages in thread
From: Ian Campbell @ 2012-06-12 14:58 UTC (permalink / raw)
To: Ian Jackson
Cc: George Dunlap, Juergen Gross, Dario Faggioli,
xen-devel@lists.xen.org
On Fri, 2012-06-08 at 15:26 +0100, Ian Jackson wrote:
> George Dunlap writes ("Re: [Xen-devel] [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters"):
> > On 08/06/12 12:10, Ian Jackson wrote:
> > > Dario Faggioli writes ("[PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters"):
> > >> As it happens in the implementation of `xl sched-sedf -d ...', some
> > >> consistency checking is needed for the scheduling parameters when
> > >> they come from the config file.
> > > Thanks, I am happy with this from a libxl point of view. I would like
> > > to see an ack from George from a scheduler point of view.
> > I think Dario knows more about what sedf wants than I do; and since it
> > only does anything when the domain is using sedf, I think it's fine.
> >
> > So FWIW:
> >
> > Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
>
> Great, thanks.
>
> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Was it deliberate that you took this one but not the other patch from
this series of two, namely "libxl: propagete down the error from
libxl_domain_sched_params_set"?
Ian.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters [and 1 more messages]
2012-06-12 14:58 ` Ian Campbell
@ 2012-06-14 15:06 ` Ian Jackson
2012-06-14 15:13 ` Dario Faggioli
0 siblings, 1 reply; 10+ messages in thread
From: Ian Jackson @ 2012-06-14 15:06 UTC (permalink / raw)
To: Dario Faggioli, Ian Campbell
Cc: George Dunlap, Juergen Gross, xen-devel@lists.xen.org
Ian Campbell writes ("Re: [Xen-devel] [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters"):
> Was it deliberate that you took this one but not the other patch from
> this series of two, namely "libxl: propagete down the error from
> libxl_domain_sched_params_set"?
No, sorry.
Dario Faggioli writes ("[Xen-devel] [PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set"):
> So that the caller (e.g., libxl__build_post() ) knows and can deal with it.
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters [and 1 more messages]
2012-06-14 15:06 ` [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters [and 1 more messages] Ian Jackson
@ 2012-06-14 15:13 ` Dario Faggioli
0 siblings, 0 replies; 10+ messages in thread
From: Dario Faggioli @ 2012-06-14 15:13 UTC (permalink / raw)
To: Ian Jackson
Cc: George Dunlap, Juergen Gross, Ian Campbell,
xen-devel@lists.xen.org
[-- Attachment #1.1: Type: text/plain, Size: 954 bytes --]
On Thu, 2012-06-14 at 16:06 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-devel] [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters"):
> > Was it deliberate that you took this one but not the other patch from
> > this series of two, namely "libxl: propagete down the error from
> > libxl_domain_sched_params_set"?
>
> No, sorry.
>
> Dario Faggioli writes ("[Xen-devel] [PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set"):
> > So that the caller (e.g., libxl__build_post() ) knows and can deal with it.
>
> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
>
Cool. Thanks,
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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-06-14 15:13 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08 9:08 [PATCH 0 of 2 v3] Sanity checking of scheduling parameters Dario Faggioli
2012-06-08 9:08 ` [PATCH 1 of 2 v3] libxl: propagete down the error from libxl_domain_sched_params_set Dario Faggioli
2012-06-08 11:10 ` Ian Jackson
2012-06-08 9:08 ` [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters Dario Faggioli
2012-06-08 11:10 ` Ian Jackson
2012-06-08 11:11 ` George Dunlap
2012-06-08 14:26 ` Ian Jackson
2012-06-12 14:58 ` Ian Campbell
2012-06-14 15:06 ` [PATCH 2 of 2 v3] xl: check for meaningful combination of sedf config file parameters [and 1 more messages] Ian Jackson
2012-06-14 15:13 ` Dario Faggioli
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).