[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxc: Implement SCHEDOP sysctl for credit scheduler



# HG changeset patch
# User George Dunlap <george.dunlap@xxxxxxxxxxxxx>
# Date 1329992270 0
# Node ID 5b9d4bd3addf494d51259f6dde7bf2db751a341f
# Parent  dd9e8f1ebed1100fad2c01ff977ab66ff96d90b2
libxc: Implement SCHEDOP sysctl for credit scheduler

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
---


diff -r dd9e8f1ebed1 -r 5b9d4bd3addf tools/libxc/xc_csched.c
--- a/tools/libxc/xc_csched.c   Thu Feb 23 10:17:21 2012 +0000
+++ b/tools/libxc/xc_csched.c   Thu Feb 23 10:17:50 2012 +0000
@@ -61,3 +61,47 @@
 
     return err;
 }
+
+int
+xc_sched_credit_params_set(
+    xc_interface *xch,
+    uint32_t cpupool_id,
+    struct xen_sysctl_credit_schedule *schedule)
+{
+    int rc;
+    DECLARE_SYSCTL;
+
+    sysctl.cmd = XEN_SYSCTL_scheduler_op;
+    sysctl.u.scheduler_op.cpupool_id = cpupool_id;
+    sysctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT;
+    sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_putinfo;
+
+    sysctl.u.scheduler_op.u.sched_credit = *schedule;
+
+    rc = do_sysctl(xch, &sysctl);
+
+    *schedule = sysctl.u.scheduler_op.u.sched_credit;
+
+    return rc;
+}
+
+int
+xc_sched_credit_params_get(
+    xc_interface *xch,
+    uint32_t cpupool_id,
+    struct xen_sysctl_credit_schedule *schedule)
+{
+    int rc;
+    DECLARE_SYSCTL;
+
+    sysctl.cmd = XEN_SYSCTL_scheduler_op;
+    sysctl.u.scheduler_op.cpupool_id = cpupool_id;
+    sysctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT;
+    sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_getinfo;
+
+    rc = do_sysctl(xch, &sysctl);
+
+    *schedule = sysctl.u.scheduler_op.u.sched_credit;
+
+    return rc;
+}
diff -r dd9e8f1ebed1 -r 5b9d4bd3addf tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Thu Feb 23 10:17:21 2012 +0000
+++ b/tools/libxc/xenctrl.h     Thu Feb 23 10:17:50 2012 +0000
@@ -668,7 +668,12 @@
 int xc_sched_credit_domain_get(xc_interface *xch,
                                uint32_t domid,
                                struct xen_domctl_sched_credit *sdom);
-
+int xc_sched_credit_params_set(xc_interface *xch,
+                              uint32_t cpupool_id,
+                              struct xen_sysctl_credit_schedule *schedule);
+int xc_sched_credit_params_get(xc_interface *xch,
+                              uint32_t cpupool_id,
+                              struct xen_sysctl_credit_schedule *schedule);
 int xc_sched_credit2_domain_set(xc_interface *xch,
                                uint32_t domid,
                                struct xen_domctl_sched_credit2 *sdom);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.