bitkeeper revision 1.1389.5.37 (427f9fd5lvofpMsmBQ2h16fsuXQH6Q)

Manual merge.
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-05-09 17:37:25 +00:00
commit bb5ae6b5cc
15 files changed
+1929 -19

No files matched your search

+70
View File
@@ -827,6 +827,52 @@ static PyObject *pyxc_physinfo(PyObject *self,
"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)
@@ -1027,6 +1073,30 @@ static PyMethodDef pyxc_methods[] = {
" 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,
+9
View File
@@ -260,6 +260,15 @@ class Xend:
'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',
+18
View File
@@ -644,6 +644,24 @@ class XendDomain:
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.
+12
View File
@@ -107,6 +107,18 @@ class SrvDomain(SrvDir):
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,
[['dom', 'str'],
['period', 'int'],
['slice', 'int'],
['latency', 'int'],
['extratime', 'int'],
['weight', 'int']])
val = fn(req.args, {'dom': self.dom.id})
return val
def op_maxmem_set(self, op, req):
fn = FormFn(self.xd.domain_maxmem_set,
[['dom', 'str'],
+17
View File
@@ -591,6 +591,23 @@ class ProgBvtslice(Prog):
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"
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.