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-devel

Re: [Xen-devel] Re: [Xen-changelog] New weighted fair-share CPU schedule

To: Anthony Liguori <aliguori@xxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [Xen-changelog] New weighted fair-share CPU scheduler w/ automatic SMP load balancing
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Fri, 26 May 2006 21:13:29 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Emmanuel Ackaouy <ack@xxxxxxxxxxxxx>
Delivery-date: Fri, 26 May 2006 13:13:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4477241B.2070701@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E1Fjbdr-0005cU-OD@xxxxxxxxxxxxxxxxxxxxx> <4477241B.2070701@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Fri, May 26, 2006 at 10:51:55AM -0500, Anthony Liguori wrote:

> Just some random feedback.
> 
> Xen patchbot-unstable wrote:
> > 
> >+static PyObject *pyxc_csched_domain_set(XcObject *self,
> >+                                        PyObject *args,
> >+                                        PyObject *kwds)
> >+{
> >+    uint32_t domid;
> >+    uint16_t weight;
> >+    uint16_t cap;
> >+    static char *kwd_list[] = { "dom", "weight", "cap", NULL };
> >+    static char kwd_type[] = "I|HH";
> >+    struct csched_domain sdom;
> >+    
> >+    weight = 0;
> >+    cap = (uint16_t)~0U;
> >+    if( !PyArg_ParseTupleAndKeywords(args, kwds, kwd_type, kwd_list, 
> >+                                     &domid, &weight, &cap) )
> >+        return NULL;
> >+
> >+    sdom.weight = weight;
> >+    sdom.cap = cap;
> >+
> >+    if ( xc_csched_domain_set(self->xc_handle, domid, &sdom) != 0 )
> >+        return PyErr_SetFromErrno(xc_error);
> >+
> >+    Py_INCREF(zero);
> >+    return zero;
> >+}
> >  
> 
> It's always seemed odd that we return zero here instead of Py_RETURN_NONE.

Emmanuel will simply have followed the existing practice.  I agree that
there's no sense in what's there at the moment -- feel free to patch all of
these.

> > 
> >+    def domain_csched_get(self, domid):
> >+        """Get credit scheduler parameters for a domain.
> >+        """
> >+        dominfo = self.domain_lookup_by_name_or_id_nr(domid)
> >+        if not dominfo:
> >+            raise XendInvalidDomain(str(domid))
> >+        try:
> >+            return xc.csched_domain_get(dominfo.getDomid())
> >+        except Exception, ex:
> >+            raise XendError(str(ex))
> >+    
> >+    def domain_csched_set(self, domid, weight, cap):
> >+        """Set credit scheduler parameters for a domain.
> >+        """
> >+        dominfo = self.domain_lookup_by_name_or_id_nr(domid)
> >+        if not dominfo:
> >+            raise XendInvalidDomain(str(domid))
> >+        try:
> >+            return xc.csched_domain_set(dominfo.getDomid(), weight, cap)
> >+        except Exception, ex:
> >+            raise XendError(str(ex))
> >+
> >  
> 
> Please don't catch Exception.  The XML-RPC now properly propagates all 
> exceptions so there's no need to rewrap things in XendError.  Just let 
> the normal exception propagate.

Again, feel free to patch these in the existing code as well as
Emmanuel's new code.

> >diff -r b6937b931419 -r e539abd27a0f tools/python/xen/xm/main.py
> >--- a/tools/python/xen/xm/main.py    Fri May 26 09:44:29 2006 +0100
> >+++ b/tools/python/xen/xm/main.py    Fri May 26 11:14:36 2006 +0100
> >@@ -99,6 +99,7 @@ sched_sedf_help = "sched-sedf [DOM] [OPT
> >                                     specifies another way of setting a 
> >                                     domain's\n\
> >                                     cpu period/slice."
> > 
> >+csched_help = "csched                           Set or get credit 
> >scheduler parameters"
> > block_attach_help = """block-attach <DomId> <BackDev> <FrontDev> <Mode>
> >                 [BackDomId]         Create a new virtual block device"""
> > block_detach_help = """block-detach  <DomId> <DevId>    Destroy a 
> > domain's virtual block device,
> >@@ -174,6 +175,7 @@ host_commands = [
> >     ]
> > 
> > scheduler_commands = [
> >+    "csched",
> >     "sched-bvt",
> >     "sched-bvt-ctxallow",
> >     "sched-sedf",
> >@@ -735,6 +737,48 @@ def xm_sched_sedf(args):
> >         else:
> >             print_sedf(sedf_info)
> 
> Seem to be breaking naming convention here.  sched-csched may seem 
> redundant but that's what you get for choosing a non-descriptive name 
> for the scheduler in the first place ;-)

sched-credit seems appropriate.

Ewan.

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