WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Enhanced SEDF scheduler

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Enhanced SEDF scheduler
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Fri, 28 Jan 2005 11:51:45 +0000
Delivery-date: Mon, 09 May 2005 18:03:28 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1159.170.102, 2005/01/28 11:51:45+00:00, sd386@xxxxxxxxxxxxxxxxx

        Enhanced SEDF scheduler



 tools/libxc/xc.h                          |    4 
 tools/libxc/xc_sedf.c                     |   18 -
 tools/python/xen/lowlevel/xc/xc.c         |   50 +--
 tools/python/xen/xend/XendClient.py       |   11 
 tools/python/xen/xend/XendDomain.py       |    8 
 tools/python/xen/xend/server/SrvDomain.py |    5 
 tools/python/xen/xm/main.py               |   10 
 xen/common/sched_sedf.c                   |  494 +++++++++++++++++++++++-------
 xen/include/public/sched_ctl.h            |    5 
 9 files changed, 446 insertions(+), 159 deletions(-)


diff -Nru a/tools/libxc/xc.h b/tools/libxc/xc.h
--- a/tools/libxc/xc.h  2005-05-09 14:04:00 -04:00
+++ b/tools/libxc/xc.h  2005-05-09 14:04:00 -04:00
@@ -243,11 +243,11 @@
 
 int xc_sedf_domain_set(int xc_handle,
                           u32 domid,
-                          u64 period, u64 slice);
+                          u64 period, u64 slice, u64 latency, u16 extratime, 
u16 weight);
 
 int xc_sedf_domain_get(int xc_handle,
                           u32 domid,
-                          u64* period, u64 *slice);
+                          u64* period, u64 *slice, u64 *latency, u16 
*extratime, u16* weight);
 
 typedef evtchn_status_t xc_evtchn_status_t;
 
diff -Nru a/tools/libxc/xc_sedf.c b/tools/libxc/xc_sedf.c
--- a/tools/libxc/xc_sedf.c     2005-05-09 14:04:00 -04:00
+++ b/tools/libxc/xc_sedf.c     2005-05-09 14:04:00 -04:00
@@ -11,7 +11,7 @@
 #include "xc_private.h"
 
 int xc_sedf_domain_set(int xc_handle,
-                          u32 domid, u64 period, u64 slice)
+                          u32 domid, u64 period, u64 slice,u64 latency, u16 
extratime,u16 weight)
 {
     dom0_op_t op;
     struct sedf_adjdom *p = &op.u.adjustdom.u.sedf;
@@ -21,12 +21,15 @@
     op.u.adjustdom.sched_id = SCHED_SEDF;
     op.u.adjustdom.direction = SCHED_INFO_PUT;
 
-    p->period   = period;
-    p->slice    = slice;
+    p->period    = period;
+    p->slice     = slice;
+    p->latency   = latency;
+    p->extratime = extratime;
+    p->weight    = weight;
     return do_dom0_op(xc_handle, &op);
 }
 
-int xc_sedf_domain_get(int xc_handle, u32 domid, u64 *period, u64 *slice)
+int xc_sedf_domain_get(int xc_handle, u32 domid, u64 *period, u64 *slice, u64* 
latency, u16* extratime, u16* weight)
 {
     dom0_op_t op;
     int ret;
@@ -39,7 +42,10 @@
 
     ret = do_dom0_op(xc_handle, &op);
 
-    *period   = p->period;
-    *slice    = p->slice;
+    *period    = p->period;
+    *slice     = p->slice;
+    *latency   = p->latency;
+    *extratime = p->extratime;
+    *weight    = p->weight;
     return ret;
 }
diff -Nru a/tools/python/xen/lowlevel/xc/xc.c 
b/tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c 2005-05-09 14:04:00 -04:00
+++ b/tools/python/xen/lowlevel/xc/xc.c 2005-05-09 14:04:00 -04:00
@@ -791,15 +791,14 @@
 {
     XcObject *xc = (XcObject *)self;
     u32 domid;
-    u64 period, slice;
+    u64 period, slice, latency;
+    u16 extratime, weight;
+    static char *kwd_list[] = { "dom", "period", "slice", "latency", 
"extratime", "weight",NULL };
     
-    static char *kwd_list[] = { "dom", "period", "slice", NULL };
-    
-    if( !PyArg_ParseTupleAndKeywords(args, kwds, "iLL", kwd_list, &domid,
-                                     &period, &slice) )
+    if( !PyArg_ParseTupleAndKeywords(args, kwds, "iLLLhh", kwd_list, &domid,
+                                     &period, &slice, &latency, &extratime, 
&weight) )
         return NULL;
-   
-    if ( xc_sedf_domain_set(xc->xc_handle, domid, period, slice) != 0 )
+   if ( xc_sedf_domain_set(xc->xc_handle, domid, period, slice, latency, 
extratime,weight) != 0 )
         return PyErr_SetFromErrno(xc_error);
 
     Py_INCREF(zero);
@@ -812,21 +811,24 @@
 {
     XcObject *xc = (XcObject *)self;
     u32 domid;
-    u64 period, slice;
-        
+    u64 period, slice,latency;
+    u16 weight, extratime;
+    
     static char *kwd_list[] = { "dom", NULL };
 
     if( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &domid) )
         return NULL;
     
     if ( xc_sedf_domain_get( xc->xc_handle, domid, &period,
-                                &slice) )
+                                &slice,&latency,&extratime,&weight) )
         return PyErr_SetFromErrno(xc_error);
 
-    return Py_BuildValue("{s:i,s:L,s:L}",
-                         "domain",  domid,
-                         "period",  period,
-                         "slice",   slice);
+    return Py_BuildValue("{s:i,s:L,s:L,s:L,s:i}",
+                         "domain",    domid,
+                         "period",    period,
+                         "slice",     slice,
+                        "latency",   latency,
+                        "extratime", extratime);
 }
 
 static PyObject *pyxc_shadow_control(PyObject *self,
@@ -1068,9 +1070,11 @@
       (PyCFunction)pyxc_sedf_domain_set,
       METH_KEYWORDS, "\n"
       "Set the scheduling parameters for a domain when running with Atropos.\n"
-      " dom      [int]:  domain to set\n"
-      " period   [long]: domain's scheduling period\n"
-      " slice    [long]: domain's slice per period\n"
+      " dom       [int]:  domain to set\n"
+      " period    [long]: domain's scheduling period\n"
+      " slice     [long]: domain's slice per period\n"
+      " latency   [long]: domain's wakeup latency hint\n"
+      " extratime [int]:  domain aware of extratime?\n"
       "Returns: [int] 0 on success; -1 on error.\n" },
 
     { "sedf_domain_get",
@@ -1078,11 +1082,13 @@
       METH_KEYWORDS, "\n"
       "Get the current scheduling parameters for a domain when running with\n"
       "the Atropos scheduler."
-      " dom      [int]: domain to query\n"
-      "Returns:  [dict]\n"
-      " domain   [int]: domain ID\n"
-      " period   [long]: scheduler period\n"
-      " slice    [long]: CPU reservation per period\n"},
+      " dom       [int]: domain to query\n"
+      "Returns:   [dict]\n"
+      " domain    [int]: domain ID\n"
+      " period    [long]: scheduler period\n"
+      " slice     [long]: CPU reservation per period\n"
+      " latency   [long]: domain's wakeup latency hint\n"
+      " extratime [int]:  domain aware of extratime?\n"},
 
     { "evtchn_alloc_unbound", 
       (PyCFunction)pyxc_evtchn_alloc_unbound,
diff -Nru a/tools/python/xen/xend/XendClient.py 
b/tools/python/xen/xend/XendClient.py
--- a/tools/python/xen/xend/XendClient.py       2005-05-09 14:04:00 -04:00
+++ b/tools/python/xen/xend/XendClient.py       2005-05-09 14:04:00 -04:00
@@ -273,11 +273,14 @@
                               'latency' : latency,
                               'xtratime': xtratime })
 
-    def xend_domain_cpu_sedf_set(self, id, period, slice):
+    def xend_domain_cpu_sedf_set(self, id, period, slice, latency, extratime, 
weight):
         return self.xendPost(self.domainurl(id),
-                             {'op'      : 'cpu_sedf_set',
-                              'period'  : period,
-                              'slice'   : slice })
+                             {'op'        : 'cpu_sedf_set',
+                              'period'    : period,
+                              'slice'     : slice,
+                             'latency'   : latency,
+                             'extratime' : extratime,
+                             'weight'    : weight })
 
     def xend_domain_maxmem_set(self, id, memory):
         return self.xendPost(self.domainurl(id),
diff -Nru a/tools/python/xen/xend/XendDomain.py 
b/tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       2005-05-09 14:04:00 -04:00
+++ b/tools/python/xen/xend/XendDomain.py       2005-05-09 14:04:00 -04:00
@@ -660,12 +660,12 @@
         except Exception, ex:
             raise XendError(str(ex))
     
-    def domain_cpu_sedf_set(self, id, period, slice):
-        """Set Atropos scheduler parameters for a domain.
+    def domain_cpu_sedf_set(self, id, period, slice, latency, extratime, 
weight):
+        """Set Simple EDF scheduler parameters for a domain.
         """
-        dominfo = self.domain_lookup(id)
+       dominfo = self.domain_lookup(id)
         try:
-            return xc.sedf_domain_set(dominfo.dom, period, slice)
+            return xc.sedf_domain_set(dominfo.dom, period, slice, latency, 
extratime, weight)
         except Exception, ex:
             raise XendError(str(ex))
 
diff -Nru a/tools/python/xen/xend/server/SrvDomain.py 
b/tools/python/xen/xend/server/SrvDomain.py
--- a/tools/python/xen/xend/server/SrvDomain.py 2005-05-09 14:04:00 -04:00
+++ b/tools/python/xen/xend/server/SrvDomain.py 2005-05-09 14:04:00 -04:00
@@ -138,7 +138,10 @@
         fn = FormFn(self.xd.domain_cpu_sedf_set,
                     [['dom', 'str'],
                      ['period', 'int'],
-                     ['slice', 'int']])
+                     ['slice', 'int'],
+                    ['latency', 'int'],
+                    ['extratime', 'int'],
+                    ['weight', 'int']])
         val = fn(req.args, {'dom': self.dom.id})
         return val
 
diff -Nru a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       2005-05-09 14:04:00 -04:00
+++ b/tools/python/xen/xm/main.py       2005-05-09 14:04:00 -04:00
@@ -606,14 +606,14 @@
     info = """Set simple EDF parameters."""
 
     def help(self, args):
-        print args[0], "DOM PERIOD SLICE"
+        print args[0], "DOM PERIOD SLICE LATENCY EXTRATIME WEIGHT"
         print "\nSet simple EDF parameters."
 
     def main(self, args):
-        if len(args) != 4: self.err("%s: Invalid argument(s)" % args[0])
-        dom = args[1]
-        v = map(int, args[2:4])
-        server.xend_domain_cpu_sedf_set(dom, *v)
+       if len(args) != 7: self.err("%s: Invalid argument(s)" % args[0])
+       dom = args[1]
+       v = map(int, args[2:7])
+       server.xend_domain_cpu_sedf_set(dom, *v)
 
 xm.prog(ProgSedf)
 
diff -Nru a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c   2005-05-09 14:04:00 -04:00
+++ b/xen/common/sched_sedf.c   2005-05-09 14:04:00 -04:00
@@ -13,7 +13,7 @@
 #include <xen/time.h>
 #include <xen/slab.h>
 
-#define SEDFLEVEL 0
+#define SEDFLEVEL 2
 #define PRINT(_f, _a...)  \
 if ((_f)<=SEDFLEVEL) printk(_a );
 
@@ -26,50 +26,104 @@
 
 
 #define TRC_SEDF 0xBEEF0000
+#define EXTRA_NONE (0)
+#define EXTRA_AWARE (1)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Enhanced SEDF scheduler, BitKeeper Bot <=