All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <raistlin@linux.it>
To: xen-devel@lists.xen.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: [PATCH] xl: improve the comments for sedf parameters checking
Date: Thu, 21 Jun 2012 16:19:50 +0200	[thread overview]
Message-ID: <fe85a8d600800524917c.1340288390@Solace> (raw)

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;

             reply	other threads:[~2012-06-21 14:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-21 14:19 Dario Faggioli [this message]
2012-06-29 16:29 ` [PATCH] xl: improve the comments for sedf parameters checking Ian Jackson
2012-06-29 18:42   ` Ian Campbell
2012-07-02 10:36     ` Ian Jackson
2012-07-03  6:17       ` 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=fe85a8d600800524917c.1340288390@Solace \
    --to=raistlin@linux.it \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.