bitkeeper revision 1.1159.170.102 (41fa2751heRkQ76AYa9Oe-6cOyJuLw)

Enhanced SEDF scheduler
This commit is contained in:
sd386@font.cl.cam.ac.uk committed 2005-01-28 11:51:45 +00:00
1 parent a36ea62807
commit b1cbe136f6
9 files changed
+445 -158

No files matched your search

+28 -22
View File
@@ -791,15 +791,14 @@ static PyObject *pyxc_sedf_domain_set(PyObject *self,
{
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 @@ static PyObject *pyxc_sedf_domain_get(PyObject *self,
{
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 @@ static PyMethodDef pyxc_methods[] = {
(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 @@ static PyMethodDef pyxc_methods[] = {
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,
+7 -4
View File
@@ -273,11 +273,14 @@ class Xend:
'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),
+4 -4
View File
@@ -660,12 +660,12 @@ class XendDomain:
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))
+4 -1
View File
@@ -138,7 +138,10 @@ class SrvDomain(SrvDir):
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
+5 -5
View File
@@ -606,14 +606,14 @@ class ProgSedf(Prog):
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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.