mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
bitkeeper revision 1.1133 (410fb6c8BCfflcDT6Pjhr8MK2MOc2A)
The initial implementation of the warping in BVT
This commit is contained in:
1 parent
8721969492
commit
061160d30e
9 files changed
+173
-91
No files matched your search
@@ -435,18 +435,23 @@ static PyObject *pyxc_bvtsched_domain_set(PyObject *self,
|
||||
{
|
||||
XcObject *xc = (XcObject *)self;
|
||||
|
||||
u32 dom;
|
||||
unsigned long mcuadv, warp, warpl, warpu;
|
||||
u32 dom;
|
||||
u32 mcuadv;
|
||||
int warpback;
|
||||
s32 warpvalue;
|
||||
long long warpl;
|
||||
long long warpu;
|
||||
|
||||
static char *kwd_list[] = { "dom", "mcuadv", "warp", "warpl",
|
||||
"warpu", NULL };
|
||||
static char *kwd_list[] = { "dom", "mcuadv", "warpback", "warpvalue",
|
||||
"warpl", "warpu", NULL };
|
||||
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "illll", kwd_list,
|
||||
&dom, &mcuadv, &warp, &warpl, &warpu) )
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiill", kwd_list,
|
||||
&dom, &mcuadv, &warpback, &warpvalue,
|
||||
&warpl, &warpu) )
|
||||
return NULL;
|
||||
|
||||
if ( xc_bvtsched_domain_set(xc->xc_handle, dom, mcuadv,
|
||||
warp, warpl, warpu) != 0 )
|
||||
warpback, warpvalue, warpl, warpu) != 0 )
|
||||
return PyErr_SetFromErrno(xc_error);
|
||||
|
||||
Py_INCREF(zero);
|
||||
@@ -459,23 +464,28 @@ static PyObject *pyxc_bvtsched_domain_get(PyObject *self,
|
||||
{
|
||||
XcObject *xc = (XcObject *)self;
|
||||
u32 dom;
|
||||
unsigned long mcuadv, warp, warpl, warpu;
|
||||
u32 mcuadv;
|
||||
int warpback;
|
||||
s32 warpvalue;
|
||||
long long warpl;
|
||||
long long warpu;
|
||||
|
||||
static char *kwd_list[] = { "dom", NULL };
|
||||
|
||||
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &dom) )
|
||||
return NULL;
|
||||
|
||||
if ( xc_bvtsched_domain_get(xc->xc_handle, dom, &mcuadv, &warp,
|
||||
&warpl, &warpu) != 0 )
|
||||
if ( xc_bvtsched_domain_get(xc->xc_handle, dom, &mcuadv, &warpback,
|
||||
&warpvalue, &warpl, &warpu) != 0 )
|
||||
return PyErr_SetFromErrno(xc_error);
|
||||
|
||||
return Py_BuildValue("{s:i,s:l,s:l,s:l,s:l}",
|
||||
"domain", dom,
|
||||
"mcuadv", mcuadv,
|
||||
"warp", warp,
|
||||
"warpl", warpl,
|
||||
"warpu", warpu);
|
||||
"warpback", warpback,
|
||||
"warpvalue", warpvalue,
|
||||
"warpl", warpl,
|
||||
"warpu", warpu);
|
||||
}
|
||||
|
||||
static PyObject *pyxc_fbvtsched_global_set(PyObject *self,
|
||||
@@ -1040,12 +1050,13 @@ static PyMethodDef pyxc_methods[] = {
|
||||
(PyCFunction)pyxc_bvtsched_domain_set,
|
||||
METH_VARARGS | METH_KEYWORDS, "\n"
|
||||
"Set per-domain tuning parameters for Borrowed Virtual Time scheduler.\n"
|
||||
" dom [int]: Identifier of domain to be tuned.\n"
|
||||
" mcuadv [int]: Proportional to the inverse of the domain's weight.\n"
|
||||
" warp [int]: How far to warp domain's EVT on unblock.\n"
|
||||
" warpl [int]: How long the domain can run warped.\n"
|
||||
" warpu [int]: How long before the domain can warp again.\n\n"
|
||||
"Returns: [int] 0 on success; -1 on error.\n" },
|
||||
" dom [int]: Identifier of domain to be tuned.\n"
|
||||
" mcuadv [int]: Proportional to the inverse of the domain's weight.\n"
|
||||
" warpback [int]: Warp ? \n"
|
||||
" warpvalue [int]: How far to warp domain's EVT on unblock.\n"
|
||||
" warpl [int]: How long the domain can run warped.\n"
|
||||
" warpu [int]: How long before the domain can warp again.\n\n"
|
||||
"Returns: [int] 0 on success; -1 on error.\n" },
|
||||
|
||||
{ "bvtsched_domain_get",
|
||||
(PyCFunction)pyxc_bvtsched_domain_get,
|
||||
|
||||
@@ -490,13 +490,14 @@ class Xend:
|
||||
{'op' : 'pincpu',
|
||||
'cpu' : cpu })
|
||||
|
||||
def xend_domain_cpu_bvt_set(self, id, mcuadv, warp, warpl, warpu):
|
||||
def xend_domain_cpu_bvt_set(self, id, mcuadv, warpback, warpvalue, warpl, warpu):
|
||||
return self.xendPost(self.domainurl(id),
|
||||
{'op' : 'cpu_bvt_set',
|
||||
'mcuadv' : mcuadv,
|
||||
'warp' : warp,
|
||||
'warpl' : warpl,
|
||||
'warpu' : warpu })
|
||||
{'op' : 'cpu_bvt_set',
|
||||
'mcuadv' : mcuadv,
|
||||
'warpback' : warpback,
|
||||
'warpvalue': warpvalue,
|
||||
'warpl' : warpl,
|
||||
'warpu' : warpu })
|
||||
|
||||
def xend_domain_cpu_fbvt_set(self, id, mcuadv, warp, warpl, warpu):
|
||||
return self.xendPost(self.domainurl(id),
|
||||
|
||||
@@ -592,13 +592,14 @@ class XendDomain:
|
||||
except Exception, ex:
|
||||
raise XendError(str(ex))
|
||||
|
||||
def domain_cpu_bvt_set(self, id, mcuadv, warp, warpl, warpu):
|
||||
def domain_cpu_bvt_set(self, id, mcuadv, warpback, warpvalue, warpl, warpu):
|
||||
"""Set BVT (Borrowed Virtual Time) scheduler parameters for a domain.
|
||||
"""
|
||||
dominfo = self.domain_lookup(id)
|
||||
try:
|
||||
return xc.bvtsched_domain_set(dom=dominfo.dom, mcuadv=mcuadv,
|
||||
warp=warp, warpl=warpl, warpu=warpu)
|
||||
warpback=warpback, warpvalue=warpvalue,
|
||||
warpl=warpl, warpu=warpu)
|
||||
except Exception, ex:
|
||||
raise XendError(str(ex))
|
||||
|
||||
|
||||
@@ -110,7 +110,8 @@ class SrvDomain(SrvDir):
|
||||
fn = FormFn(self.xd.domain_cpu_bvt_set,
|
||||
[['dom', 'str'],
|
||||
['mcuadv', 'int'],
|
||||
['warp', 'int'],
|
||||
['warpback', 'int'],
|
||||
['warpvalue', 'int'],
|
||||
['warpl', 'int'],
|
||||
['warpu', 'int']])
|
||||
val = fn(req.args, {'dom': self.dom.name})
|
||||
|
||||
@@ -492,12 +492,12 @@ class ProgBvt(Prog):
|
||||
info = """Set BVT scheduler parameters."""
|
||||
|
||||
def help(self, args):
|
||||
print args[0], "DOM MCUADV WARP WARPL WARPU"
|
||||
print args[0], "DOM MCUADV WARPBACK WARPVALUE WARPL WARPU"
|
||||
print '\nSet Borrowed Virtual Time scheduler parameters.'
|
||||
|
||||
def main(self, args):
|
||||
if len(args) != 6: self.err("%s: Invalid argument(s)" % args[0])
|
||||
v = map(int, args[1:6])
|
||||
if len(args) != 7: self.err("%s: Invalid argument(s)" % args[0])
|
||||
v = map(int, args[1:7])
|
||||
server.xend_domain_cpu_bvt_set(*v)
|
||||
|
||||
xm.prog(ProgBvt)
|
||||
|
||||