Skip to contentSkip to conversation

xl scheduler support

PATCH In review Juergen Gross 3 participants 9 messages Nov 17, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xl scheduler support

This patch series enhances scheduler support of xl.

Patch 1: xl sched-credit: support long options
Patch 2: Support cpupools in xl sched-credit
Patch 3: Support of xl sched-credit2
Patch 4: Correct error message in libxl_sched_credit_domain_get() Patch 5: Support of xl sched-sedf

7 files changed, 622 insertions(+), 38 deletions(-)
docs/man/xl.pod.1           |   90 ++++++++-
tools/libxl/libxl.c         |  100 ++++++++++
tools/libxl/libxl.h         |    8 
tools/libxl/libxl_types.idl |   13 +
tools/libxl/xl.h            |    2 
tools/libxl/xl_cmdimpl.c    |  418 +++++++++++++++++++++++++++++++++++++++----
tools/libxl/xl_cmdtable.c   |   29 ++
#1 lore raw

PATCH 1/1 : sched-credit-options

Patch subject is complete summary.

2 files changed, 26 insertions(+), 7 deletions(-)
docs/man/xl.pod.1        |   15 ++++++++++-----
tools/libxl/xl_cmdimpl.c |   18 ++++++++++++++++--

# HG changeset patch
# User Juergen Gross <[email protected]> # Date 1321512799 -3600
# Node ID b83edf5a1c9483b908dacfb5e02033071c7aca3e # Parent fd3567cafe1c7ccd0ddba0ad7fb067d435e13529 [mq]: sched-credit-options

docs/man/xl.pod.1 +10 -5
diff -r fd3567cafe1c -r b83edf5a1c94 docs/man/xl.pod.1
@@ -579,25 +579,30 @@ default B<credit> is used for scheduling
 
 =over 4
 
-=item B<sched-credit> [ B<-d> I<domain-id> [ B<-w>[B<=>I<WEIGHT>] | B<-c>[B<=>I<CAP>] ] ]
+=item B<sched-credit> [I<OPTIONS>]
 
-Set credit scheduler parameters.  The credit scheduler is a
+Set or get credit scheduler parameters.  The credit scheduler is a
 proportional fair share CPU scheduler built from the ground up to be
 work conserving on SMP hosts.
 
 Each domain (including Domain0) is assigned a weight and a cap.
 
-B<PARAMETERS>
+B<OPTIONS>
 
 =over 4
 
-=item I<WEIGHT>
+=item B<-d DOMAIN>, B<--domain=DOMAIN>
+
+Specify domain for which scheduler parameters are to be modified or retrieved.
+Mandatory for modifying scheduler parameters.
+
+=item B<-w WEIGHT>, B<--weight=WEIGHT>
 
 A domain with a weight of 512 will get twice as much CPU as a domain
 with a weight of 256 on a contended host. Legal weights range from 1
 to 65535 and the default is 256.
 
-=item I<CAP>
+=item B<-c CAP>, B<--cap=CAP>
 
 The cap optionally fixes the maximum amount of CPU a domain will be
 able to consume, even if the host system has idle CPU cycles. The cap
tools/libxl/xl_cmdimpl.c +16 -2
diff -r fd3567cafe1c -r b83edf5a1c94 tools/libxl/xl_cmdimpl.c
@@ -3716,8 +3716,19 @@ int main_sched_credit(int argc, char **a
     const char *dom = NULL;
     int weight = 256, cap = 0, opt_w = 0, opt_c = 0;
     int opt, rc;
-
-    while ((opt = def_getopt(argc, argv, "d:w:c:", "sched-credit", 0)) != -1) {
+    int option_index = 0;
+    static struct option long_options[] = {
+        {"domain", 1, 0, 'd'},
+        {"weight", 1, 0, 'w'},
+        {"cap", 1, 0, 'c'},
+        {"help", 0, 0, 'h'},
+        {0, 0, 0, 0}
+    };
+
+    while (1) {
+        opt = getopt_long(argc, argv, "d:w:c:h", long_options, &option_index);
+        if (opt == -1)
+            break;
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -3732,6 +3743,9 @@ int main_sched_credit(int argc, char **a
             cap = strtol(optarg, NULL, 10);
             opt_c = 1;
             break;
+        case 'h':
+            help("sched-credit");
+            return 0;
         }
     }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw

PATCH 1/1 : sched-cpupools

In reply to Juergen Gross

Patch subject is complete summary.

5 files changed, 98 insertions(+), 30 deletions(-)
docs/man/xl.pod.1           |    4 +
tools/libxl/libxl.c         |    1 
tools/libxl/libxl_types.idl |    1 
tools/libxl/xl_cmdimpl.c    |  117 ++++++++++++++++++++++++++++++++-----------
tools/libxl/xl_cmdtable.c   |    5 +

# HG changeset patch
# User Juergen Gross <[email protected]> # Date 1321519012 -3600
# Node ID 8ce33d756b39abdcffc7a3ccc45f85c0a9a79ccd # Parent b83edf5a1c9483b908dacfb5e02033071c7aca3e [mq]: sched-cpupools

docs/man/xl.pod.1 +4 -0
diff -r b83edf5a1c94 -r 8ce33d756b39 docs/man/xl.pod.1
@@ -610,6 +610,10 @@ 50 is half a CPU, 400 is 4 CPUs, etc. Th
 50 is half a CPU, 400 is 4 CPUs, etc. The default, 0, means there is
 no upper cap.
 
+=item B<-p CPUPOOL>, B<--cpupool=CPUPOOL>
+
+Restrict output to domains in the specified cpupool.
+
 =back
 
 =back
tools/libxl/libxl.c +1 -0
diff -r b83edf5a1c94 -r 8ce33d756b39 tools/libxl/libxl.c
@@ -361,6 +361,7 @@ static void xcinfo2xlinfo(const xc_domai
     xlinfo->cpu_time = xcinfo->cpu_time;
     xlinfo->vcpu_max_id = xcinfo->max_vcpu_id;
     xlinfo->vcpu_online = xcinfo->nr_online_vcpus;
+    xlinfo->cpupool = xcinfo->cpupool;
 }
 
 libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain)
tools/libxl/libxl_types.idl +1 -0
diff -r b83edf5a1c94 -r 8ce33d756b39 tools/libxl/libxl_types.idl
@@ -109,6 +109,7 @@ SHUTDOWN_* constant."""),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
+    ("cpupool",     uint32),
     ], dispose_fn=None)
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
tools/libxl/xl_cmdimpl.c +89 -28

165 lines not on this page · raw message

tools/libxl/xl_cmdtable.c +3 -2
diff -r b83edf5a1c94 -r 8ce33d756b39 tools/libxl/xl_cmdtable.c
@@ -192,10 +192,11 @@ struct cmd_spec cmd_table[] = {
     { "sched-credit",
       &main_sched_credit, 0,
       "Get/set credit scheduler parameters",
-      "[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]]",
+      "[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-p CPUPOOL]",
       "-d DOMAIN, --domain=DOMAIN     Domain to modify\n"
       "-w WEIGHT, --weight=WEIGHT     Weight (int)\n"
-      "-c CAP, --cap=CAP              Cap (int)"
+      "-c CAP, --cap=CAP              Cap (int)\n"
+      "-p CPUPOOL, --cpupool=CPUPOOL  Restrict output to CPUPOOL"
     },
     { "domid",
       &main_domid, 0,

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw

PATCH 1/1 : sched-credit2

In reply to Juergen Gross

Patch subject is complete summary.

7 files changed, 213 insertions(+)
docs/man/xl.pod.1           |   29 ++++++++++
tools/libxl/libxl.c         |   48 +++++++++++++++++
tools/libxl/libxl.h         |    4 +
tools/libxl/libxl_types.idl |    4 +
tools/libxl/xl.h            |    1 
tools/libxl/xl_cmdimpl.c    |  119 +++++++++++++++++++++++++++++++++++++++++++
tools/libxl/xl_cmdtable.c   |    8 ++

# HG changeset patch
# User Juergen Gross <[email protected]> # Date 1321520185 -3600
# Node ID f88a51e4877548c6dc231ec1db409f84b6909816 # Parent 8ce33d756b39abdcffc7a3ccc45f85c0a9a79ccd [mq]: sched-credit2

docs/man/xl.pod.1 +29 -0
diff -r 8ce33d756b39 -r f88a51e48775 docs/man/xl.pod.1
@@ -616,6 +616,35 @@ Restrict output to domains in the specif
 
 =back
 
+=item B<sched-credit2> [I<OPTIONS>]
+
+Set or get credit2 scheduler parameters.  The credit2 scheduler is a
+proportional fair share CPU scheduler built from the ground up to be
+work conserving on SMP hosts.
+
+Each domain (including Domain0) is assigned a weight.
+
+B<OPTIONS>
+
+=over 4
+
+=item B<-d DOMAIN>, B<--domain=DOMAIN>
+
+Specify domain for which scheduler parameters are to be modified or retrieved.
+Mandatory for modifying scheduler parameters.
+
+=item B<-w WEIGHT>, B<--weight=WEIGHT>
+
+A domain with a weight of 512 will get twice as much CPU as a domain
+with a weight of 256 on a contended host. Legal weights range from 1
+to 65535 and the default is 256.
+
+=item B<-p CPUPOOL>, B<--cpupool=CPUPOOL>
+
+Restrict output to domains in the specified cpupool.
+
+=back
+
 =back
 
 =head1 CPUPOOLS COMMANDS
tools/libxl/libxl.c +48 -0

54 lines not on this page · raw message

tools/libxl/libxl.h +4 -0
diff -r 8ce33d756b39 -r f88a51e48775 tools/libxl/libxl.h
@@ -567,6 +567,10 @@ int libxl_sched_credit_domain_get(libxl_
                                   libxl_sched_credit *scinfo);
 int libxl_sched_credit_domain_set(libxl_ctx *ctx, uint32_t domid,
                                   libxl_sched_credit *scinfo);
+int libxl_sched_credit2_domain_get(libxl_ctx *ctx, uint32_t domid,
+                                   libxl_sched_credit2 *scinfo);
+int libxl_sched_credit2_domain_set(libxl_ctx *ctx, uint32_t domid,
+                                   libxl_sched_credit2 *scinfo);
 int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
                        char *trigger_name, uint32_t vcpuid);
 int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq);
tools/libxl/libxl_types.idl +4 -0
diff -r 8ce33d756b39 -r f88a51e48775 tools/libxl/libxl_types.idl
@@ -373,3 +373,7 @@ libxl_sched_credit = Struct("sched_credi
     ("weight", integer),
     ("cap", integer),
     ], dispose_fn=None)
+
+libxl_sched_credit2 = Struct("sched_credit2", [
+    ("weight", integer),
+    ], dispose_fn=None)
tools/libxl/xl.h +1 -0
diff -r 8ce33d756b39 -r f88a51e48775 tools/libxl/xl.h
@@ -55,6 +55,7 @@ int main_memmax(int argc, char **argv);
 int main_memmax(int argc, char **argv);
 int main_memset(int argc, char **argv);
 int main_sched_credit(int argc, char **argv);
+int main_sched_credit2(int argc, char **argv);
 int main_domid(int argc, char **argv);
 int main_domname(int argc, char **argv);
 int main_rename(int argc, char **argv);
tools/libxl/xl_cmdimpl.c +119 -0

131 lines not on this page · raw message

tools/libxl/xl_cmdtable.c +8 -0
diff -r 8ce33d756b39 -r f88a51e48775 tools/libxl/xl_cmdtable.c
@@ -196,6 +196,14 @@ struct cmd_spec cmd_table[] = {
       "-d DOMAIN, --domain=DOMAIN     Domain to modify\n"
       "-w WEIGHT, --weight=WEIGHT     Weight (int)\n"
       "-c CAP, --cap=CAP              Cap (int)\n"
+      "-p CPUPOOL, --cpupool=CPUPOOL  Restrict output to CPUPOOL"
+    },
+    { "sched-credit2",
+      &main_sched_credit2, 0,
+      "Get/set credit2 scheduler parameters",
+      "[-d <Domain> [-w[=WEIGHT]]] [-p CPUPOOL]",
+      "-d DOMAIN, --domain=DOMAIN     Domain to modify\n"
+      "-w WEIGHT, --weight=WEIGHT     Weight (int)\n"
       "-p CPUPOOL, --cpupool=CPUPOOL  Restrict output to CPUPOOL"
     },
     { "domid",

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw

PATCH 1/1 : sched-credit-errtxt

In reply to Juergen Gross

Patch subject is complete summary.

1 file changed, 1 insertion(+), 1 deletion(-)

tools/libxl/libxl.c | 2 +-

# HG changeset patch
# User Juergen Gross <[email protected]> # Date 1321520316 -3600
# Node ID 714852e181d3c1fdb1cde4f28a592110a9c7cf0d # Parent f88a51e4877548c6dc231ec1db409f84b6909816 [mq]: sched-credit-errtxt

tools/libxl/libxl.c +1 -1
diff -r f88a51e48775 -r 714852e181d3 tools/libxl/libxl.c
@@ -2679,7 +2679,7 @@ int libxl_sched_credit_domain_get(libxl_
 
     rc = xc_sched_credit_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
-        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting domain sched credit");
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain sched credit");
         return ERROR_FAIL;
     }
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#7 lore raw

PATCH 1/1 : sched-sedf

In reply to Juergen Gross

Patch subject is complete summary.

7 files changed, 284 insertions(+)
docs/man/xl.pod.1           |   42 +++++++++++
tools/libxl/libxl.c         |   49 ++++++++++++
tools/libxl/libxl.h         |    4 +
tools/libxl/libxl_types.idl |    8 ++
tools/libxl/xl.h            |    1 
tools/libxl/xl_cmdimpl.c    |  164 +++++++++++++++++++++++++++++++++++++++++++
tools/libxl/xl_cmdtable.c   |   16 ++++

# HG changeset patch
# User Juergen Gross <[email protected]> # Date 1321526262 -3600
# Node ID 0d1eb69dbd1c691b3bee9f95a40c5b000b3a8705 # Parent 714852e181d3c1fdb1cde4f28a592110a9c7cf0d [mq]: sched-sedf

docs/man/xl.pod.1 +42 -0
diff -r 714852e181d3 -r 0d1eb69dbd1c docs/man/xl.pod.1
@@ -645,6 +645,48 @@ Restrict output to domains in the specif
 
 =back
 
+=item B<sched-sedf> [I<OPTIONS>]
+
+Set or get Simple EDF (Earliest Deadline First) scheduler parameters. This
+scheduler provides weighted CPU sharing in an intuitive way and uses
+realtime-algorithms to ensure time guarantees.  For more information see
+docs/misc/sedf_scheduler_mini-HOWTO.txt in the Xen distribution.
+
+B<OPTIONS>
+
+=over 4
+
+=item B<-d DOMAIN>, B<--domain=DOMAIN>
+
+Specify domain for which scheduler parameters are to be modified or retrieved.
+Mandatory for modifying scheduler parameters.
+
+=item B<-p PERIOD>, B<--period=PERIOD>
+
+The normal EDF scheduling usage in milliseconds.
+
+=item B<-s SLICE>, B<--slice=SLICE>
+
+The normal EDF scheduling usage in milliseconds.
+
+=item B<-l LATENCY>, B<--latency=LATENCY>
+
+Scaled period if domain is doing heavy I/O.
+
+=item B<-e EXTRA>, B<--extra=EXTRA>
+
+Flag for allowing domain to run in extra time (0 or 1).
+
+=item B<-w WEIGHT>, B<--weight=WEIGHT>
+
+Another way of setting CPU slice.
+
+=item B<-c CPUPOOL>, B<--cpupool=CPUPOOL>
+
+Restrict output to domains in the specified cpupool.
+
+=back
+
 =back
 
 =head1 CPUPOOLS COMMANDS
tools/libxl/libxl.c +49 -0

55 lines not on this page · raw message

tools/libxl/libxl.h +4 -0
diff -r 714852e181d3 -r 0d1eb69dbd1c tools/libxl/libxl.h
@@ -571,6 +571,10 @@ int libxl_sched_credit2_domain_get(libxl
                                    libxl_sched_credit2 *scinfo);
 int libxl_sched_credit2_domain_set(libxl_ctx *ctx, uint32_t domid,
                                    libxl_sched_credit2 *scinfo);
+int libxl_sched_sedf_domain_get(libxl_ctx *ctx, uint32_t domid,
+                                libxl_sched_sedf *scinfo);
+int libxl_sched_sedf_domain_set(libxl_ctx *ctx, uint32_t domid,
+                                libxl_sched_sedf *scinfo);
 int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
                        char *trigger_name, uint32_t vcpuid);
 int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq);
tools/libxl/libxl_types.idl +8 -0
diff -r 714852e181d3 -r 0d1eb69dbd1c tools/libxl/libxl_types.idl
@@ -377,3 +377,11 @@ libxl_sched_credit2 = Struct("sched_cred
 libxl_sched_credit2 = Struct("sched_credit2", [
     ("weight", integer),
     ], dispose_fn=None)
+
+libxl_sched_sedf = Struct("sched_sedf", [
+    ("period", integer),
+    ("slice", integer),
+    ("latency", integer),
+    ("extratime", integer),
+    ("weight", integer),
+    ], dispose_fn=None)
tools/libxl/xl.h +1 -0
diff -r 714852e181d3 -r 0d1eb69dbd1c tools/libxl/xl.h
@@ -56,6 +56,7 @@ int main_memset(int argc, char **argv);
 int main_memset(int argc, char **argv);
 int main_sched_credit(int argc, char **argv);
 int main_sched_credit2(int argc, char **argv);
+int main_sched_sedf(int argc, char **argv);
 int main_domid(int argc, char **argv);
 int main_domname(int argc, char **argv);
 int main_rename(int argc, char **argv);
tools/libxl/xl_cmdimpl.c +164 -0

176 lines not on this page · raw message

tools/libxl/xl_cmdtable.c +16 -0
diff -r 714852e181d3 -r 0d1eb69dbd1c tools/libxl/xl_cmdtable.c
@@ -205,6 +205,22 @@ struct cmd_spec cmd_table[] = {
       "-d DOMAIN, --domain=DOMAIN     Domain to modify\n"
       "-w WEIGHT, --weight=WEIGHT     Weight (int)\n"
       "-p CPUPOOL, --cpupool=CPUPOOL  Restrict output to CPUPOOL"
+    },
+    { "sched-sedf",
+      &main_sched_sedf, 0,
+      "Get/set sedf scheduler parameters",
+      "[options]",
+      "-d DOMAIN, --domain=DOMAIN     Domain to modify\n"
+      "-p MS, --period=MS             Relative deadline(ms)\n"
+      "-s MS, --slice=MS              Worst-case execution time(ms). (slice <\n"
+      "                               period)\n"
+      "-l MS, --latency=MS            Scaled period (ms) when domain performs\n"
+      "                               heavy I/O\n"
+      "-e FLAG, --extra=FLAG          Flag (0 or 1) controls if domain can run\n"
+      "                               in extra time\n"
+      "-w FLOAT, --weight=FLOAT       CPU Period/slice (do not set with\n"
+      "                               --period/--slice)\n"
+      "-c CPUPOOL, --cpupool=CPUPOOL  Restrict output to CPUPOOL"
     },
     { "domid",
       &main_domid, 0,

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#8 lore raw
In reply to Juergen Gross

Please ignore, hg configuration problems!

Quoted 23 lines · Juergen Gross

This patch series enhances scheduler support of xl.

Patch 1: xl sched-credit: support long options
Patch 2: Support cpupools in xl sched-credit
Patch 3: Support of xl sched-credit2
Patch 4: Correct error message in libxl_sched_credit_domain_get() Patch 5: Support of xl sched-sedf

7 files changed, 622 insertions(+), 38 deletions(-)
docs/man/xl.pod.1           |   90 ++++++++-
tools/libxl/libxl.c         |  100 ++++++++++
tools/libxl/libxl.h         |    8
tools/libxl/libxl_types.idl |   13 +
tools/libxl/xl.h            |    2
tools/libxl/xl_cmdimpl.c    |  418 +++++++++++++++++++++++++++++++++++++++----
tools/libxl/xl_cmdtable.c   |   29 ++

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 5 lines
Juergen Gross                 Principal Developer Operating Systems
PDG ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: [email protected]
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html
#2 lore raw

Re: [PATCH 1 of 5] [mq]: sched-credit-options

In reply to Juergen Gross
Quoted 1 line · Juergen Gross

Patch subject is complete summary.

I think you've forgotten to qrefresh to pickup the real summary or something (for all mails).

Ian.

Quoted 7 lines

2 files changed, 26 insertions(+), 7 deletions(-)
docs/man/xl.pod.1        |   15 ++++++++++-----
tools/libxl/xl_cmdimpl.c |   18 ++++++++++++++++--
#3 lore raw

Re: [PATCH 1 of 5] [mq]: sched-credit-options

Quoted 6 lines · Ian Campbell
Quoted 1 line · Juergen Gross

Patch subject is complete summary.

I think you've forgotten to qrefresh to pickup the real summary or something (for all mails).

Ian.

Depending on which options you pass to patchbomb, you sometimes have to pop and push all before comments get picked up.

~Andrew (who will make an alteration to the relevant web page to this effect)

Quoted 12 lines
Quoted 6 lines
2 files changed, 26 insertions(+), 7 deletions(-)
docs/man/xl.pod.1        |   15 ++++++++++-----
tools/libxl/xl_cmdimpl.c |   18 ++++++++++++++++--

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 2 lines
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com