Skip to contentSkip to conversation

add xl sched-credit2 sub command

PATCH In review Juergen Gross 2 participants 3 messages Nov 14, 2011 – Nov 24, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add xl sched-credit2 sub command

Adds the sched-credit2 sub command to xl.

Signed-off-by [email protected]
7 files changed, 184 insertions(+)
docs/man/xl.pod.1           |   20 ++++++++
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    |  100 +++++++++++++++++++++++++++++++++++++++++++
tools/libxl/xl_cmdtable.c   |    7 +++

# HG changeset patch
# User Juergen Gross <[email protected]> # Date 1321279498 -3600
# Node ID 123596ca8b29d3fd992284b3cbe31a3f28da56e5 # Parent 0844b17df7a9dd885e98e505f14fc99c1951b483 add xl sched-credit2 sub command

Adds the sched-credit2 sub command to xl.

Signed-off-by [email protected]
docs/man/xl.pod.1 +20 -0
diff -r 0844b17df7a9 -r 123596ca8b29 docs/man/xl.pod.1
@@ -607,6 +607,26 @@ no upper cap.
 
 =back
 
+=item B<sched-credit2> [ B<-d> I<domain-id> [ B<-w>[B<=>I<WEIGHT>] ] ]
+
+Set 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<PARAMETERS>
+
+=over 4
+
+=item I<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.
+
+=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 0844b17df7a9 -r 123596ca8b29 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 0844b17df7a9 -r 123596ca8b29 tools/libxl/libxl_types.idl
@@ -372,3 +372,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 0844b17df7a9 -r 123596ca8b29 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 +100 -0

112 lines not on this page · raw message

tools/libxl/xl_cmdtable.c +7 -0
diff -r 0844b17df7a9 -r 123596ca8b29 tools/libxl/xl_cmdtable.c
@@ -196,6 +196,13 @@ 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)"
+    },
+    { "sched-credit2",
+      &main_sched_credit2, 0,
+      "Get/set credit2 scheduler parameters",
+      "[-d <Domain> [-w[=WEIGHT]]]",
+      "-d DOMAIN, --domain=DOMAIN     Domain to modify\n"
+      "-w WEIGHT, --weight=WEIGHT     Weight (int)"
     },
     { "domid",
       &main_domid, 0,

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

#1 lore raw
Quoted 3 lines · Juergen Gross

Adds the sched-credit2 sub command to xl.

Signed-off-by [email protected]

Long options are missing (I just copied it from sched-credit).

I'll repost a revised version of this patch as part of a series including support of cpupools and sched-sedf.

Juergen

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
In reply to Juergen Gross

Juergen Gross writes ("[Xen-devel] [PATCH] add xl sched-credit2 sub command"):

Quoted 1 line

Adds the sched-credit2 sub command to xl.

Thanks, this looks like good stuff.

I have just one comment though. Can you try to limit the length of the lines ? When I see them in my 80-column windows they wrap. Try to keep it to 70-75 columns to allow for quoting, +/- prefixes, etc.

Thanks,
Ian.