ia64/xen-unstable

changeset 11280:26b673aeff8b

Remove all traces of the obsolete BVT scheduler.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Aug 23 17:14:38 2006 +0100 (2006-08-23)
parents 61eea55dce65
children d389123fad85
files docs/man/xm.pod.1 docs/misc/xend.tex docs/src/interface.tex docs/src/user.tex tools/libxc/Makefile tools/libxc/xc_bvtsched.c tools/libxc/xc_domain.c tools/libxc/xenctrl.h tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendNode.py tools/python/xen/xend/server/SrvDomain.py tools/python/xen/xend/server/SrvNode.py tools/python/xen/xend/server/XMLRPCServer.py tools/python/xen/xm/main.py xen/arch/ia64/tools/xelilo/elilo.README xen/common/Makefile xen/common/sched_bvt.c xen/common/schedule.c xen/include/public/sched_ctl.h
line diff
     1.1 --- a/docs/man/xm.pod.1	Wed Aug 23 15:02:55 2006 +0100
     1.2 +++ b/docs/man/xm.pod.1	Wed Aug 23 17:14:38 2006 +0100
     1.3 @@ -511,55 +511,6 @@ FIXME: we really need a scheduler expert
     1.4  
     1.5  =over 4
     1.6  
     1.7 -=item B<sched-bvt> I<mcuadv> I<warpback> I<warpvalue> I<warpl> I<warpu>
     1.8 -
     1.9 -Performs runtime adjustments to the default parameters for the
    1.10 -Borrowed Virtual Time (BVT) scheduler.  For full information on the
    1.11 -BVT concept, please consult the base paper listed in the B<SEE ALSO>
    1.12 -section.
    1.13 -
    1.14 -Set Borrowed Virtual Time (BVT) scheduler parameters. There are five
    1.15 -required parameters, which are given in order below.
    1.16 -
    1.17 -FIXME: what units are all the BVT params in?
    1.18 -
    1.19 -B<PARAMETERS>
    1.20 -
    1.21 -=over 4
    1.22 -
    1.23 -=item I<mcuadv>
    1.24 -
    1.25 -The MCU (Minimum Charging Unit) advance determines the proportional
    1.26 -share of the CPU that a domain receives. It is set inversely
    1.27 -proportionally to a domain's sharing weight.
    1.28 -
    1.29 -=item I<warpback>
    1.30 -
    1.31 -The amount of `virtual time' the domain is allowed to warp backwards.
    1.32 -
    1.33 -=item I<warpvalue>
    1.34 -
    1.35 -Warp value (FIXME: what does this really mean?)
    1.36 -
    1.37 -=item I<warpl>
    1.38 -
    1.39 -The warp limit is the maximum time a domain can run warped for.
    1.40 -
    1.41 -=item I<warpu>
    1.42 -
    1.43 -The unwarp requirement is the minimum time a domain must run unwarped
    1.44 -for before it can warp again.
    1.45 -
    1.46 -=back 
    1.47 -
    1.48 -=item B<sched-bvt-ctxallow> I<allow>
    1.49 -
    1.50 -Sets the BVT scheduler's context switch allowance. 
    1.51 -
    1.52 -The context switch allowance is similar to the ``quantum'' in
    1.53 -traditional schedulers. It is the minimum time that a scheduled domain
    1.54 -will be allowed to run before being preempted.
    1.55 -
    1.56  =item B<sched-sedf> I<period> I<slice> I<latency-hint> I<extratime> I<weight>
    1.57  
    1.58  Set Simple EDF (Earliest Deadline First) scheduler parameters.  This
    1.59 @@ -1126,12 +1077,6 @@ their binary identifiers (ssidrefs) used
    1.60  
    1.61  B<xmdomain.cfg>(5), B<xentop>(1)
    1.62  
    1.63 -BVT scheduling paper: K.J. Duda and D.R. Cheriton. Borrowed Virtual
    1.64 -Time (BVT) scheduling: supporting latency-sensitive threads in a
    1.65 -general purpose scheduler. In proceedings of the 17th ACM SIGOPS
    1.66 -Symposium on Operating Systems principles, volume 33(5) of ACM
    1.67 -Operating Systems Review, pages 261-267
    1.68 -
    1.69  =head1 AUTHOR
    1.70  
    1.71    Sean Dague <sean at dague dot net>
     2.1 --- a/docs/misc/xend.tex	Wed Aug 23 15:02:55 2006 +0100
     2.2 +++ b/docs/misc/xend.tex	Wed Aug 23 17:14:38 2006 +0100
     2.3 @@ -337,14 +337,6 @@ Python client interface in {\tt xen.xend
     2.4    {\tt xend\_domain\_pincpu(self, id, cpu)}\\:
     2.5    Pin a domain to a cpu.
     2.6  
     2.7 -\item {\tt POST /domain/[dom] bvt\_set(mcuadv, warp, warpl, warpu)},\\
     2.8 -  {\tt xend\_domain\_cpu\_bvt\_set(dom, mcuadv, warp, warpl, warpu)}:\\
     2.9 -  Set BVT scheduler parameters.
    2.10 -
    2.11 -\item {\tt POST /domain/[dom] atropos\_set(period, slice, latency, xtratime)},\\
    2.12 -  {\tt xend\_domain\_cpu\_atropos\_set(dom, period, slice, latency, xtratime)}:\\
    2.13 -  Set atropos scheduler parameters.
    2.14 -
    2.15  \item {\tt POST /domain/[dom] maxmem\_set(memory)},\\
    2.16    {\tt xend\_domain\_maxmem\_set(dom, memory)}:\\
    2.17    Set domain maximum memory limit.
     3.1 --- a/docs/src/interface.tex	Wed Aug 23 15:02:55 2006 +0100
     3.2 +++ b/docs/src/interface.tex	Wed Aug 23 17:14:38 2006 +0100
     3.3 @@ -209,8 +209,8 @@ implement timeout values when they block
     3.4  
     3.5  Xen offers a uniform API for CPU schedulers.  It is possible to choose
     3.6  from a number of schedulers at boot and it should be easy to add more.
     3.7 -The SEDF, BVT, and Credit schedulers are part of the normal Xen
     3.8 -distribution.  BVT and SEDF will be going away and their use should be
     3.9 +The SEDF and Credit schedulers are part of the normal Xen
    3.10 +distribution.  SEDF will be going away and its use should be
    3.11  avoided once the credit scheduler has stabilized and become the default.
    3.12  The Credit scheduler provides proportional fair shares of the
    3.13  host's CPUs to the running domains. It does this while transparently
     4.1 --- a/docs/src/user.tex	Wed Aug 23 15:02:55 2006 +0100
     4.2 +++ b/docs/src/user.tex	Wed Aug 23 17:14:38 2006 +0100
     4.3 @@ -3179,7 +3179,7 @@ editing \path{grub.conf}.
     4.4  \item [ tbuf\_size=xxx ] Set the size of the per-cpu trace buffers, in
     4.5    pages (default 0).  
     4.6  \item [ sched=xxx ] Select the CPU scheduler Xen should use.  The
     4.7 -  current possibilities are `credit' (default), `sedf', and `bvt'.
     4.8 +  current possibilities are `credit' (default), and `sedf'.
     4.9  \item [ apic\_verbosity=debug,verbose ] Print more detailed
    4.10    information about local APIC and IOAPIC configuration.
    4.11  \item [ lapic ] Force use of local APIC even when left disabled by
    4.12 @@ -4135,9 +4135,6 @@ as it will forward multicasts received f
    4.13  
    4.14  \begin{description}
    4.15  
    4.16 -\item[BVT] The BVT scheduler is used to give proportional fair shares
    4.17 -  of the CPU to domains.
    4.18 -
    4.19  \item[Domain] A domain is the execution context that contains a
    4.20    running {\bf virtual machine}.  The relationship between virtual
    4.21    machines and domains on Xen is similar to that between programs and
     5.1 --- a/tools/libxc/Makefile	Wed Aug 23 15:02:55 2006 +0100
     5.2 +++ b/tools/libxc/Makefile	Wed Aug 23 17:14:38 2006 +0100
     5.3 @@ -11,7 +11,6 @@ XEN_ROOT = ../..
     5.4  include $(XEN_ROOT)/tools/Rules.mk
     5.5  
     5.6  CTRL_SRCS-y       :=
     5.7 -CTRL_SRCS-y       += xc_bvtsched.c
     5.8  CTRL_SRCS-y       += xc_core.c
     5.9  CTRL_SRCS-y       += xc_domain.c
    5.10  CTRL_SRCS-y       += xc_evtchn.c
     6.1 --- a/tools/libxc/xc_bvtsched.c	Wed Aug 23 15:02:55 2006 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,92 +0,0 @@
     6.4 -/******************************************************************************
     6.5 - * xc_bvtsched.c
     6.6 - *
     6.7 - * API for manipulating parameters of the Borrowed Virtual Time scheduler.
     6.8 - *
     6.9 - * Copyright (c) 2003, K A Fraser.
    6.10 - */
    6.11 -
    6.12 -#include "xc_private.h"
    6.13 -
    6.14 -int xc_bvtsched_global_set(int xc_handle,
    6.15 -                           unsigned long ctx_allow)
    6.16 -{
    6.17 -    DECLARE_DOM0_OP;
    6.18 -
    6.19 -    op.cmd = DOM0_SCHEDCTL;
    6.20 -    op.u.schedctl.sched_id = SCHED_BVT;
    6.21 -    op.u.schedctl.direction = SCHED_INFO_PUT;
    6.22 -    op.u.schedctl.u.bvt.ctx_allow = ctx_allow;
    6.23 -
    6.24 -    return do_dom0_op(xc_handle, &op);
    6.25 -}
    6.26 -
    6.27 -int xc_bvtsched_global_get(int xc_handle,
    6.28 -                           unsigned long *ctx_allow)
    6.29 -{
    6.30 -    DECLARE_DOM0_OP;
    6.31 -    int ret;
    6.32 -
    6.33 -    op.cmd = DOM0_SCHEDCTL;
    6.34 -    op.u.schedctl.sched_id = SCHED_BVT;
    6.35 -    op.u.schedctl.direction = SCHED_INFO_GET;
    6.36 -
    6.37 -    ret = do_dom0_op(xc_handle, &op);
    6.38 -
    6.39 -    *ctx_allow = op.u.schedctl.u.bvt.ctx_allow;
    6.40 -
    6.41 -    return ret;
    6.42 -}
    6.43 -
    6.44 -int xc_bvtsched_domain_set(int xc_handle,
    6.45 -                           uint32_t domid,
    6.46 -                           uint32_t mcuadv,
    6.47 -                           int warpback,
    6.48 -                           int32_t warpvalue,
    6.49 -                           long long warpl,
    6.50 -                           long long warpu)
    6.51 -{
    6.52 -    DECLARE_DOM0_OP;
    6.53 -    struct bvt_adjdom *bvtadj = &op.u.adjustdom.u.bvt;
    6.54 -
    6.55 -    op.cmd = DOM0_ADJUSTDOM;
    6.56 -    op.u.adjustdom.domain  = (domid_t)domid;
    6.57 -    op.u.adjustdom.sched_id = SCHED_BVT;
    6.58 -    op.u.adjustdom.direction = SCHED_INFO_PUT;
    6.59 -
    6.60 -    bvtadj->mcu_adv     = mcuadv;
    6.61 -    bvtadj->warpback    = warpback;
    6.62 -    bvtadj->warpvalue   = warpvalue;
    6.63 -    bvtadj->warpl       = warpl;
    6.64 -    bvtadj->warpu       = warpu;
    6.65 -    return do_dom0_op(xc_handle, &op);
    6.66 -}
    6.67 -
    6.68 -
    6.69 -int xc_bvtsched_domain_get(int xc_handle,
    6.70 -                           uint32_t domid,
    6.71 -                           uint32_t *mcuadv,
    6.72 -                           int *warpback,
    6.73 -                           int32_t *warpvalue,
    6.74 -                           long long *warpl,
    6.75 -                           long long *warpu)
    6.76 -{
    6.77 -
    6.78 -    DECLARE_DOM0_OP;
    6.79 -    int ret;
    6.80 -    struct bvt_adjdom *adjptr = &op.u.adjustdom.u.bvt;
    6.81 -
    6.82 -    op.cmd = DOM0_ADJUSTDOM;
    6.83 -    op.u.adjustdom.domain  = (domid_t)domid;
    6.84 -    op.u.adjustdom.sched_id = SCHED_BVT;
    6.85 -    op.u.adjustdom.direction = SCHED_INFO_GET;
    6.86 -
    6.87 -    ret = do_dom0_op(xc_handle, &op);
    6.88 -
    6.89 -    *mcuadv     = adjptr->mcu_adv;
    6.90 -    *warpback   = adjptr->warpback;
    6.91 -    *warpvalue  = adjptr->warpvalue;
    6.92 -    *warpl      = adjptr->warpl;
    6.93 -    *warpu      = adjptr->warpu;
    6.94 -    return ret;
    6.95 -}
     7.1 --- a/tools/libxc/xc_domain.c	Wed Aug 23 15:02:55 2006 +0100
     7.2 +++ b/tools/libxc/xc_domain.c	Wed Aug 23 17:14:38 2006 +0100
     7.3 @@ -250,36 +250,8 @@ int xc_domain_setcpuweight(int xc_handle
     7.4      if ( (ret = xc_sched_id(xc_handle, &sched_id)) != 0 )
     7.5          return ret;
     7.6  
     7.7 -    switch ( sched_id )
     7.8 -    {
     7.9 -        case SCHED_BVT:
    7.10 -        {
    7.11 -            uint32_t mcuadv;
    7.12 -            int warpback;
    7.13 -            int32_t warpvalue;
    7.14 -            long long warpl;
    7.15 -            long long warpu;
    7.16 -
    7.17 -            /* Preserve all the scheduling parameters apart
    7.18 -               of MCU advance. */
    7.19 -            if ( (ret = xc_bvtsched_domain_get(
    7.20 -                xc_handle, domid, &mcuadv,
    7.21 -                &warpback, &warpvalue, &warpl, &warpu)) != 0 )
    7.22 -                return ret;
    7.23 -
    7.24 -            /* The MCU advance is inverse of the weight.
    7.25 -               Default value of the weight is 1, default mcuadv 10.
    7.26 -               The scaling factor is therefore 10. */
    7.27 -            if ( weight > 0 )
    7.28 -                mcuadv = 10 / weight;
    7.29 -
    7.30 -            ret = xc_bvtsched_domain_set(xc_handle, domid, mcuadv,
    7.31 -                                         warpback, warpvalue, warpl, warpu);
    7.32 -            break;
    7.33 -        }
    7.34 -    }
    7.35 -
    7.36 -    return ret;
    7.37 +    /* No-op. */
    7.38 +    return 0;
    7.39  }
    7.40  
    7.41  int xc_domain_setmaxmem(int xc_handle,
     8.1 --- a/tools/libxc/xenctrl.h	Wed Aug 23 15:02:55 2006 +0100
     8.2 +++ b/tools/libxc/xenctrl.h	Wed Aug 23 17:14:38 2006 +0100
     8.3 @@ -327,28 +327,6 @@ int xc_shadow_control(int xc_handle,
     8.4                        uint32_t mode,
     8.5                        xc_shadow_control_stats_t *stats);
     8.6  
     8.7 -int xc_bvtsched_global_set(int xc_handle,
     8.8 -                           unsigned long ctx_allow);
     8.9 -
    8.10 -int xc_bvtsched_domain_set(int xc_handle,
    8.11 -                           uint32_t domid,
    8.12 -                           uint32_t mcuadv,
    8.13 -                           int warpback,
    8.14 -                           int32_t warpvalue,
    8.15 -                           long long warpl,
    8.16 -                           long long warpu);
    8.17 -
    8.18 -int xc_bvtsched_global_get(int xc_handle,
    8.19 -                           unsigned long *ctx_allow);
    8.20 -
    8.21 -int xc_bvtsched_domain_get(int xc_handle,
    8.22 -                           uint32_t domid,
    8.23 -                           uint32_t *mcuadv,
    8.24 -                           int *warpback,
    8.25 -                           int32_t *warpvalue,
    8.26 -                           long long *warpl,
    8.27 -                           long long *warpu);
    8.28 -
    8.29  int xc_sedf_domain_set(int xc_handle,
    8.30                         uint32_t domid,
    8.31                         uint64_t period, uint64_t slice,
     9.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Wed Aug 23 15:02:55 2006 +0100
     9.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Wed Aug 23 17:14:38 2006 +0100
     9.3 @@ -388,83 +388,6 @@ static PyObject *pyxc_hvm_build(XcObject
     9.4      return Py_BuildValue("{s:i}", "store_mfn", store_mfn);
     9.5  }
     9.6  
     9.7 -static PyObject *pyxc_bvtsched_global_set(XcObject *self, PyObject *args)
     9.8 -{
     9.9 -    unsigned long ctx_allow;
    9.10 -
    9.11 -    if (!PyArg_ParseTuple(args, "l", &ctx_allow))
    9.12 -        return NULL;
    9.13 -
    9.14 -    if (xc_bvtsched_global_set(self->xc_handle, ctx_allow) != 0)
    9.15 -        return PyErr_SetFromErrno(xc_error);
    9.16 -    
    9.17 -    Py_INCREF(zero);
    9.18 -    return zero;
    9.19 -}
    9.20 -
    9.21 -static PyObject *pyxc_bvtsched_global_get(XcObject *self)
    9.22 -{
    9.23 -    unsigned long ctx_allow;
    9.24 -    
    9.25 -    if (xc_bvtsched_global_get(self->xc_handle, &ctx_allow) != 0)
    9.26 -        return PyErr_SetFromErrno(xc_error);
    9.27 -    
    9.28 -    return Py_BuildValue("s:l", "ctx_allow", ctx_allow);
    9.29 -}
    9.30 -
    9.31 -static PyObject *pyxc_bvtsched_domain_set(XcObject *self,
    9.32 -                                          PyObject *args,
    9.33 -                                          PyObject *kwds)
    9.34 -{
    9.35 -    uint32_t dom;
    9.36 -    uint32_t mcuadv;
    9.37 -    int warpback; 
    9.38 -    int32_t warpvalue;
    9.39 -    long long warpl;
    9.40 -    long long warpu;
    9.41 -
    9.42 -    static char *kwd_list[] = { "dom", "mcuadv", "warpback", "warpvalue",
    9.43 -                                "warpl", "warpu", NULL };
    9.44 -
    9.45 -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiiiLL", kwd_list,
    9.46 -                                      &dom, &mcuadv, &warpback, &warpvalue, 
    9.47 -                                      &warpl, &warpu) )
    9.48 -        return NULL;
    9.49 -
    9.50 -    if ( xc_bvtsched_domain_set(self->xc_handle, dom, mcuadv, 
    9.51 -                                warpback, warpvalue, warpl, warpu) != 0 )
    9.52 -        return PyErr_SetFromErrno(xc_error);
    9.53 -    
    9.54 -    Py_INCREF(zero);
    9.55 -    return zero;
    9.56 -}
    9.57 -
    9.58 -static PyObject *pyxc_bvtsched_domain_get(XcObject *self,
    9.59 -                                          PyObject *args)
    9.60 -{
    9.61 -    uint32_t dom;
    9.62 -    uint32_t mcuadv;
    9.63 -    int warpback; 
    9.64 -    int32_t warpvalue;
    9.65 -    long long warpl;
    9.66 -    long long warpu;
    9.67 -    
    9.68 -    if (!PyArg_ParseTuple(args, "i", &dom))
    9.69 -        return NULL;
    9.70 -    
    9.71 -    if (xc_bvtsched_domain_get(self->xc_handle, dom, &mcuadv, &warpback,
    9.72 -                               &warpvalue, &warpl, &warpu) != 0)
    9.73 -        return PyErr_SetFromErrno(xc_error);
    9.74 -
    9.75 -    return Py_BuildValue("{s:i,s:l,s:l,s:l,s:l}",
    9.76 -                         "domain", dom,
    9.77 -                         "mcuadv", mcuadv,
    9.78 -                         "warpback", warpback,
    9.79 -                         "warpvalue", warpvalue,
    9.80 -                         "warpl", warpl,
    9.81 -                         "warpu", warpu);
    9.82 -}
    9.83 -
    9.84  static PyObject *pyxc_evtchn_alloc_unbound(XcObject *self,
    9.85                                             PyObject *args,
    9.86                                             PyObject *kwds)
    9.87 @@ -1051,45 +974,6 @@ static PyMethodDef pyxc_methods[] = {
    9.88        " vcpus   [int, 1]:   Number of Virtual CPUS in domain.\n\n"
    9.89        "Returns: [int] 0 on success; -1 on error.\n" },
    9.90  
    9.91 -    { "bvtsched_global_set",
    9.92 -      (PyCFunction)pyxc_bvtsched_global_set,
    9.93 -      METH_VARARGS | METH_KEYWORDS, "\n"
    9.94 -      "Set global tuning parameters for Borrowed Virtual Time scheduler.\n"
    9.95 -      " ctx_allow [int]: Minimal guaranteed quantum.\n\n"
    9.96 -      "Returns: [int] 0 on success; -1 on error.\n" },
    9.97 -
    9.98 -    { "bvtsched_global_get",
    9.99 -      (PyCFunction)pyxc_bvtsched_global_get,
   9.100 -      METH_NOARGS, "\n"
   9.101 -      "Get global tuning parameters for BVT scheduler.\n"
   9.102 -      "Returns: [dict]:\n"
   9.103 -      " ctx_allow [int]: context switch allowance\n" },
   9.104 -
   9.105 -    { "bvtsched_domain_set",
   9.106 -      (PyCFunction)pyxc_bvtsched_domain_set,
   9.107 -      METH_VARARGS | METH_KEYWORDS, "\n"
   9.108 -      "Set per-domain tuning parameters for Borrowed Virtual Time scheduler.\n"
   9.109 -      " dom       [int]: Identifier of domain to be tuned.\n"
   9.110 -      " mcuadv    [int]: Proportional to the inverse of the domain's weight.\n"
   9.111 -      " warpback  [int]: Warp ? \n"
   9.112 -      " warpvalue [int]: How far to warp domain's EVT on unblock.\n"
   9.113 -      " warpl     [int]: How long the domain can run warped.\n"
   9.114 -      " warpu     [int]: How long before the domain can warp again.\n\n"
   9.115 -      "Returns:   [int] 0 on success; -1 on error.\n" },
   9.116 -
   9.117 -    { "bvtsched_domain_get",
   9.118 -      (PyCFunction)pyxc_bvtsched_domain_get,
   9.119 -      METH_VARARGS, "\n"
   9.120 -      "Get per-domain tuning parameters under the BVT scheduler.\n"
   9.121 -      " dom [int]: Identifier of domain to be queried.\n"
   9.122 -      "Returns [dict]:\n"
   9.123 -      " domain [int]:  Domain ID.\n"
   9.124 -      " mcuadv [long]: MCU Advance.\n"
   9.125 -      " warp   [long]: Warp.\n"
   9.126 -      " warpu  [long]: Unwarp requirement.\n"
   9.127 -      " warpl  [long]: Warp limit,\n"
   9.128 -    },
   9.129 -    
   9.130      { "sedf_domain_set",
   9.131        (PyCFunction)pyxc_sedf_domain_set,
   9.132        METH_KEYWORDS, "\n"
    10.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Aug 23 15:02:55 2006 +0100
    10.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed Aug 23 17:14:38 2006 +0100
    10.3 @@ -471,34 +471,6 @@ class XendDomain:
    10.4          except Exception, ex:
    10.5              raise XendError(str(ex))
    10.6  
    10.7 -    def domain_cpu_bvt_set(self, domid, mcuadv, warpback, warpvalue, warpl,
    10.8 -                           warpu):
    10.9 -        """Set BVT (Borrowed Virtual Time) scheduler parameters for a domain.
   10.10 -        """
   10.11 -        dominfo = self.domain_lookup_by_name_or_id_nr(domid)
   10.12 -        if not dominfo:
   10.13 -            raise XendInvalidDomain(str(domid))
   10.14 -        try:
   10.15 -            return xc.bvtsched_domain_set(dom=dominfo.getDomid(),
   10.16 -                                          mcuadv=mcuadv,
   10.17 -                                          warpback=warpback,
   10.18 -                                          warpvalue=warpvalue, 
   10.19 -                                          warpl=warpl, warpu=warpu)
   10.20 -        except Exception, ex:
   10.21 -            raise XendError(str(ex))
   10.22 -
   10.23 -    def domain_cpu_bvt_get(self, domid):
   10.24 -        """Get BVT (Borrowed Virtual Time) scheduler parameters for a domain.
   10.25 -        """
   10.26 -        dominfo = self.domain_lookup_by_name_or_id_nr(domid)
   10.27 -        if not dominfo:
   10.28 -            raise XendInvalidDomain(str(domid))
   10.29 -        try:
   10.30 -            return xc.bvtsched_domain_get(dominfo.getDomid())
   10.31 -        except Exception, ex:
   10.32 -            raise XendError(str(ex))
   10.33 -    
   10.34 -    
   10.35      def domain_cpu_sedf_set(self, domid, period, slice_, latency, extratime,
   10.36                              weight):
   10.37          """Set Simple EDF scheduler parameters for a domain.
    11.1 --- a/tools/python/xen/xend/XendNode.py	Wed Aug 23 15:02:55 2006 +0100
    11.2 +++ b/tools/python/xen/xend/XendNode.py	Wed Aug 23 17:14:38 2006 +0100
    11.3 @@ -39,12 +39,6 @@ class XendNode:
    11.4      def notify(self, _):
    11.5          return 0
    11.6      
    11.7 -    def cpu_bvt_slice_set(self, ctx_allow):
    11.8 -        return self.xc.bvtsched_global_set(ctx_allow)
    11.9 -
   11.10 -    def cpu_bvt_slice_get(self):
   11.11 -        return self.xc.bvtsched_global_get()
   11.12 -    
   11.13      def info(self):
   11.14          return (self.nodeinfo() + self.physinfo() + self.xeninfo() +
   11.15                  self.xendinfo())
    12.1 --- a/tools/python/xen/xend/server/SrvDomain.py	Wed Aug 23 15:02:55 2006 +0100
    12.2 +++ b/tools/python/xen/xend/server/SrvDomain.py	Wed Aug 23 17:14:38 2006 +0100
    12.3 @@ -102,18 +102,6 @@ class SrvDomain(SrvDir):
    12.4          val = fn(req.args, {'dom': self.dom.domid})
    12.5          return val
    12.6  
    12.7 -    def op_cpu_bvt_set(self, _, req):
    12.8 -        fn = FormFn(self.xd.domain_cpu_bvt_set,
    12.9 -                    [['dom',       'int'],
   12.10 -                     ['mcuadv',    'int'],
   12.11 -                     ['warpback',  'int'],
   12.12 -                     ['warpvalue', 'int'],
   12.13 -                     ['warpl',     'long'],
   12.14 -                     ['warpu',     'long']])
   12.15 -        val = fn(req.args, {'dom': self.dom.domid})
   12.16 -        return val
   12.17 -    
   12.18 -    
   12.19      def op_cpu_sedf_get(self, _, req):
   12.20          fn = FormFn(self.xd.domain_cpu_sedf_get,
   12.21                      [['dom', 'int']])
    13.1 --- a/tools/python/xen/xend/server/SrvNode.py	Wed Aug 23 15:02:55 2006 +0100
    13.2 +++ b/tools/python/xen/xend/server/SrvNode.py	Wed Aug 23 17:14:38 2006 +0100
    13.3 @@ -39,12 +39,6 @@ class SrvNode(SrvDir):
    13.4          val = self.xn.reboot()
    13.5          return val
    13.6  
    13.7 -    def op_cpu_bvt_slice_set(self, _, req):
    13.8 -        fn = FormFn(self.xn.cpu_bvt_slice_set,
    13.9 -                    [['ctx_allow', 'int']])
   13.10 -        val = fn(req.args, {})
   13.11 -        return val
   13.12 -    
   13.13      def render_POST(self, req):
   13.14          return self.perform(req)
   13.15  
    14.1 --- a/tools/python/xen/xend/server/XMLRPCServer.py	Wed Aug 23 15:02:55 2006 +0100
    14.2 +++ b/tools/python/xen/xend/server/XMLRPCServer.py	Wed Aug 23 17:14:38 2006 +0100
    14.3 @@ -109,7 +109,7 @@ class XMLRPCServer:
    14.4                      self.server.register_function(fn, "xend.domain.%s" % name[7:])
    14.5  
    14.6          # Functions in XendNode and XendDmesg
    14.7 -        for type, lst, n in [(XendNode, ['info', 'cpu_bvt_slice_set'], 'node'),
    14.8 +        for type, lst, n in [(XendNode, ['info'], 'node'),
    14.9                               (XendDmesg, ['info', 'clear'], 'node.dmesg')]:
   14.10              inst = type.instance()
   14.11              for name in lst:
    15.1 --- a/tools/python/xen/xm/main.py	Wed Aug 23 15:02:55 2006 +0100
    15.2 +++ b/tools/python/xen/xm/main.py	Wed Aug 23 17:14:38 2006 +0100
    15.3 @@ -89,10 +89,6 @@ dmesg_help =   "dmesg [-c|--clear]      
    15.4  info_help =    "info                             Get information about the xen host"
    15.5  rename_help =  "rename <DomId> <New Name>        Rename a domain"
    15.6  log_help =     "log                              Print the xend log"
    15.7 -sched_bvt_help = """sched-bvt <Parameters>           Set Borrowed Virtual Time scheduler
    15.8 -                                    parameters"""
    15.9 -sched_bvt_ctxallow_help = """sched-bvt-ctxallow <Allow>       Set the BVT scheduler context switch
   15.10 -                                    allowance"""
   15.11  sched_sedf_help = "sched-sedf [DOM] [OPTIONS]       Show|Set simple EDF parameters\n" + \
   15.12  "              -p, --period          Relative deadline(ms).\n\
   15.13                -s, --slice           Worst-case execution time(ms)\n\
   15.14 @@ -192,8 +188,6 @@ host_commands = [
   15.15  
   15.16  scheduler_commands = [
   15.17      "sched-credit",
   15.18 -    "sched-bvt",
   15.19 -    "sched-bvt-ctxallow",
   15.20      "sched-sedf",
   15.21      ]
   15.22  
   15.23 @@ -672,18 +666,6 @@ def xm_domname(args):
   15.24      dom = server.xend.domain(name)
   15.25      print sxp.child_value(dom, 'name')
   15.26  
   15.27 -def xm_sched_bvt(args):
   15.28 -    arg_check(args, "sched-bvt", 6)
   15.29 -    dom = args[0]
   15.30 -    v = map(long, args[1:6])
   15.31 -    server.xend.domain.cpu_bvt_set(dom, *v)
   15.32 -
   15.33 -def xm_sched_bvt_ctxallow(args):
   15.34 -    arg_check(args, "sched-bvt-ctxallow", 1)
   15.35 -
   15.36 -    slice = int(args[0])
   15.37 -    server.xend.node.cpu_bvt_slice_set(slice)
   15.38 -
   15.39  def xm_sched_sedf(args):
   15.40      def ns_to_ms(val):
   15.41          return float(val) * 0.000001
   15.42 @@ -1209,8 +1191,6 @@ commands = {
   15.43      "log": xm_log,
   15.44      "serve": xm_serve,
   15.45      # scheduler
   15.46 -    "sched-bvt": xm_sched_bvt,
   15.47 -    "sched-bvt-ctxallow": xm_sched_bvt_ctxallow,
   15.48      "sched-sedf": xm_sched_sedf,
   15.49      "sched-credit": xm_sched_credit,
   15.50      # block
    16.1 --- a/xen/arch/ia64/tools/xelilo/elilo.README	Wed Aug 23 15:02:55 2006 +0100
    16.2 +++ b/xen/arch/ia64/tools/xelilo/elilo.README	Wed Aug 23 17:14:38 2006 +0100
    16.3 @@ -17,4 +17,4 @@ 2. How to run with the new elilo.efi?
    16.4          		vmm=xen.gz
    16.5          		initrd=initrd-2.6.9-5.7.EL.img
    16.6          		read-only
    16.7 -        		append="com2=57600,8n1 console=com2 sched=bvt -- nomca console=ttyS1,57600 console=tty0 root=/dev/sda3"
    16.8 +        		append="com2=57600,8n1 console=com2 -- nomca console=ttyS1,57600 console=tty0 root=/dev/sda3"
    17.1 --- a/xen/common/Makefile	Wed Aug 23 15:02:55 2006 +0100
    17.2 +++ b/xen/common/Makefile	Wed Aug 23 17:14:38 2006 +0100
    17.3 @@ -12,7 +12,6 @@ obj-y += memory.o
    17.4  obj-y += multicall.o
    17.5  obj-y += page_alloc.o
    17.6  obj-y += rangeset.o
    17.7 -obj-y += sched_bvt.o
    17.8  obj-y += sched_credit.o
    17.9  obj-y += sched_sedf.o
   17.10  obj-y += schedule.o
    18.1 --- a/xen/common/sched_bvt.c	Wed Aug 23 15:02:55 2006 +0100
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,588 +0,0 @@
    18.4 -/****************************************************************************
    18.5 - * (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge
    18.6 - * (C) 2002-2003 University of Cambridge
    18.7 - * (C) 2004      - Mark Williamson - Intel Research Cambridge
    18.8 - ****************************************************************************
    18.9 - *
   18.10 - *        File: common/schedule.c
   18.11 - *      Author: Rolf Neugebauer & Keir Fraser
   18.12 - *              Updated for generic API by Mark Williamson
   18.13 - *
   18.14 - * Description: CPU scheduling
   18.15 - *              implements A Borrowed Virtual Time scheduler.
   18.16 - *              (see Duda & Cheriton SOSP'99)
   18.17 - */
   18.18 -
   18.19 -#include <xen/config.h>
   18.20 -#include <xen/init.h>
   18.21 -#include <xen/lib.h>
   18.22 -#include <xen/sched.h>
   18.23 -#include <xen/delay.h>
   18.24 -#include <xen/event.h>
   18.25 -#include <xen/time.h>
   18.26 -#include <xen/timer.h>
   18.27 -#include <xen/perfc.h>
   18.28 -#include <xen/sched-if.h>
   18.29 -#include <xen/softirq.h>
   18.30 -#include <xen/errno.h>
   18.31 -
   18.32 -/* all per-domain BVT-specific scheduling info is stored here */
   18.33 -struct bvt_vcpu_info
   18.34 -{
   18.35 -    struct list_head    run_list;         /* runqueue list pointers */
   18.36 -    u32                 avt;              /* actual virtual time */
   18.37 -    u32                 evt;              /* effective virtual time */
   18.38 -    int                 migrated;         /* migrated to a new CPU */
   18.39 -    struct vcpu         *vcpu;
   18.40 -    struct bvt_dom_info *inf;
   18.41 -};
   18.42 -
   18.43 -struct bvt_dom_info
   18.44 -{
   18.45 -    struct domain       *domain;          /* domain this info belongs to */
   18.46 -    u32                 mcu_advance;      /* inverse of weight */
   18.47 -    int                 warpback;         /* warp?  */
   18.48 -    int                 warp;             /* warp set and within the warp 
   18.49 -                                             limits*/
   18.50 -    s32                 warp_value;       /* virtual time warp */
   18.51 -    s_time_t            warpl;            /* warp limit */
   18.52 -    struct timer        warp_timer;       /* deals with warpl */
   18.53 -    s_time_t            warpu;            /* unwarp time requirement */
   18.54 -    struct timer        unwarp_timer;     /* deals with warpu */
   18.55 -
   18.56 -    struct bvt_vcpu_info vcpu_inf[MAX_VIRT_CPUS];
   18.57 -};
   18.58 -
   18.59 -struct bvt_cpu_info
   18.60 -{
   18.61 -    struct list_head    runqueue;
   18.62 -    unsigned long       svt;
   18.63 -};
   18.64 -
   18.65 -#define BVT_INFO(p)   ((struct bvt_dom_info *)(p)->sched_priv)
   18.66 -#define EBVT_INFO(p)  ((struct bvt_vcpu_info *)(p)->sched_priv)
   18.67 -#define CPU_INFO(cpu) \
   18.68 -    ((struct bvt_cpu_info *)(per_cpu(schedule_data, cpu).sched_priv))
   18.69 -#define RUNLIST(p)    ((struct list_head *)&(EBVT_INFO(p)->run_list))
   18.70 -#define RUNQUEUE(cpu) ((struct list_head *)&(CPU_INFO(cpu)->runqueue))
   18.71 -#define CPU_SVT(cpu)  (CPU_INFO(cpu)->svt)
   18.72 -
   18.73 -#define MCU            (s32)MICROSECS(100)    /* Minimum unit */
   18.74 -#define MCU_ADVANCE    10                     /* default weight */
   18.75 -#define TIME_SLOP      (s32)MICROSECS(50)     /* allow time to slip a bit */
   18.76 -#define CTX_MIN        (s32)MICROSECS(10)     /* Low limit for ctx_allow */
   18.77 -static s32 ctx_allow = (s32)MILLISECS(5);     /* context switch allowance */
   18.78 -
   18.79 -static inline void __add_to_runqueue_head(struct vcpu *d)
   18.80 -{
   18.81 -    list_add(RUNLIST(d), RUNQUEUE(d->processor));
   18.82 -}
   18.83 -
   18.84 -static inline void __add_to_runqueue_tail(struct vcpu *d)
   18.85 -{
   18.86 -    list_add_tail(RUNLIST(d), RUNQUEUE(d->processor));
   18.87 -}
   18.88 -
   18.89 -static inline void __del_from_runqueue(struct vcpu *d)
   18.90 -{
   18.91 -    struct list_head *runlist = RUNLIST(d);
   18.92 -    list_del(runlist);
   18.93 -    runlist->next = NULL;
   18.94 -}
   18.95 -
   18.96 -static inline int __task_on_runqueue(struct vcpu *d)
   18.97 -{
   18.98 -    return (RUNLIST(d))->next != NULL;
   18.99 -}
  18.100 -
  18.101 -
  18.102 -/* Warp/unwarp timer functions */
  18.103 -static void warp_timer_fn(void *data)
  18.104 -{
  18.105 -    struct bvt_dom_info *inf = data;
  18.106 -    struct vcpu *v = inf->domain->vcpu[0];
  18.107 -
  18.108 -    vcpu_schedule_lock_irq(v);
  18.109 -
  18.110 -    inf->warp = 0;
  18.111 -
  18.112 -    /* unwarp equal to zero => stop warping */
  18.113 -    if ( inf->warpu == 0 )
  18.114 -    {
  18.115 -        inf->warpback = 0;
  18.116 -        cpu_raise_softirq(v->processor, SCHEDULE_SOFTIRQ);   
  18.117 -    }
  18.118 -    
  18.119 -    set_timer(&inf->unwarp_timer, NOW() + inf->warpu);
  18.120 -
  18.121 -    vcpu_schedule_unlock_irq(v);
  18.122 -}
  18.123 -
  18.124 -static void unwarp_timer_fn(void *data)
  18.125 -{
  18.126 -    struct bvt_dom_info *inf = data;
  18.127 -    struct vcpu *v = inf->domain->vcpu[0];
  18.128 -
  18.129 -    vcpu_schedule_lock_irq(v);
  18.130 -
  18.131 -    if ( inf->warpback )
  18.132 -    {
  18.133 -        inf->warp = 1;
  18.134 -        cpu_raise_softirq(v->processor, SCHEDULE_SOFTIRQ);   
  18.135 -    }
  18.136 -     
  18.137 -    vcpu_schedule_unlock_irq(v);
  18.138 -}
  18.139 -
  18.140 -static inline u32 calc_avt(struct vcpu *v, s_time_t now)
  18.141 -{
  18.142 -    u32 ranfor, mcus;
  18.143 -    struct bvt_dom_info *inf = BVT_INFO(v->domain);
  18.144 -    struct bvt_vcpu_info *einf = EBVT_INFO(v);
  18.145 -    
  18.146 -    ranfor = (u32)(now - v->runstate.state_entry_time);
  18.147 -    mcus = (ranfor + MCU - 1)/MCU;
  18.148 -
  18.149 -    return einf->avt + mcus * inf->mcu_advance;
  18.150 -}
  18.151 -
  18.152 -/*
  18.153 - * Calculate the effective virtual time for a domain. Take into account 
  18.154 - * warping limits
  18.155 - */
  18.156 -static inline u32 calc_evt(struct vcpu *d, u32 avt)
  18.157 -{
  18.158 -    struct bvt_dom_info *inf = BVT_INFO(d->domain);
  18.159 -    /* TODO The warp routines need to be rewritten GM */
  18.160 - 
  18.161 -    if ( inf->warp ) 
  18.162 -        return avt - inf->warp_value;
  18.163 -    else 
  18.164 -        return avt;
  18.165 -}
  18.166 -
  18.167 -/**
  18.168 - * bvt_init_vcpu - allocate BVT private structures for a VCPU.
  18.169 - * Returns non-zero on failure.
  18.170 - */
  18.171 -static int bvt_init_vcpu(struct vcpu *v)
  18.172 -{
  18.173 -    struct domain *d = v->domain;
  18.174 -    struct bvt_dom_info *inf;
  18.175 -    struct bvt_vcpu_info *einf;
  18.176 -
  18.177 -    if ( (d->sched_priv == NULL) )
  18.178 -    {
  18.179 -        if ( (d->sched_priv = xmalloc(struct bvt_dom_info)) == NULL )
  18.180 -            return -1;
  18.181 -        memset(d->sched_priv, 0, sizeof(struct bvt_dom_info));
  18.182 -    }
  18.183 -
  18.184 -    inf = BVT_INFO(d);
  18.185 -
  18.186 -    v->sched_priv = &inf->vcpu_inf[v->vcpu_id];
  18.187 -
  18.188 -    inf->vcpu_inf[v->vcpu_id].inf  = BVT_INFO(d);
  18.189 -    inf->vcpu_inf[v->vcpu_id].vcpu = v;
  18.190 -
  18.191 -    if ( v->vcpu_id == 0 )
  18.192 -    {
  18.193 -        inf->mcu_advance = MCU_ADVANCE;
  18.194 -        inf->domain      = v->domain;
  18.195 -        inf->warpback    = 0;
  18.196 -        /* Set some default values here. */
  18.197 -        inf->warp        = 0;
  18.198 -        inf->warp_value  = 0;
  18.199 -        inf->warpl       = MILLISECS(2000);
  18.200 -        inf->warpu       = MILLISECS(1000);
  18.201 -        /* Initialise the warp timers. */
  18.202 -        init_timer(&inf->warp_timer, warp_timer_fn, inf, v->processor);
  18.203 -        init_timer(&inf->unwarp_timer, unwarp_timer_fn, inf, v->processor);
  18.204 -    }
  18.205 -
  18.206 -    einf = EBVT_INFO(v);
  18.207 -
  18.208 -    /* Allocate per-CPU context if this is the first domain to be added. */
  18.209 -    if ( CPU_INFO(v->processor) == NULL )
  18.210 -    {
  18.211 -        per_cpu(schedule_data, v->processor).sched_priv =
  18.212 -            xmalloc(struct bvt_cpu_info);
  18.213 -        BUG_ON(CPU_INFO(v->processor) == NULL);
  18.214 -        INIT_LIST_HEAD(RUNQUEUE(v->processor));
  18.215 -        CPU_SVT(v->processor) = 0;
  18.216 -    }
  18.217 -
  18.218 -    if ( is_idle_vcpu(v) )
  18.219 -    {
  18.220 -        einf->avt = einf->evt = ~0U;
  18.221 -        BUG_ON(__task_on_runqueue(v));
  18.222 -        __add_to_runqueue_head(v);
  18.223 -    }
  18.224 -    else 
  18.225 -    {
  18.226 -        /* Set avt and evt to system virtual time. */
  18.227 -        einf->avt = CPU_SVT(v->processor);
  18.228 -        einf->evt = CPU_SVT(v->processor);
  18.229 -    }
  18.230 -
  18.231 -    return 0;
  18.232 -}
  18.233 -
  18.234 -static void bvt_wake(struct vcpu *v)
  18.235 -{
  18.236 -    struct bvt_vcpu_info *einf = EBVT_INFO(v);
  18.237 -    struct vcpu  *curr;
  18.238 -    s_time_t            now, r_time;
  18.239 -    int                 cpu = v->processor;
  18.240 -    u32                 curr_evt;
  18.241 -
  18.242 -    if ( unlikely(__task_on_runqueue(v)) )
  18.243 -        return;
  18.244 -
  18.245 -    __add_to_runqueue_head(v);
  18.246 -
  18.247 -    now = NOW();
  18.248 -
  18.249 -    /* Set the BVT parameters. AVT should always be updated 
  18.250 -       if CPU migration ocurred.*/
  18.251 -    if ( (einf->avt < CPU_SVT(cpu)) || einf->migrated )
  18.252 -    {
  18.253 -        einf->avt = CPU_SVT(cpu);
  18.254 -        einf->migrated = 0;
  18.255 -    }
  18.256 -
  18.257 -    /* Deal with warping here. */
  18.258 -    einf->evt = calc_evt(v, einf->avt);
  18.259 -    
  18.260 -    curr = per_cpu(schedule_data, cpu).curr;
  18.261 -    curr_evt = calc_evt(curr, calc_avt(curr, now));
  18.262 -    /* Calculate the time the current domain would run assuming
  18.263 -       the second smallest evt is of the newly woken domain */
  18.264 -    r_time = curr->runstate.state_entry_time +
  18.265 -        ((einf->evt - curr_evt) / BVT_INFO(curr->domain)->mcu_advance) +
  18.266 -        ctx_allow;
  18.267 -
  18.268 -    if ( is_idle_vcpu(curr) || (einf->evt <= curr_evt) )
  18.269 -        cpu_raise_softirq(cpu, SCHEDULE_SOFTIRQ);
  18.270 -    else if ( per_cpu(schedule_data, cpu).s_timer.expires > r_time )
  18.271 -        set_timer(&per_cpu(schedule_data, cpu).s_timer, r_time);
  18.272 -}
  18.273 -
  18.274 -
  18.275 -static void bvt_sleep(struct vcpu *v)
  18.276 -{
  18.277 -    if ( per_cpu(schedule_data, v->processor).curr == v )
  18.278 -        cpu_raise_softirq(v->processor, SCHEDULE_SOFTIRQ);
  18.279 -    else  if ( __task_on_runqueue(v) )
  18.280 -        __del_from_runqueue(v);
  18.281 -}
  18.282 -
  18.283 -
  18.284 -static int bvt_set_affinity(struct vcpu *v, cpumask_t *affinity)
  18.285 -{
  18.286 -    if ( v == current )
  18.287 -        return cpu_isset(v->processor, *affinity) ? 0 : -EBUSY;
  18.288 -
  18.289 -    vcpu_pause(v);
  18.290 -    v->cpu_affinity = *affinity;
  18.291 -    v->processor = first_cpu(v->cpu_affinity);
  18.292 -    EBVT_INFO(v)->migrated = 1;
  18.293 -    vcpu_unpause(v);
  18.294 -
  18.295 -    return 0;
  18.296 -}
  18.297 -
  18.298 -
  18.299 -/**
  18.300 - * bvt_destroy_domain - free BVT private structures for a domain.
  18.301 - */
  18.302 -static void bvt_destroy_domain(struct domain *d)
  18.303 -{
  18.304 -    struct bvt_dom_info *inf = BVT_INFO(d);
  18.305 -
  18.306 -    ASSERT(inf != NULL);
  18.307 -
  18.308 -    kill_timer(&inf->warp_timer);
  18.309 -    kill_timer(&inf->unwarp_timer);
  18.310 -
  18.311 -    xfree(inf);
  18.312 -}
  18.313 -
  18.314 -/* Control the scheduler. */
  18.315 -static int bvt_ctl(struct sched_ctl_cmd *cmd)
  18.316 -{
  18.317 -    struct bvt_ctl *params = &cmd->u.bvt;
  18.318 -
  18.319 -    if ( cmd->direction == SCHED_INFO_PUT )
  18.320 -        ctx_allow = params->ctx_allow;
  18.321 -    else
  18.322 -    {
  18.323 -        if ( ctx_allow < CTX_MIN )
  18.324 -            ctx_allow = CTX_MIN;
  18.325 -        params->ctx_allow = ctx_allow;
  18.326 -    }
  18.327 -    
  18.328 -    return 0;
  18.329 -}
  18.330 -
  18.331 -/* Adjust scheduling parameter for a given domain. */
  18.332 -static int bvt_adjdom(
  18.333 -    struct domain *d, struct sched_adjdom_cmd *cmd)
  18.334 -{
  18.335 -    struct bvt_adjdom *params = &cmd->u.bvt;
  18.336 -    
  18.337 -    if ( cmd->direction == SCHED_INFO_PUT )
  18.338 -    {
  18.339 -        u32 mcu_adv = params->mcu_adv;
  18.340 -        u32 warpback  = params->warpback;
  18.341 -        s32 warpvalue = params->warpvalue;
  18.342 -        s_time_t warpl = params->warpl;
  18.343 -        s_time_t warpu = params->warpu;
  18.344 -        
  18.345 -        struct bvt_dom_info *inf = BVT_INFO(d);
  18.346 -        
  18.347 -        /* Sanity -- this can avoid divide-by-zero. */
  18.348 -        if ( (mcu_adv == 0) || (warpl < 0) || (warpu < 0) )
  18.349 -            return -EINVAL;
  18.350 -
  18.351 -        inf->mcu_advance = mcu_adv;
  18.352 -        inf->warpback = warpback;  
  18.353 -        /* The warp should be the same as warpback */
  18.354 -        inf->warp = warpback;
  18.355 -        inf->warp_value = warpvalue;
  18.356 -        inf->warpl = MILLISECS(warpl);
  18.357 -        inf->warpu = MILLISECS(warpu);
  18.358 -        
  18.359 -        /* If the unwarp timer set up it needs to be removed */
  18.360 -        stop_timer(&inf->unwarp_timer);
  18.361 -        /* If we stop warping the warp timer needs to be removed */
  18.362 -        if ( !warpback )
  18.363 -            stop_timer(&inf->warp_timer);
  18.364 -    }
  18.365 -    else if ( cmd->direction == SCHED_INFO_GET )
  18.366 -    {
  18.367 -        struct bvt_dom_info *inf = BVT_INFO(d);
  18.368 -        params->mcu_adv     = inf->mcu_advance;
  18.369 -        params->warpvalue   = inf->warp_value;
  18.370 -        params->warpback    = inf->warpback;
  18.371 -        params->warpl       = inf->warpl;
  18.372 -        params->warpu       = inf->warpu;
  18.373 -    }
  18.374 -    
  18.375 -    return 0;
  18.376 -}
  18.377 -
  18.378 -
  18.379 -/* 
  18.380 - * The main function
  18.381 - * - deschedule the current domain.
  18.382 - * - pick a new domain.
  18.383 - *   i.e., the domain with lowest EVT.
  18.384 - *   The runqueue should be ordered by EVT so that is easy.
  18.385 - */
  18.386 -static struct task_slice bvt_do_schedule(s_time_t now)
  18.387 -{
  18.388 -    struct domain *d;
  18.389 -    struct vcpu      *prev = current, *next = NULL, *next_prime, *ed;
  18.390 -    int                 cpu = prev->processor;
  18.391 -    s32                 r_time;     /* time for new dom to run */
  18.392 -    u32                 next_evt, next_prime_evt, min_avt;
  18.393 -    struct bvt_dom_info *prev_inf       = BVT_INFO(prev->domain);
  18.394 -    struct bvt_vcpu_info *prev_einf       = EBVT_INFO(prev);
  18.395 -    struct bvt_vcpu_info *p_einf          = NULL;
  18.396 -    struct bvt_vcpu_info *next_einf       = NULL;
  18.397 -    struct bvt_vcpu_info *next_prime_einf = NULL;
  18.398 -    struct task_slice     ret;
  18.399 -
  18.400 -    ASSERT(prev->sched_priv != NULL);
  18.401 -    ASSERT(prev_einf != NULL);
  18.402 -    ASSERT(__task_on_runqueue(prev));
  18.403 -
  18.404 -    if ( likely(!is_idle_vcpu(prev)) )
  18.405 -    {
  18.406 -        prev_einf->avt = calc_avt(prev, now);
  18.407 -        prev_einf->evt = calc_evt(prev, prev_einf->avt);
  18.408 -       
  18.409 -        if(prev_inf->warpback && prev_inf->warpl > 0)
  18.410 -            stop_timer(&prev_inf->warp_timer);
  18.411 -        
  18.412 -        __del_from_runqueue(prev);
  18.413 -        
  18.414 -        if ( vcpu_runnable(prev) )
  18.415 -            __add_to_runqueue_tail(prev);
  18.416 -    }
  18.417 -
  18.418 - 
  18.419 -    /* We should at least have the idle task */
  18.420 -    ASSERT(!list_empty(RUNQUEUE(cpu)));
  18.421 -
  18.422 -    /*
  18.423 -     * scan through the run queue and pick the task with the lowest evt
  18.424 -     * *and* the task the second lowest evt.
  18.425 -     * this code is O(n) but we expect n to be small.
  18.426 -     */
  18.427 -    next_einf       = EBVT_INFO(per_cpu(schedule_data, cpu).idle);
  18.428 -    next_prime_einf  = NULL;
  18.429 -
  18.430 -    next_evt       = ~0U;
  18.431 -    next_prime_evt = ~0U;
  18.432 -    min_avt        = ~0U;
  18.433 -
  18.434 -    list_for_each_entry ( p_einf, RUNQUEUE(cpu), run_list )
  18.435 -    {
  18.436 -        if ( p_einf->evt < next_evt )
  18.437 -        {
  18.438 -            next_prime_einf  = next_einf;
  18.439 -            next_prime_evt  = next_evt;
  18.440 -            next_einf        = p_einf;
  18.441 -            next_evt        = p_einf->evt;
  18.442 -        } 
  18.443 -        else if ( next_prime_evt == ~0U )
  18.444 -        {
  18.445 -            next_prime_evt  = p_einf->evt;
  18.446 -            next_prime_einf  = p_einf;
  18.447 -        } 
  18.448 -        else if ( p_einf->evt < next_prime_evt )
  18.449 -        {
  18.450 -            next_prime_evt  = p_einf->evt;
  18.451 -            next_prime_einf  = p_einf;
  18.452 -        }
  18.453 -
  18.454 -        /* Determine system virtual time. */
  18.455 -        if ( p_einf->avt < min_avt )
  18.456 -            min_avt = p_einf->avt;
  18.457 -    }
  18.458 -    
  18.459 -    if ( next_einf->inf->warp && next_einf->inf->warpl > 0 )
  18.460 -        set_timer(&next_einf->inf->warp_timer, now + next_einf->inf->warpl);
  18.461 -   
  18.462 -    /* Extract the domain pointers from the dom infos */
  18.463 -    next        = next_einf->vcpu;
  18.464 -    next_prime  = next_prime_einf->vcpu;
  18.465 -    
  18.466 -    /* Update system virtual time. */
  18.467 -    if ( min_avt != ~0U )
  18.468 -        CPU_SVT(cpu) = min_avt;
  18.469 -
  18.470 -    /* check for virtual time overrun on this cpu */
  18.471 -    if ( CPU_SVT(cpu) >= 0xf0000000 )
  18.472 -    {
  18.473 -        ASSERT(!local_irq_is_enabled());
  18.474 -
  18.475 -        write_lock(&domlist_lock);
  18.476 -        
  18.477 -        for_each_domain ( d )
  18.478 -        {
  18.479 -            for_each_vcpu (d, ed) {
  18.480 -                if ( ed->processor == cpu )
  18.481 -                {
  18.482 -                    p_einf = EBVT_INFO(ed);
  18.483 -                    p_einf->evt -= 0xe0000000;
  18.484 -                    p_einf->avt -= 0xe0000000;
  18.485 -                }
  18.486 -            }
  18.487 -        } 
  18.488 -        
  18.489 -        write_unlock(&domlist_lock);
  18.490 -        
  18.491 -        CPU_SVT(cpu) -= 0xe0000000;
  18.492 -    }
  18.493 -
  18.494 -    /* work out time for next run through scheduler */
  18.495 -    if ( is_idle_vcpu(next) )
  18.496 -    {
  18.497 -        r_time = ctx_allow;
  18.498 -        goto sched_done;
  18.499 -    }
  18.500 -
  18.501 -    if ( (next_prime == NULL) || is_idle_vcpu(next_prime) )
  18.502 -    {
  18.503 -        /* We have only one runnable task besides the idle task. */
  18.504 -        r_time = 10 * ctx_allow;     /* RN: random constant */
  18.505 -        goto sched_done;
  18.506 -    }
  18.507 -
  18.508 -    /*
  18.509 -     * If we are here then we have two runnable tasks.
  18.510 -     * Work out how long 'next' can run till its evt is greater than
  18.511 -     * 'next_prime's evt. Take context switch allowance into account.
  18.512 -     */
  18.513 -    ASSERT(next_prime_einf->evt >= next_einf->evt);
  18.514 -    
  18.515 -    r_time = ((next_prime_einf->evt - next_einf->evt)/next_einf->inf->mcu_advance)
  18.516 -        + ctx_allow;
  18.517 -
  18.518 -    ASSERT(r_time >= ctx_allow);
  18.519 -
  18.520 - sched_done:
  18.521 -    ret.task = next;
  18.522 -    ret.time = r_time;
  18.523 -    return ret;
  18.524 -}
  18.525 -
  18.526 -
  18.527 -static void bvt_dump_runq_el(struct vcpu *p)
  18.528 -{
  18.529 -    struct bvt_vcpu_info *inf = EBVT_INFO(p);
  18.530 -    
  18.531 -    printk("mcua=%d ev=0x%08X av=0x%08X ",
  18.532 -           inf->inf->mcu_advance, inf->evt, inf->avt);
  18.533 -}
  18.534 -
  18.535 -static void bvt_dump_settings(void)
  18.536 -{
  18.537 -    printk("BVT: mcu=0x%08Xns ctx_allow=0x%08Xns ", (u32)MCU, (s32)ctx_allow );
  18.538 -}
  18.539 -
  18.540 -static void bvt_dump_cpu_state(int i)
  18.541 -{
  18.542 -    struct list_head *queue;
  18.543 -    int loop = 0;
  18.544 -    struct bvt_vcpu_info *vcpu_inf;
  18.545 -    struct vcpu *v;
  18.546 -    
  18.547 -    printk("svt=0x%08lX ", CPU_SVT(i));
  18.548 -
  18.549 -    queue = RUNQUEUE(i);
  18.550 -    printk("QUEUE rq %lx   n: %lx, p: %lx\n",  (unsigned long)queue,
  18.551 -           (unsigned long) queue->next, (unsigned long) queue->prev);
  18.552 -
  18.553 -    list_for_each_entry ( vcpu_inf, queue, run_list )
  18.554 -    {
  18.555 -        v = vcpu_inf->vcpu;
  18.556 -        printk("%3d: %u has=%c ", loop++, v->domain->domain_id,
  18.557 -               test_bit(_VCPUF_running, &v->vcpu_flags) ? 'T':'F');
  18.558 -        bvt_dump_runq_el(v);
  18.559 -        printk("         l: %p n: %p  p: %p\n",
  18.560 -               &vcpu_inf->run_list, vcpu_inf->run_list.next,
  18.561 -               vcpu_inf->run_list.prev);
  18.562 -    }
  18.563 -}
  18.564 -
  18.565 -struct scheduler sched_bvt_def = {
  18.566 -    .name     = "Borrowed Virtual Time",
  18.567 -    .opt_name = "bvt",
  18.568 -    .sched_id = SCHED_BVT,
  18.569 -
  18.570 -    .init_vcpu      = bvt_init_vcpu,
  18.571 -    .destroy_domain = bvt_destroy_domain,
  18.572 -
  18.573 -    .do_schedule    = bvt_do_schedule,
  18.574 -    .control        = bvt_ctl,
  18.575 -    .adjdom         = bvt_adjdom,
  18.576 -    .dump_settings  = bvt_dump_settings,
  18.577 -    .dump_cpu_state = bvt_dump_cpu_state,
  18.578 -    .sleep          = bvt_sleep,
  18.579 -    .wake           = bvt_wake,
  18.580 -    .set_affinity   = bvt_set_affinity
  18.581 -};
  18.582 -
  18.583 -/*
  18.584 - * Local variables:
  18.585 - * mode: C
  18.586 - * c-set-style: "BSD"
  18.587 - * c-basic-offset: 4
  18.588 - * tab-width: 4
  18.589 - * indent-tabs-mode: nil
  18.590 - * End:
  18.591 - */
    19.1 --- a/xen/common/schedule.c	Wed Aug 23 15:02:55 2006 +0100
    19.2 +++ b/xen/common/schedule.c	Wed Aug 23 17:14:38 2006 +0100
    19.3 @@ -49,11 +49,9 @@ static void poll_timer_fn(void *data);
    19.4  /* This is global for now so that private implementations can reach it */
    19.5  DEFINE_PER_CPU(struct schedule_data, schedule_data);
    19.6  
    19.7 -extern struct scheduler sched_bvt_def;
    19.8  extern struct scheduler sched_sedf_def;
    19.9  extern struct scheduler sched_credit_def;
   19.10  static struct scheduler *schedulers[] = { 
   19.11 -    &sched_bvt_def,
   19.12      &sched_sedf_def,
   19.13      &sched_credit_def,
   19.14      NULL
    20.1 --- a/xen/include/public/sched_ctl.h	Wed Aug 23 15:02:55 2006 +0100
    20.2 +++ b/xen/include/public/sched_ctl.h	Wed Aug 23 17:14:38 2006 +0100
    20.3 @@ -8,7 +8,6 @@
    20.4  #define __XEN_PUBLIC_SCHED_CTL_H__
    20.5  
    20.6  /* Scheduler types. */
    20.7 -#define SCHED_BVT      0
    20.8  #define SCHED_SEDF     4
    20.9  #define SCHED_CREDIT   5
   20.10  
   20.11 @@ -23,11 +22,6 @@
   20.12  struct sched_ctl_cmd {
   20.13      uint32_t sched_id;
   20.14      uint32_t direction;
   20.15 -    union {
   20.16 -        struct bvt_ctl {
   20.17 -            uint32_t ctx_allow;
   20.18 -        } bvt;
   20.19 -    } u;
   20.20  };
   20.21  
   20.22  struct sched_adjdom_cmd {
   20.23 @@ -35,13 +29,6 @@ struct sched_adjdom_cmd {
   20.24      uint32_t direction;
   20.25      domid_t  domain;
   20.26      union {
   20.27 -        struct bvt_adjdom {
   20.28 -            uint32_t mcu_adv;      /* mcu advance: inverse of weight */
   20.29 -            uint32_t warpback;     /* warp? */
   20.30 -            int32_t  warpvalue;    /* warp value */
   20.31 -            int64_t  warpl;        /* warp limit */
   20.32 -            int64_t  warpu;        /* unwarp time requirement */
   20.33 -        } bvt;
   20.34          struct sedf_adjdom {
   20.35              uint64_t period;
   20.36              uint64_t slice;