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] manual merge

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] manual merge
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Thu, 21 Apr 2005 01:42:29 +0000
Delivery-date: Mon, 09 May 2005 18:06:29 +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.1346.1.1, 2005/04/21 02:42:29+01:00, iap10@xxxxxxxxxxxxxxxxxxxxx

        manual merge



 tools/libxc/Makefile                      |    1 
 tools/libxc/xc.h                          |    8 
 tools/python/xen/lowlevel/xc/xc.c         |   70 ++++++
 tools/python/xen/xend/XendClient.py       |    9 
 tools/python/xen/xend/XendDomain.py       |   18 +
 tools/python/xen/xend/server/SrvDomain.py |   26 +-
 tools/python/xen/xm/main.py               |   17 +
 xen/common/schedule.c                     |  304 +++++++++++++++++-------------
 xen/include/public/sched_ctl.h            |   40 ++-
 xen/include/xen/sched-if.h                |    9 
 10 files changed, 349 insertions(+), 153 deletions(-)


diff -Nru a/tools/libxc/Makefile b/tools/libxc/Makefile
--- a/tools/libxc/Makefile      2005-05-09 14:07:00 -04:00
+++ b/tools/libxc/Makefile      2005-05-09 14:07:00 -04:00
@@ -16,6 +16,7 @@
 INCLUDES += -I $(XEN_LIBXUTIL)
 
 SRCS     :=
+SRCS     += xc_sedf.c
 SRCS     += xc_bvtsched.c
 SRCS     += xc_domain.c
 SRCS     += xc_evtchn.c
diff -Nru a/tools/libxc/xc.h b/tools/libxc/xc.h
--- a/tools/libxc/xc.h  2005-05-09 14:07:00 -04:00
+++ b/tools/libxc/xc.h  2005-05-09 14:07:00 -04:00
@@ -257,6 +257,14 @@
                            long long *warpl,
                            long long *warpu);
 
+int xc_sedf_domain_set(int xc_handle,
+                          u32 domid,
+                          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 *latency, u16 
*extratime, u16* weight);
+
 typedef evtchn_status_t xc_evtchn_status_t;
 
 /*
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:07:00 -04:00
+++ b/tools/python/xen/lowlevel/xc/xc.c 2005-05-09 14:07:00 -04:00
@@ -800,6 +800,52 @@
                          "cpu_khz",     info.cpu_khz);
 }
 
+static PyObject *pyxc_sedf_domain_set(PyObject *self,
+                                         PyObject *args,
+                                         PyObject *kwds)
+{
+    XcObject *xc = (XcObject *)self;
+    u32 domid;
+    u64 period, slice, latency;
+    u16 extratime, weight;
+    static char *kwd_list[] = { "dom", "period", "slice", "latency", 
"extratime", "weight",NULL };
+    
+    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, latency, 
extratime,weight) != 0 )
+        return PyErr_SetFromErrno(xc_error);
+
+    Py_INCREF(zero);
+    return zero;
+}
+
+static PyObject *pyxc_sedf_domain_get(PyObject *self,
+                                         PyObject *args,
+                                         PyObject *kwds)
+{
+    XcObject *xc = (XcObject *)self;
+    u32 domid;
+    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,&latency,&extratime,&weight) )
+        return PyErr_SetFromErrno(xc_error);
+
+    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,
                                      PyObject *args,
                                      PyObject *kwds)
@@ -992,6 +1038,30 @@
       " warpu  [long]: Unwarp requirement.\n"
       " warpl  [long]: Warp limit,\n"
     },
+    
+    { "sedf_domain_set",
+      (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"
+      " 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",
+      (PyCFunction)pyxc_sedf_domain_get,
+      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"
+      " 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:07:00 -04:00
+++ b/tools/python/xen/xend/XendClient.py       2005-05-09 14:07:00 -04:00
@@ -260,6 +260,15 @@
                               'warpl'    : warpl,
                               'warpu'    : warpu })
 
+    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,
+                             'latency'   : latency,
+                             'extratime' : extratime,
+                             'weight'    : weight })
+
     def xend_domain_maxmem_set(self, id, memory):
         return self.xendPost(self.domainurl(id),
                              { 'op'     : 'maxmem_set',
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:07:00 -04:00
+++ b/tools/python/xen/xend/XendDomain.py       2005-05-09 14:07:00 -04:00
@@ -642,6 +642,24 @@
         except Exception, ex:
             raise XendError(str(ex))
     
+    
+    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)
+        try:
+            return xc.sedf_domain_set(dominfo.dom, period, slice, latency, 
extratime, weight)
+        except Exception, ex:
+            raise XendError(str(ex))
+
+    def domain_cpu_sedf_get(self, id):
+        """Get Atropos scheduler parameters for a domain.
+        """
+        dominfo = self.domain_lookup(id)
+        try:
+            return xc.sedf_domain_get(dominfo.dom)
+        except Exception, ex:
+            raise XendError(str(ex))
     def domain_device_create(self, id, devconfig):
         """Create a new device for a domain.
 
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:07:00 -04:00
+++ b/tools/python/xen/xend/server/SrvDomain.py 2005-05-09 14:07:00 -04:00
@@ -107,15 +107,6 @@
         val = fn(req.args, {'dom': self.dom.id})
         return val
     
-    def op_cpu_atropos_set(self, op, req):
-        fn = FormFn(self.xd.domain_cpu_atropos_set,
-                    [['dom', 'str'],
-                     ['period', 'int'],
-                     ['slice', 'int'],
-                     ['latency', 'int'],
-                     ['xtratime', 'int']])
-        val = fn(req.args, {'dom': self.dom.id})
-        return val
     
     def op_cpu_sedf_set(self, op, req):
         fn = FormFn(self.xd.domain_cpu_sedf_set,
@@ -142,6 +133,14 @@
         d = fn(req.args, {'dom': self.dom.id})
         return d
 
+    def op_device_refresh(self, op, req):
+        fn = FormFn(self.xd.domain_device_refresh,
+                    [['dom', 'str'],
+                     ['type', 'str'],
+                     ['idx', 'str']])
+        val = fn(req.args, {'dom': self.dom.id})
+        return val
+
     def op_device_destroy(self, op, req):
         fn = FormFn(self.xd.domain_device_destroy,
                     [['dom', 'str'],
@@ -157,6 +156,15 @@
                      ['idx', 'str']])
         d = fn(req.args, {'dom': self.dom.id})
         return d
+
+    def op_vif_credit_limit(self, op, req):
+        fn = FormFn(self.xd.domain_vif_credit_limit,
+                    [['dom', 'str'],
+                     ['vif', 'int'],
+                     ['credit', 'int'],
+                     ['period', 'int']])
+        val = fn(req.args, {'dom': self.dom.id})
+        return val
 
     def op_vifs(self, op, req):
         devs = self.xd.domain_vif_ls(self.dom.id)
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:07:00 -04:00
+++ b/tools/python/xen/xm/main.py       2005-05-09 14:07:00 -04:00
@@ -591,6 +591,23 @@
 
 xm.prog(ProgBvtslice)
 
+class ProgSedf(Prog):
+    group = 'scheduler'
+    name= "sedf"
+    info = """Set simple EDF parameters."""
+
+    def help(self, args):
+        print args[0], "DOM PERIOD SLICE LATENCY EXTRATIME WEIGHT"
+        print "\nSet simple EDF parameters."
+
+    def main(self, args):
+       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)
+
 class ProgInfo(Prog):
     group = 'host'
     name = "info"
diff -Nru a/xen/common/schedule.c b/xen/common/schedule.c
--- a/xen/common/schedule.c     2005-05-09 14:07:00 -04:00
+++ b/xen/common/schedule.c     2005-05-09 14:07:00 -04:00
@@ -1,5 +1,4 @@
-/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
- ****************************************************************************
+/****************************************************************************
  * (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge
  * (C) 2002-2003 University of Cambridge
  * (C) 2004      - Mark Williamson - Intel Research Cambridge

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] manual merge, BitKeeper Bot <=