direct-io.hg

changeset 2058:1ac7603a60bd

bitkeeper revision 1.1133 (410fb6c8BCfflcDT6Pjhr8MK2MOc2A)

The initial implementation of the warping in BVT
author gm281@boulderdash.cl.cam.ac.uk
date Tue Aug 03 16:01:12 2004 +0000 (2004-08-03)
parents bd7b8d136aba
children 539c0e6f0384
files tools/libxc/xc.h tools/libxc/xc_bvtsched.c tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/XendClient.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/server/SrvDomain.py tools/python/xen/xm/main.py xen/common/sched_bvt.c xen/include/hypervisor-ifs/sched_ctl.h
line diff
     1.1 --- a/tools/libxc/xc.h	Tue Aug 03 15:29:44 2004 +0000
     1.2 +++ b/tools/libxc/xc.h	Tue Aug 03 16:01:12 2004 +0000
     1.3 @@ -98,20 +98,22 @@ int xc_bvtsched_global_set(int xc_handle
     1.4  
     1.5  int xc_bvtsched_domain_set(int xc_handle,
     1.6                             u32 domid,
     1.7 -                           unsigned long mcuadv,
     1.8 -                           unsigned long warp,
     1.9 -                           unsigned long warpl,
    1.10 -                           unsigned long warpu);
    1.11 +                           u32 mcuadv,
    1.12 +                           int warpback,
    1.13 +                           s32 warpvalue,
    1.14 +                           long long warpl,
    1.15 +                           long long warpu);
    1.16  
    1.17  int xc_bvtsched_global_get(int xc_handle,
    1.18                             unsigned long *ctx_allow);
    1.19  
    1.20  int xc_bvtsched_domain_get(int xc_handle,
    1.21                             u32 domid,
    1.22 -                           unsigned long *mcuadv,
    1.23 -                           unsigned long *warp,
    1.24 -                           unsigned long *warpl,
    1.25 -                           unsigned long *warpu);
    1.26 +                           u32 *mcuadv,
    1.27 +                           int *warpback,
    1.28 +                           s32 *warpvalue,
    1.29 +                           long long *warpl,
    1.30 +                           long long *warpu);
    1.31  
    1.32  int xc_fbvtsched_global_set(int xc_handle,
    1.33                             unsigned long ctx_allow);
     2.1 --- a/tools/libxc/xc_bvtsched.c	Tue Aug 03 15:29:44 2004 +0000
     2.2 +++ b/tools/libxc/xc_bvtsched.c	Tue Aug 03 16:01:12 2004 +0000
     2.3 @@ -40,10 +40,11 @@ int xc_bvtsched_global_get(int xc_handle
     2.4  
     2.5  int xc_bvtsched_domain_set(int xc_handle,
     2.6                             u32 domid,
     2.7 -                           unsigned long mcuadv,
     2.8 -                           unsigned long warp,
     2.9 -                           unsigned long warpl,
    2.10 -                           unsigned long warpu)
    2.11 +                           u32 mcuadv,
    2.12 +                           int warpback,
    2.13 +                           s32 warpvalue,
    2.14 +                           long long warpl,
    2.15 +                           long long warpu)
    2.16  {
    2.17      dom0_op_t op;
    2.18      struct bvt_adjdom *bvtadj = &op.u.adjustdom.u.bvt;
    2.19 @@ -53,20 +54,22 @@ int xc_bvtsched_domain_set(int xc_handle
    2.20      op.u.adjustdom.sched_id = SCHED_BVT;
    2.21      op.u.adjustdom.direction = SCHED_INFO_PUT;
    2.22  
    2.23 -    bvtadj->mcu_adv = mcuadv;
    2.24 -    bvtadj->warp    = warp;
    2.25 -    bvtadj->warpl   = warpl;
    2.26 -    bvtadj->warpu   = warpu;
    2.27 +    bvtadj->mcu_adv     = mcuadv;
    2.28 +    bvtadj->warpback    = warpback;
    2.29 +    bvtadj->warpvalue   = warpvalue;
    2.30 +    bvtadj->warpl       = warpl;
    2.31 +    bvtadj->warpu       = warpu;
    2.32      return do_dom0_op(xc_handle, &op);
    2.33  }
    2.34  
    2.35  
    2.36  int xc_bvtsched_domain_get(int xc_handle,
    2.37                             u32 domid,
    2.38 -                           unsigned long *mcuadv,
    2.39 -                           unsigned long *warp,
    2.40 -                           unsigned long *warpl,
    2.41 -                           unsigned long *warpu)
    2.42 +                           u32 *mcuadv,
    2.43 +                           int *warpback,
    2.44 +                           s32 *warpvalue,
    2.45 +                           long long *warpl,
    2.46 +                           long long *warpu)
    2.47  {
    2.48      
    2.49      dom0_op_t op;
    2.50 @@ -80,9 +83,10 @@ int xc_bvtsched_domain_get(int xc_handle
    2.51  
    2.52      ret = do_dom0_op(xc_handle, &op);
    2.53  
    2.54 -    *mcuadv = adjptr->mcu_adv;
    2.55 -    *warp   = adjptr->warp;
    2.56 -    *warpl  = adjptr->warpl;
    2.57 -    *warpu  = adjptr->warpu;
    2.58 +    *mcuadv     = adjptr->mcu_adv;
    2.59 +    *warpback   = adjptr->warpback;
    2.60 +    *warpvalue  = adjptr->warpvalue;
    2.61 +    *warpl      = adjptr->warpl;
    2.62 +    *warpu      = adjptr->warpu;
    2.63      return ret;
    2.64  }
     3.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Tue Aug 03 15:29:44 2004 +0000
     3.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Tue Aug 03 16:01:12 2004 +0000
     3.3 @@ -435,18 +435,23 @@ static PyObject *pyxc_bvtsched_domain_se
     3.4  {
     3.5      XcObject *xc = (XcObject *)self;
     3.6  
     3.7 -    u32           dom;
     3.8 -    unsigned long mcuadv, warp, warpl, warpu;
     3.9 +    u32 dom;
    3.10 +    u32 mcuadv;
    3.11 +    int warpback; 
    3.12 +    s32 warpvalue;
    3.13 +    long long warpl;
    3.14 +    long long warpu;
    3.15  
    3.16 -    static char *kwd_list[] = { "dom", "mcuadv", "warp", "warpl",
    3.17 -                                "warpu", NULL };
    3.18 +    static char *kwd_list[] = { "dom", "mcuadv", "warpback", "warpvalue",
    3.19 +                                "warpl", "warpu", NULL };
    3.20  
    3.21 -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "illll", kwd_list,
    3.22 -                                      &dom, &mcuadv, &warp, &warpl, &warpu) )
    3.23 +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiill", kwd_list,
    3.24 +                                      &dom, &mcuadv, &warpback, &warpvalue, 
    3.25 +                                      &warpl, &warpu) )
    3.26          return NULL;
    3.27  
    3.28      if ( xc_bvtsched_domain_set(xc->xc_handle, dom, mcuadv, 
    3.29 -                                warp, warpl, warpu) != 0 )
    3.30 +                                warpback, warpvalue, warpl, warpu) != 0 )
    3.31          return PyErr_SetFromErrno(xc_error);
    3.32      
    3.33      Py_INCREF(zero);
    3.34 @@ -459,23 +464,28 @@ static PyObject *pyxc_bvtsched_domain_ge
    3.35  {
    3.36      XcObject *xc = (XcObject *)self;
    3.37      u32 dom;
    3.38 -    unsigned long mcuadv, warp, warpl, warpu;
    3.39 +    u32 mcuadv;
    3.40 +    int warpback; 
    3.41 +    s32 warpvalue;
    3.42 +    long long warpl;
    3.43 +    long long warpu;
    3.44      
    3.45      static char *kwd_list[] = { "dom", NULL };
    3.46  
    3.47      if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &dom) )
    3.48          return NULL;
    3.49      
    3.50 -    if ( xc_bvtsched_domain_get(xc->xc_handle, dom, &mcuadv, &warp,
    3.51 -                                &warpl, &warpu) != 0 )
    3.52 +    if ( xc_bvtsched_domain_get(xc->xc_handle, dom, &mcuadv, &warpback,
    3.53 +                            &warpvalue, &warpl, &warpu) != 0 )
    3.54          return PyErr_SetFromErrno(xc_error);
    3.55  
    3.56      return Py_BuildValue("{s:i,s:l,s:l,s:l,s:l}",
    3.57                           "domain", dom,
    3.58                           "mcuadv", mcuadv,
    3.59 -                         "warp",   warp,
    3.60 -                         "warpl",  warpl,
    3.61 -                         "warpu",  warpu);
    3.62 +                         "warpback", warpback,
    3.63 +                         "warpvalue", warpvalue,
    3.64 +                         "warpl", warpl,
    3.65 +                         "warpu", warpu);
    3.66  }
    3.67  
    3.68  static PyObject *pyxc_fbvtsched_global_set(PyObject *self,
    3.69 @@ -1040,12 +1050,13 @@ static PyMethodDef pyxc_methods[] = {
    3.70        (PyCFunction)pyxc_bvtsched_domain_set,
    3.71        METH_VARARGS | METH_KEYWORDS, "\n"
    3.72        "Set per-domain tuning parameters for Borrowed Virtual Time scheduler.\n"
    3.73 -      " dom    [int]: Identifier of domain to be tuned.\n"
    3.74 -      " mcuadv [int]: Proportional to the inverse of the domain's weight.\n"
    3.75 -      " warp   [int]: How far to warp domain's EVT on unblock.\n"
    3.76 -      " warpl  [int]: How long the domain can run warped.\n"
    3.77 -      " warpu  [int]: How long before the domain can warp again.\n\n"
    3.78 -      "Returns: [int] 0 on success; -1 on error.\n" },
    3.79 +      " dom       [int]: Identifier of domain to be tuned.\n"
    3.80 +      " mcuadv    [int]: Proportional to the inverse of the domain's weight.\n"
    3.81 +      " warpback  [int]: Warp ? \n"
    3.82 +      " warpvalue [int]: How far to warp domain's EVT on unblock.\n"
    3.83 +      " warpl     [int]: How long the domain can run warped.\n"
    3.84 +      " warpu     [int]: How long before the domain can warp again.\n\n"
    3.85 +      "Returns:   [int] 0 on success; -1 on error.\n" },
    3.86  
    3.87      { "bvtsched_domain_get",
    3.88        (PyCFunction)pyxc_bvtsched_domain_get,
     4.1 --- a/tools/python/xen/xend/XendClient.py	Tue Aug 03 15:29:44 2004 +0000
     4.2 +++ b/tools/python/xen/xend/XendClient.py	Tue Aug 03 16:01:12 2004 +0000
     4.3 @@ -490,13 +490,14 @@ class Xend:
     4.4                               {'op'      : 'pincpu',
     4.5                                'cpu'     : cpu })
     4.6  
     4.7 -    def xend_domain_cpu_bvt_set(self, id, mcuadv, warp, warpl, warpu):
     4.8 +    def xend_domain_cpu_bvt_set(self, id, mcuadv, warpback, warpvalue, warpl, warpu):
     4.9          return self.xendPost(self.domainurl(id),
    4.10 -                             {'op'      : 'cpu_bvt_set',
    4.11 -                              'mcuadv'  : mcuadv,
    4.12 -                              'warp'    : warp,
    4.13 -                              'warpl'   : warpl,
    4.14 -                              'warpu'   : warpu })
    4.15 +                             {'op'       : 'cpu_bvt_set',
    4.16 +                              'mcuadv'   : mcuadv,
    4.17 +                              'warpback' : warpback,
    4.18 +                              'warpvalue': warpvalue,
    4.19 +                              'warpl'    : warpl,
    4.20 +                              'warpu'    : warpu })
    4.21  
    4.22      def xend_domain_cpu_fbvt_set(self, id, mcuadv, warp, warpl, warpu):
    4.23          return self.xendPost(self.domainurl(id),
     5.1 --- a/tools/python/xen/xend/XendDomain.py	Tue Aug 03 15:29:44 2004 +0000
     5.2 +++ b/tools/python/xen/xend/XendDomain.py	Tue Aug 03 16:01:12 2004 +0000
     5.3 @@ -592,13 +592,14 @@ class XendDomain:
     5.4          except Exception, ex:
     5.5              raise XendError(str(ex))
     5.6  
     5.7 -    def domain_cpu_bvt_set(self, id, mcuadv, warp, warpl, warpu):
     5.8 +    def domain_cpu_bvt_set(self, id, mcuadv, warpback, warpvalue, warpl, warpu):
     5.9          """Set BVT (Borrowed Virtual Time) scheduler parameters for a domain.
    5.10          """
    5.11          dominfo = self.domain_lookup(id)
    5.12          try:
    5.13              return xc.bvtsched_domain_set(dom=dominfo.dom, mcuadv=mcuadv,
    5.14 -                                          warp=warp, warpl=warpl, warpu=warpu)
    5.15 +                                          warpback=warpback, warpvalue=warpvalue, 
    5.16 +                                          warpl=warpl, warpu=warpu)
    5.17          except Exception, ex:
    5.18              raise XendError(str(ex))
    5.19  
     6.1 --- a/tools/python/xen/xend/server/SrvDomain.py	Tue Aug 03 15:29:44 2004 +0000
     6.2 +++ b/tools/python/xen/xend/server/SrvDomain.py	Tue Aug 03 16:01:12 2004 +0000
     6.3 @@ -110,7 +110,8 @@ class SrvDomain(SrvDir):
     6.4          fn = FormFn(self.xd.domain_cpu_bvt_set,
     6.5                      [['dom', 'str'],
     6.6                       ['mcuadv', 'int'],
     6.7 -                     ['warp', 'int'],
     6.8 +                     ['warpback', 'int'],
     6.9 +                     ['warpvalue', 'int'],
    6.10                       ['warpl', 'int'],
    6.11                       ['warpu', 'int']])
    6.12          val = fn(req.args, {'dom': self.dom.name})
     7.1 --- a/tools/python/xen/xm/main.py	Tue Aug 03 15:29:44 2004 +0000
     7.2 +++ b/tools/python/xen/xm/main.py	Tue Aug 03 16:01:12 2004 +0000
     7.3 @@ -492,12 +492,12 @@ class ProgBvt(Prog):
     7.4      info = """Set BVT scheduler parameters."""
     7.5      
     7.6      def help(self, args):
     7.7 -        print args[0], "DOM MCUADV WARP WARPL WARPU"
     7.8 +        print args[0], "DOM MCUADV WARPBACK WARPVALUE WARPL WARPU"
     7.9          print '\nSet Borrowed Virtual Time scheduler parameters.'
    7.10  
    7.11      def main(self, args):
    7.12 -        if len(args) != 6: self.err("%s: Invalid argument(s)" % args[0])
    7.13 -        v = map(int, args[1:6])
    7.14 +        if len(args) != 7: self.err("%s: Invalid argument(s)" % args[0])
    7.15 +        v = map(int, args[1:7])
    7.16          server.xend_domain_cpu_bvt_set(*v)
    7.17  
    7.18  xm.prog(ProgBvt)
     8.1 --- a/xen/common/sched_bvt.c	Tue Aug 03 15:29:44 2004 +0000
     8.2 +++ b/xen/common/sched_bvt.c	Tue Aug 03 16:01:12 2004 +0000
     8.3 @@ -32,15 +32,17 @@ struct bvt_dom_info
     8.4  {
     8.5      struct domain       *domain;          /* domain this info belongs to */
     8.6      struct list_head    run_list;         /* runqueue list pointers */
     8.7 -    unsigned long       mcu_advance;      /* inverse of weight */
     8.8 +    u32                 mcu_advance;      /* inverse of weight */
     8.9      u32                 avt;              /* actual virtual time */
    8.10      u32                 evt;              /* effective virtual time */
    8.11      int                 warpback;         /* warp?  */
    8.12 -    long                warp;             /* virtual time warp */
    8.13 -    long                warpl;            /* warp limit */
    8.14 -    long                warpu;            /* unwarp time requirement */
    8.15 -    s_time_t            warped;           /* time it ran warped last time */
    8.16 -    s_time_t            uwarped;          /* time it ran unwarped last time */
    8.17 +    int                 warp;             /* warp set and within the warp 
    8.18 +                                                                     limits*/
    8.19 +    s32                 warp_value;       /* virtual time warp */
    8.20 +    s_time_t            warpl;            /* warp limit */
    8.21 +    struct ac_timer     warp_timer;       /* deals with warpl */
    8.22 +    s_time_t            warpu;            /* unwarp time requirement */
    8.23 +    struct ac_timer     unwarp_timer;     /* deals with warpu */
    8.24  };
    8.25  
    8.26  struct bvt_cpu_info
    8.27 @@ -91,6 +93,43 @@ static inline int __task_on_runqueue(str
    8.28      return (RUNLIST(d))->next != NULL;
    8.29  }
    8.30  
    8.31 +
    8.32 +/* Warp/unwarp timer functions */
    8.33 +static void warp_timer_fn(unsigned long pointer)
    8.34 +{
    8.35 +    struct bvt_dom_info *inf = (struct bvt_dom_info *)pointer;
    8.36 +
    8.37 +printk("--> Warp timer fired for %d\n", inf->domain->domain);
    8.38 +    inf->warp = 0;
    8.39 +    /* unwarp equal to zero => stop warping */
    8.40 +    if(inf->warpu == 0)
    8.41 +    {
    8.42 +        inf->warpback = 0;
    8.43 +        goto reschedule;
    8.44 +    }
    8.45 +    
    8.46 +    /* set unwarp timer */
    8.47 +    inf->unwarp_timer.expires = NOW() + inf->warpu;
    8.48 +    add_ac_timer(&inf->unwarp_timer);
    8.49 +
    8.50 +reschedule:
    8.51 +    cpu_raise_softirq(inf->domain->processor, SCHEDULE_SOFTIRQ);   
    8.52 +}
    8.53 +
    8.54 +static void unwarp_timer_fn(unsigned long pointer)
    8.55 +{
    8.56 +     struct bvt_dom_info *inf = (struct bvt_dom_info *)pointer;
    8.57 +
    8.58 +printk("---> UnWarp timer fired for %d\n", inf->domain->domain);
    8.59 +    if(inf->warpback)
    8.60 +    {
    8.61 +        inf->warp = 1;
    8.62 +        cpu_raise_softirq(inf->domain->processor, SCHEDULE_SOFTIRQ);   
    8.63 +    }
    8.64 +}
    8.65 +
    8.66 +
    8.67 +
    8.68  static inline u32 calc_avt(struct domain *d, s_time_t now)
    8.69  {
    8.70      u32 ranfor, mcus;
    8.71 @@ -112,8 +151,8 @@ static inline u32 calc_evt(struct domain
    8.72     struct bvt_dom_info *inf = BVT_INFO(d);
    8.73     /* TODO The warp routines need to be rewritten GM */
    8.74   
    8.75 -    if ( inf->warpback ) 
    8.76 -        return avt - inf->warp;
    8.77 +    if ( inf->warp ) 
    8.78 +        return avt - inf->warp_value;
    8.79      else 
    8.80          return avt;
    8.81  }
    8.82 @@ -144,6 +183,21 @@ void bvt_add_task(struct domain *p)
    8.83  
    8.84      inf->mcu_advance = MCU_ADVANCE;
    8.85      inf->domain = p;
    8.86 +    inf->warpback    = 0;
    8.87 +    /* Set some default values here. */
    8.88 +    inf->warp        = 0;
    8.89 +    inf->warp_value  = 0;
    8.90 +    inf->warpl       = MILLISECS(2000);
    8.91 +    inf->warpu       = MILLISECS(1000);
    8.92 +    /* initialise the timers */
    8.93 +    init_ac_timer(&inf->warp_timer);
    8.94 +    inf->warp_timer.cpu = p->processor;
    8.95 +    inf->warp_timer.data = (unsigned long)inf;
    8.96 +    inf->warp_timer.function = &warp_timer_fn;
    8.97 +    init_ac_timer(&inf->unwarp_timer);
    8.98 +    inf->unwarp_timer.cpu = p->processor;
    8.99 +    inf->unwarp_timer.data = (unsigned long)inf;
   8.100 +    inf->unwarp_timer.function = &unwarp_timer_fn;
   8.101      
   8.102      if ( p->domain == IDLE_DOMAIN_ID )
   8.103      {
   8.104 @@ -154,12 +208,7 @@ void bvt_add_task(struct domain *p)
   8.105          /* Set avt and evt to system virtual time. */
   8.106          inf->avt         = CPU_SVT(p->processor);
   8.107          inf->evt         = CPU_SVT(p->processor);
   8.108 -        /* Set some default values here. */
   8.109 -        inf->warpback    = 0;
   8.110 -        inf->warp        = 0;
   8.111 -        inf->warpl       = 0;
   8.112 -        inf->warpu       = 0;
   8.113 -    }
   8.114 +   }
   8.115  
   8.116      return;
   8.117  }
   8.118 @@ -274,7 +323,7 @@ void bvt_free_task(struct domain *p)
   8.119   */
   8.120  static void bvt_do_block(struct domain *p)
   8.121  {
   8.122 -    BVT_INFO(p)->warpback = 0; 
   8.123 +    // TODO what when blocks? BVT_INFO(p)->warpback = 0; 
   8.124  }
   8.125  
   8.126  /* Control the scheduler. */
   8.127 @@ -303,16 +352,17 @@ int bvt_adjdom(struct domain *p,
   8.128  
   8.129      if ( cmd->direction == SCHED_INFO_PUT )
   8.130      {
   8.131 -        unsigned long mcu_adv = params->mcu_adv,
   8.132 -            warp  = params->warp,
   8.133 -            warpl = params->warpl,
   8.134 -            warpu = params->warpu;
   8.135 +        u32 mcu_adv = params->mcu_adv;
   8.136 +        u32 warpback  = params->warpback;
   8.137 +        s32 warpvalue = params->warpvalue;
   8.138 +        s_time_t warpl = params->warpl;
   8.139 +        s_time_t warpu = params->warpu;
   8.140          
   8.141          struct bvt_dom_info *inf = BVT_INFO(p);
   8.142          
   8.143 -        DPRINTK("Get domain %u bvt mcu_adv=%ld, warp=%ld, "
   8.144 +        DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d"
   8.145                  "warpl=%ld, warpu=%ld\n",
   8.146 -                p->domain, inf->mcu_advance, inf->warp,
   8.147 +                p->domain, inf->mcu_advance, inf->warpback, inf->warpvalue,
   8.148                  inf->warpl, inf->warpu );
   8.149  
   8.150          /* Sanity -- this can avoid divide-by-zero. */
   8.151 @@ -321,13 +371,15 @@ int bvt_adjdom(struct domain *p,
   8.152          
   8.153          spin_lock_irqsave(&CPU_INFO(p->processor)->run_lock, flags);   
   8.154          inf->mcu_advance = mcu_adv;
   8.155 -        inf->warp = warp;
   8.156 +        inf->warpback = warpback; // TODO - temporary 
   8.157 +        inf->warp = 1;
   8.158 +        inf->warp_value = warpvalue;
   8.159          inf->warpl = warpl;
   8.160          inf->warpu = warpu;
   8.161  
   8.162 -        DPRINTK("Set domain %u bvt mcu_adv=%ld, warp=%ld, "
   8.163 +        DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d"
   8.164                  "warpl=%ld, warpu=%ld\n",
   8.165 -                p->domain, inf->mcu_advance, inf->warp,
   8.166 +                p->domain, inf->mcu_advance, inf->warpback, inf->warpvalue,
   8.167                  inf->warpl, inf->warpu );
   8.168  
   8.169          spin_unlock_irqrestore(&CPU_INFO(p->processor)->run_lock, flags);
   8.170 @@ -337,10 +389,11 @@ int bvt_adjdom(struct domain *p,
   8.171          struct bvt_dom_info *inf = BVT_INFO(p);
   8.172  
   8.173          spin_lock_irqsave(&CPU_INFO(p->processor)->run_lock, flags);   
   8.174 -        params->mcu_adv = inf->mcu_advance;
   8.175 -        params->warp    = inf->warp;
   8.176 -        params->warpl   = inf->warpl;
   8.177 -        params->warpu   = inf->warpu;
   8.178 +        params->mcu_adv     = inf->mcu_advance;
   8.179 +        params->warpvalue   = inf->warp_value;
   8.180 +        params->warpback    = inf->warpback;
   8.181 +        params->warpl       = inf->warpl;
   8.182 +        params->warpu       = inf->warpu;
   8.183          spin_unlock_irqrestore(&CPU_INFO(p->processor)->run_lock, flags);
   8.184      }
   8.185      
   8.186 @@ -380,7 +433,8 @@ static task_slice_t bvt_do_schedule(s_ti
   8.187      {
   8.188          prev_inf->avt = calc_avt(prev, now);
   8.189          prev_inf->evt = calc_evt(prev, prev_inf->avt);
   8.190 -        
   8.191 +       
   8.192 +        rem_ac_timer(&prev_inf->warp_timer);
   8.193          __del_from_runqueue(prev);
   8.194          
   8.195          if ( domain_runnable(prev) )
   8.196 @@ -489,6 +543,13 @@ static task_slice_t bvt_do_schedule(s_ti
   8.197      ASSERT(r_time >= ctx_allow);
   8.198  
   8.199   sched_done:
   8.200 +    if(next_inf->warp && next_inf->warpl > 0) // TODO - already added?
   8.201 +    {
   8.202 +        /* Set the timer up */ 
   8.203 +        next_inf->warp_timer.expires = now + next_inf->warpl;
   8.204 +        /* Add it to the heap */
   8.205 +        add_ac_timer(&next_inf->warp_timer);
   8.206 +    }
   8.207      ret.task = next;
   8.208      ret.time = r_time;
   8.209      return ret;
   8.210 @@ -499,7 +560,7 @@ static void bvt_dump_runq_el(struct doma
   8.211  {
   8.212      struct bvt_dom_info *inf = BVT_INFO(p);
   8.213      
   8.214 -    printk("mcua=0x%04lX ev=0x%08X av=0x%08X ",
   8.215 +    printk("mcua=%d ev=0x%08X av=0x%08X ",
   8.216             inf->mcu_advance, inf->evt, inf->avt);
   8.217  }
   8.218  
   8.219 @@ -540,8 +601,8 @@ static void bvt_dump_cpu_state(int i)
   8.220  
   8.221  /* We use cache to create the bvt_dom_infos 
   8.222     this functions makes sure that the run_list
   8.223 -   is initialised properly. The new domain needs
   8.224 -   NOT to appear as to be on the runqueue */
   8.225 +   is initialised properly.
   8.226 +   Call to __task_on_runqueue needs to return false */
   8.227  static void cache_constructor(void *arg1, xmem_cache_t *arg2, unsigned long arg3)
   8.228  {
   8.229      struct bvt_dom_info *dom_inf = (struct bvt_dom_info*)arg1;
     9.1 --- a/xen/include/hypervisor-ifs/sched_ctl.h	Tue Aug 03 15:29:44 2004 +0000
     9.2 +++ b/xen/include/hypervisor-ifs/sched_ctl.h	Tue Aug 03 16:01:12 2004 +0000
     9.3 @@ -56,10 +56,11 @@ struct sched_adjdom_cmd
     9.4      union {                           /* 16 */
     9.5          struct bvt_adjdom
     9.6          {
     9.7 -            u32 mcu_adv;    /* 16: mcu advance: inverse of weight */
     9.8 -            u32 warp;       /* 20: time warp */
     9.9 -            u32 warpl;      /* 24: warp limit */
    9.10 -            u32 warpu;      /* 28: unwarp time requirement */
    9.11 +            u32 mcu_adv;            /* 16: mcu advance: inverse of weight */
    9.12 +            u32 warpback;           /* 20: warp? */
    9.13 +            s32 warpvalue;          /* 24: warp value */
    9.14 +            long long warpl;        /* 32: warp limit */
    9.15 +            long long warpu;        /* 40: unwarp time requirement */
    9.16          } PACKED bvt;
    9.17  
    9.18          struct fbvt_adjdom