xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xl: improve the comments for sedf parameters checking
@ 2012-06-21 14:19 Dario Faggioli
  2012-06-29 16:29 ` Ian Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Dario Faggioli @ 2012-06-21 14:19 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

As agreed during review of what has become 513d5e196e23.

No real functional changes.

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
@@ -565,28 +565,40 @@ static int sched_params_valid(libxl_doma
     if (sci.sched == 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 not specify a weight,
-         * that means we want a pure best effort domain or an actual
-         * real-time one. In the former case, it is period that needs
-         * to be zero, in the latter, weight should be.
+         * 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) {
-            /* We can setup a proper best effort domain (extra time only)
-             * iff we either already have or are asking for some extra time. */
+            /* 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.
+             */
             scp->weight = has_extratime ? scp->extratime : sci.extratime;
             scp->period = 0;
-        }
-        if (has_period && has_slice)
+        } else {
+            /* Real-time domain: will get slice CPU time over every period */
             scp->weight = 0;
+       }
     }
 
     return 1;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xl: improve the comments for sedf parameters checking
  2012-06-21 14:19 [PATCH] xl: improve the comments for sedf parameters checking Dario Faggioli
@ 2012-06-29 16:29 ` Ian Jackson
  2012-06-29 18:42   ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2012-06-29 16:29 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: Ian Campbell, xen-devel

Dario Faggioli writes ("[Xen-devel] [PATCH] xl: improve the comments for sedf parameters checking"):
> As agreed during review of what has become 513d5e196e23.

Thanks.  I'm afraid it doesn't apply to tip though.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xl: improve the comments for sedf parameters checking
  2012-06-29 16:29 ` Ian Jackson
@ 2012-06-29 18:42   ` Ian Campbell
  2012-07-02 10:36     ` Ian Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2012-06-29 18:42 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Dario Faggioli, xen-devel@lists.xen.org

On Fri, 2012-06-29 at 17:29 +0100, Ian Jackson wrote:
> Dario Faggioli writes ("[Xen-devel] [PATCH] xl: improve the comments for sedf parameters checking"):
> > As agreed during review of what has become 513d5e196e23.
> 
> Thanks.  I'm afraid it doesn't apply to tip though.

This code got moved to libxl while we were trying to fixup this stuff
and the equivalent to this patch was applied to libxl as part of
25494:836db8c4b9f9 "libxl: fix validation of scheduling parameters for
sedf".

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xl: improve the comments for sedf parameters checking
  2012-06-29 18:42   ` Ian Campbell
@ 2012-07-02 10:36     ` Ian Jackson
  2012-07-03  6:17       ` Dario Faggioli
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2012-07-02 10:36 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Dario Faggioli, xen-devel@lists.xen.org

Ian Campbell writes ("Re: [Xen-devel] [PATCH] xl: improve the comments for sedf parameters	checking"):
> On Fri, 2012-06-29 at 17:29 +0100, Ian Jackson wrote:
> > Dario Faggioli writes ("[Xen-devel] [PATCH] xl: improve the comments for sedf parameters checking"):
> > > As agreed during review of what has become 513d5e196e23.
> > 
> > Thanks.  I'm afraid it doesn't apply to tip though.
> 
> This code got moved to libxl while we were trying to fixup this stuff
> and the equivalent to this patch was applied to libxl as part of
> 25494:836db8c4b9f9 "libxl: fix validation of scheduling parameters for
> sedf".

Oh good.

Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xl: improve the comments for sedf parameters checking
  2012-07-02 10:36     ` Ian Jackson
@ 2012-07-03  6:17       ` Dario Faggioli
  0 siblings, 0 replies; 5+ messages in thread
From: Dario Faggioli @ 2012-07-03  6:17 UTC (permalink / raw)
  To: Ian Jackson; +Cc: Ian Campbell, xen-devel@lists.xen.org


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

On Mon, 2012-07-02 at 11:36 +0100, Ian Jackson wrote: 
> Ian Campbell writes ("Re: [Xen-devel] [PATCH] xl: improve the comments for sedf parameters	checking"):
> > On Fri, 2012-06-29 at 17:29 +0100, Ian Jackson wrote:
> > > Dario Faggioli writes ("[Xen-devel] [PATCH] xl: improve the comments for sedf parameters checking"):
> > > > As agreed during review of what has become 513d5e196e23.
> > > 
> > > Thanks.  I'm afraid it doesn't apply to tip though.
> > 
> > This code got moved to libxl while we were trying to fixup this stuff
> > and the equivalent to this patch was applied to libxl as part of
> > 25494:836db8c4b9f9 "libxl: fix validation of scheduling parameters for
> > sedf".
> 
Indeed. :-)

> Oh good.
> 
Yep, sorry for not having replied soon, I was on leave from Firday
afternoon to yesterday (included).

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)



[-- 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] 5+ messages in thread

end of thread, other threads:[~2012-07-03  6:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-21 14:19 [PATCH] xl: improve the comments for sedf parameters checking Dario Faggioli
2012-06-29 16:29 ` Ian Jackson
2012-06-29 18:42   ` Ian Campbell
2012-07-02 10:36     ` Ian Jackson
2012-07-03  6:17       ` 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).