direct-io.hg

changeset 2179:d7ed6fd183db

bitkeeper revision 1.1159.17.5 (4119385aTLA7Shj5_vrBcoAQ3-zimg)

Cset exclude: gm281@boulderdash.cl.cam.ac.uk|ChangeSet|20040810153437|54233
author kaf24@scramble.cl.cam.ac.uk
date Tue Aug 10 21:04:26 2004 +0000 (2004-08-10)
parents 2362ecf749a8
children dc3ac4b676dd
files tools/examples/xmdefaults tools/examples/xmexample tools/libxc/xc.h tools/libxc/xc_domain.c tools/python/xen/lowlevel/xc/xc.c tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xm/create.py xen/arch/x86/smpboot.c xen/common/dom0_ops.c xen/common/domain.c xen/common/kernel.c xen/common/sched_atropos.c xen/common/sched_bvt.c xen/common/sched_fair_bvt.c xen/common/sched_rrobin.c xen/common/schedule.c xen/include/hypervisor-ifs/dom0_ops.h xen/include/xen/sched-if.h xen/include/xen/sched.h
line diff
     1.1 --- a/tools/examples/xmdefaults	Tue Aug 10 20:51:19 2004 +0000
     1.2 +++ b/tools/examples/xmdefaults	Tue Aug 10 21:04:26 2004 +0000
     1.3 @@ -25,10 +25,6 @@ name = "ExampleDomain"
     1.4  
     1.5  # Which CPU to start domain on? 
     1.6  #cpu = -1   # leave to Xen to pick
     1.7 -# The weight (CPU share) of the domain. Works with all
     1.8 -# schedulers that have notion of weight (eg BVT). 
     1.9 -# Default is 1. Float values can be used.
    1.10 -#weight = 1.5
    1.11  
    1.12  #----------------------------------------------------------------------------
    1.13  # Define network interfaces.
     2.1 --- a/tools/examples/xmexample	Tue Aug 10 20:51:19 2004 +0000
     2.2 +++ b/tools/examples/xmexample	Tue Aug 10 21:04:26 2004 +0000
     2.3 @@ -55,10 +55,6 @@ name = "VM%d" % vmid
     2.4  # Which CPU to start domain on? 
     2.5  #cpu = -1   # leave to Xen to pick
     2.6  cpu = vmid  # set based on vmid (mod number of CPUs)
     2.7 -# The weight (CPU share) of the domain. Works with all
     2.8 -# schedulers that have notion of weight (eg BVT). 
     2.9 -# Default is 1. Float values can be used.
    2.10 -#weight = 1.5
    2.11  
    2.12  #----------------------------------------------------------------------------
    2.13  # Define network interfaces.
     3.1 --- a/tools/libxc/xc.h	Tue Aug 10 20:51:19 2004 +0000
     3.2 +++ b/tools/libxc/xc.h	Tue Aug 10 21:04:26 2004 +0000
     3.3 @@ -48,7 +48,6 @@ int xc_domain_create(int xc_handle,
     3.4                       unsigned int mem_kb, 
     3.5                       const char *name,
     3.6                       int cpu,
     3.7 -                     float weight,
     3.8                       u32 *pdomid);
     3.9  int xc_domain_pause(int xc_handle, 
    3.10                      u32 domid);
     4.1 --- a/tools/libxc/xc_domain.c	Tue Aug 10 20:51:19 2004 +0000
     4.2 +++ b/tools/libxc/xc_domain.c	Tue Aug 10 21:04:26 2004 +0000
     4.3 @@ -12,7 +12,6 @@ int xc_domain_create(int xc_handle,
     4.4                       unsigned int mem_kb, 
     4.5                       const char *name,
     4.6                       int cpu,
     4.7 -                     float weight,
     4.8                       u32 *pdomid)
     4.9  {
    4.10      int err;
    4.11 @@ -21,8 +20,6 @@ int xc_domain_create(int xc_handle,
    4.12      op.cmd = DOM0_CREATEDOMAIN;
    4.13      op.u.createdomain.domain = (domid_t)*pdomid;
    4.14      op.u.createdomain.memory_kb = mem_kb;
    4.15 -    /* The weight of a domain added to the domain creation code */
    4.16 -    op.u.createdomain.weight = weight;
    4.17      strncpy(op.u.createdomain.name, name, MAX_DOMAIN_NAME);
    4.18      op.u.createdomain.name[MAX_DOMAIN_NAME-1] = '\0';
    4.19      op.u.createdomain.cpu = cpu;
     5.1 --- a/tools/python/xen/lowlevel/xc/xc.c	Tue Aug 10 20:51:19 2004 +0000
     5.2 +++ b/tools/python/xen/lowlevel/xc/xc.c	Tue Aug 10 21:04:26 2004 +0000
     5.3 @@ -44,19 +44,16 @@ static PyObject *pyxc_domain_create(PyOb
     5.4      unsigned int mem_kb = 0;
     5.5      char        *name   = "(anon)";
     5.6      int          cpu = -1;
     5.7 -    float        weight;
     5.8      u32          dom = 0;
     5.9      int          ret;
    5.10  
    5.11 -    static char *kwd_list[] = { "dom", "mem_kb", "name", "cpu", "weight",
    5.12 -                                                                        NULL };
    5.13 +    static char *kwd_list[] = { "dom", "mem_kb", "name", "cpu", NULL };
    5.14  
    5.15 -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iisif", kwd_list, 
    5.16 -                                      &dom, &mem_kb, &name, &cpu, &weight) )
    5.17 +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iisi", kwd_list, 
    5.18 +                                      &dom, &mem_kb, &name, &cpu) )
    5.19          return NULL;
    5.20 -        
    5.21 -    if ( (ret = xc_domain_create(xc->xc_handle, mem_kb, name, cpu, 
    5.22 -                                                     weight, &dom)) < 0 )
    5.23 +
    5.24 +    if ( (ret = xc_domain_create(xc->xc_handle, mem_kb, name, cpu, &dom)) < 0 )
    5.25          return PyErr_SetFromErrno(xc_error);
    5.26  
    5.27      return PyInt_FromLong(dom);
     6.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Aug 10 20:51:19 2004 +0000
     6.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Aug 10 21:04:26 2004 +0000
     6.3 @@ -486,7 +486,6 @@ class XendDomainInfo:
     6.4          self.config = config
     6.5          try:
     6.6              self.name = sxp.child_value(config, 'name')
     6.7 -            self.weight = float(sxp.child_value(config, 'weight'))
     6.8              self.check_name(self.name)
     6.9              self.memory = int(sxp.child_value(config, 'memory'))
    6.10              if self.memory is None:
    6.11 @@ -706,10 +705,9 @@ class XendDomainInfo:
    6.12              return
    6.13          memory = self.memory
    6.14          name = self.name
    6.15 -        weight = self.weight
    6.16          cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
    6.17          dom = self.dom or 0
    6.18 -        dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, name= name, cpu= cpu, weight= weight)
    6.19 +        dom = xc.domain_create(dom= dom, mem_kb= memory * 1024, name= name, cpu= cpu)
    6.20          if dom <= 0:
    6.21              raise VmError('Creating domain failed: name=%s memory=%d'
    6.22                            % (name, memory))
    6.23 @@ -1139,7 +1137,6 @@ add_device_handler('pci',  vm_dev_pci)
    6.24  add_config_handler('name',    vm_field_ignore)
    6.25  add_config_handler('memory',  vm_field_ignore)
    6.26  add_config_handler('cpu',     vm_field_ignore)
    6.27 -add_config_handler('weight',  vm_field_ignore)
    6.28  add_config_handler('console', vm_field_ignore)
    6.29  add_config_handler('image',   vm_field_ignore)
    6.30  add_config_handler('device',  vm_field_ignore)
     7.1 --- a/tools/python/xen/xm/create.py	Tue Aug 10 20:51:19 2004 +0000
     7.2 +++ b/tools/python/xen/xm/create.py	Tue Aug 10 21:04:26 2004 +0000
     7.3 @@ -97,10 +97,6 @@ gopts.var('memory', val='MEMORY',
     7.4            fn=set_value, default=128,
     7.5            use="Domain memory in MB.")
     7.6  
     7.7 -gopts.var('weight', val='WEIGHT',
     7.8 -          fn=set_value, default=1,
     7.9 -          use="Domain cpu weight (default=1).")
    7.10 -
    7.11  gopts.var('console', val='PORT',
    7.12            fn=set_int, default=None,
    7.13            use="Console port to use. Default is 9600 + domain id.")
    7.14 @@ -299,8 +295,7 @@ def make_config(vals):
    7.15      
    7.16      config = ['vm',
    7.17                ['name', vals.name ],
    7.18 -              ['memory', vals.memory ],
    7.19 -              ['weight', vals.weight] ]
    7.20 +              ['memory', vals.memory ] ]
    7.21      if vals.cpu:
    7.22          config.append(['cpu', vals.cpu])
    7.23      if vals.blkif:
     8.1 --- a/xen/arch/x86/smpboot.c	Tue Aug 10 20:51:19 2004 +0000
     8.2 +++ b/xen/arch/x86/smpboot.c	Tue Aug 10 21:04:26 2004 +0000
     8.3 @@ -650,7 +650,7 @@ static void __init do_boot_cpu (int apic
     8.4  
     8.5      cpu = ++cpucount;
     8.6  
     8.7 -    if ( (idle = do_createdomain(IDLE_DOMAIN_ID, cpu, 0)) == NULL )
     8.8 +    if ( (idle = do_createdomain(IDLE_DOMAIN_ID, cpu)) == NULL )
     8.9          panic("failed 'createdomain' for CPU %d", cpu);
    8.10  
    8.11      set_bit(DF_IDLETASK, &idle->flags);
     9.1 --- a/xen/common/dom0_ops.c	Tue Aug 10 20:51:19 2004 +0000
     9.2 +++ b/xen/common/dom0_ops.c	Tue Aug 10 21:04:26 2004 +0000
     9.3 @@ -182,9 +182,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     9.4              pro = op->u.createdomain.cpu % smp_num_cpus;
     9.5  
     9.6          ret = -ENOMEM;
     9.7 -        if ( (d = do_createdomain(dom, pro, op->u.createdomain.weight))==NULL)
     9.8 +        if ( (d = do_createdomain(dom, pro)) == NULL )
     9.9              break;
    9.10 -        
    9.11 +
    9.12          if ( op->u.createdomain.name[0] )
    9.13          {
    9.14              strncpy(d->name, op->u.createdomain.name, MAX_DOMAIN_NAME);
    10.1 --- a/xen/common/domain.c	Tue Aug 10 20:51:19 2004 +0000
    10.2 +++ b/xen/common/domain.c	Tue Aug 10 21:04:26 2004 +0000
    10.3 @@ -22,7 +22,7 @@ rwlock_t tasklist_lock __cacheline_align
    10.4  struct domain *task_hash[TASK_HASH_SIZE];
    10.5  struct domain *task_list;
    10.6  
    10.7 -struct domain *do_createdomain(domid_t dom_id, unsigned int cpu, float weight)
    10.8 +struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
    10.9  {
   10.10      char buf[100];
   10.11      struct domain *d, **pd;
   10.12 @@ -69,7 +69,7 @@ struct domain *do_createdomain(domid_t d
   10.13          spin_lock_init(&d->pcidev_lock);
   10.14          INIT_LIST_HEAD(&d->pcidev_list);
   10.15  
   10.16 -        sched_add_domain(d, weight);
   10.17 +        sched_add_domain(d);
   10.18  
   10.19          write_lock_irqsave(&tasklist_lock, flags);
   10.20          pd = &task_list; /* NB. task_list is maintained in order of dom_id. */
   10.21 @@ -85,7 +85,7 @@ struct domain *do_createdomain(domid_t d
   10.22      else
   10.23      {
   10.24          sprintf(d->name, "Idle-%d", cpu);
   10.25 -        sched_add_domain(d, weight);
   10.26 +        sched_add_domain(d);
   10.27      }
   10.28  
   10.29      return d;
    11.1 --- a/xen/common/kernel.c	Tue Aug 10 20:51:19 2004 +0000
    11.2 +++ b/xen/common/kernel.c	Tue Aug 10 21:04:26 2004 +0000
    11.3 @@ -306,7 +306,7 @@ void cmain(multiboot_info_t *mbi)
    11.4      task_hash[TASK_HASH(IDLE_DOMAIN_ID)] = &idle0_task;
    11.5  
    11.6      /* Create initial domain 0. */
    11.7 -    new_dom = do_createdomain(0, 0, 1);
    11.8 +    new_dom = do_createdomain(0, 0);
    11.9      if ( new_dom == NULL )
   11.10          panic("Error creating domain 0\n");
   11.11  
    12.1 --- a/xen/common/sched_atropos.c	Tue Aug 10 20:51:19 2004 +0000
    12.2 +++ b/xen/common/sched_atropos.c	Tue Aug 10 21:04:26 2004 +0000
    12.3 @@ -167,10 +167,8 @@ static void requeue(struct domain *sdom)
    12.4       * - they shouldn't be on any queue */
    12.5  }
    12.6  
    12.7 -/* prepare a task to be added to scheduling 
    12.8 -    TODO - can weight argument can be used to set up the 
    12.9 -    scheduling parameters? */
   12.10 -static void at_add_task(struct domain *p, float weight)
   12.11 +/* prepare a task to be added to scheduling */
   12.12 +static void at_add_task(struct domain *p)
   12.13  {
   12.14      s_time_t now = NOW();
   12.15  
    13.1 --- a/xen/common/sched_bvt.c	Tue Aug 10 20:51:19 2004 +0000
    13.2 +++ b/xen/common/sched_bvt.c	Tue Aug 10 21:04:26 2004 +0000
    13.3 @@ -180,16 +180,13 @@ int bvt_alloc_task(struct domain *p)
    13.4  /*
    13.5   * Add and remove a domain
    13.6   */
    13.7 -void bvt_add_task(struct domain *p, float weight) 
    13.8 +void bvt_add_task(struct domain *p) 
    13.9  {
   13.10      struct bvt_dom_info *inf = BVT_INFO(p);
   13.11      ASSERT(inf != NULL);
   13.12      ASSERT(p   != NULL);
   13.13  
   13.14 -    if(weight > 0)
   13.15 -        inf->mcu_advance = MCU_ADVANCE / weight;
   13.16 -    else
   13.17 -        inf->mcu_advance = MCU_ADVANCE;
   13.18 +    inf->mcu_advance = MCU_ADVANCE;
   13.19      inf->domain = p;
   13.20      inf->warpback    = 0;
   13.21      /* Set some default values here. */
   13.22 @@ -227,7 +224,7 @@ int bvt_init_idle_task(struct domain *p)
   13.23  
   13.24      if(bvt_alloc_task(p) < 0) return -1;
   13.25  
   13.26 -    bvt_add_task(p, 0);
   13.27 +    bvt_add_task(p);
   13.28  
   13.29      spin_lock_irqsave(&CPU_INFO(p->processor)->run_lock, flags);
   13.30      
    14.1 --- a/xen/common/sched_fair_bvt.c	Tue Aug 10 20:51:19 2004 +0000
    14.2 +++ b/xen/common/sched_fair_bvt.c	Tue Aug 10 21:04:26 2004 +0000
    14.3 @@ -152,17 +152,14 @@ int fbvt_alloc_task(struct domain *p)
    14.4  /*
    14.5   * Add and remove a domain
    14.6   */
    14.7 -void fbvt_add_task(struct domain *p, float weight) 
    14.8 +void fbvt_add_task(struct domain *p) 
    14.9  {
   14.10      struct fbvt_dom_info *inf = FBVT_INFO(p);
   14.11  
   14.12      ASSERT(inf != NULL);
   14.13      ASSERT(p   != NULL);
   14.14  
   14.15 -    if(weight > 0)
   14.16 -        inf->mcu_advance = MCU_ADVANCE / weight;
   14.17 -    else
   14.18 -        inf->mcu_advance = MCU_ADVANCE;
   14.19 +    inf->mcu_advance = MCU_ADVANCE;
   14.20      inf->domain = p;
   14.21      if ( p->domain == IDLE_DOMAIN_ID )
   14.22      {
   14.23 @@ -190,7 +187,7 @@ int fbvt_init_idle_task(struct domain *p
   14.24  
   14.25      if(fbvt_alloc_task(p) < 0) return -1;
   14.26  
   14.27 -    fbvt_add_task(p, 0);
   14.28 +    fbvt_add_task(p);
   14.29      spin_lock_irqsave(&CPU_INFO(p->processor)->run_lock, flags);
   14.30      set_bit(DF_RUNNING, &p->flags);
   14.31      if ( !__task_on_runqueue(p) )
    15.1 --- a/xen/common/sched_rrobin.c	Tue Aug 10 20:51:19 2004 +0000
    15.2 +++ b/xen/common/sched_rrobin.c	Tue Aug 10 21:04:26 2004 +0000
    15.3 @@ -101,9 +101,8 @@ static int rr_alloc_task(struct domain *
    15.4     return 0;
    15.5  }
    15.6  
    15.7 -/* Setup the rr_dom_info 
    15.8 -   The weight argument is ignored as RRobin does not use weights */
    15.9 -static void rr_add_task(struct domain *p, float weight)
   15.10 +/* Setup the rr_dom_info */
   15.11 +static void rr_add_task(struct domain *p)
   15.12  {
   15.13      struct rrobin_dom_info *inf;
   15.14      RR_INFO(p)->domain = p;
   15.15 @@ -122,7 +121,7 @@ static int rr_init_idle_task(struct doma
   15.16  {
   15.17      unsigned long flags;
   15.18      if(rr_alloc_task(p) < 0) return -1;
   15.19 -    rr_add_task(p, 0);
   15.20 +    rr_add_task(p);
   15.21  
   15.22      spin_lock_irqsave(&run_locks[p->processor], flags);
   15.23      set_bit(DF_RUNNING, &p->flags);
    16.1 --- a/xen/common/schedule.c	Tue Aug 10 20:51:19 2004 +0000
    16.2 +++ b/xen/common/schedule.c	Tue Aug 10 21:04:26 2004 +0000
    16.3 @@ -123,7 +123,7 @@ struct domain *alloc_domain_struct(void)
    16.4  /*
    16.5   * Add and remove a domain
    16.6   */
    16.7 -void sched_add_domain(struct domain *d, float weight) 
    16.8 +void sched_add_domain(struct domain *d) 
    16.9  {
   16.10      /* Must be unpaused by control software to start execution. */
   16.11      set_bit(DF_CTRLPAUSE, &d->flags);
   16.12 @@ -141,7 +141,7 @@ void sched_add_domain(struct domain *d, 
   16.13          schedule_data[d->processor].idle = d;
   16.14      }
   16.15  
   16.16 -    SCHED_OP(add_task, d, weight);
   16.17 +    SCHED_OP(add_task, d);
   16.18  
   16.19      TRACE_2D(TRC_SCHED_DOM_ADD, d->domain, d);
   16.20  }
    17.1 --- a/xen/include/hypervisor-ifs/dom0_ops.h	Tue Aug 10 20:51:19 2004 +0000
    17.2 +++ b/xen/include/hypervisor-ifs/dom0_ops.h	Tue Aug 10 21:04:26 2004 +0000
    17.3 @@ -55,7 +55,7 @@ typedef struct {
    17.4      MEMORY_PADDING;
    17.5      u8           name[MAX_DOMAIN_NAME]; /*  8 */
    17.6      u32          cpu;                 /* 24 */
    17.7 -    float        weight;              /* 28 */
    17.8 +    u32          __pad0;              /* 28 */
    17.9      /* IN/OUT parameters. */
   17.10      /* If 0, domain is allocated. If non-zero use it unless in use. */
   17.11      domid_t      domain;              /* 32 */
    18.1 --- a/xen/include/xen/sched-if.h	Tue Aug 10 20:51:19 2004 +0000
    18.2 +++ b/xen/include/xen/sched-if.h	Tue Aug 10 21:04:26 2004 +0000
    18.3 @@ -38,7 +38,7 @@ struct scheduler
    18.4      int          (*init_scheduler) ();
    18.5      int          (*init_idle_task) (struct domain *);
    18.6      int          (*alloc_task)     (struct domain *);
    18.7 -    void         (*add_task)       (struct domain *, float weight);
    18.8 +    void         (*add_task)       (struct domain *);
    18.9      void         (*free_task)      (struct domain *);
   18.10      void         (*rem_task)       (struct domain *);
   18.11      void         (*sleep)          (struct domain *);
    19.1 --- a/xen/include/xen/sched.h	Tue Aug 10 20:51:19 2004 +0000
    19.2 +++ b/xen/include/xen/sched.h	Tue Aug 10 21:04:26 2004 +0000
    19.3 @@ -171,7 +171,7 @@ static inline int get_domain(struct doma
    19.4  }
    19.5    
    19.6  extern struct domain *do_createdomain(
    19.7 -    domid_t dom_id, unsigned int cpu, float weight);
    19.8 +    domid_t dom_id, unsigned int cpu);
    19.9  extern int construct_dom0(struct domain *d, 
   19.10                            unsigned long alloc_start,
   19.11                            unsigned long alloc_end,
   19.12 @@ -198,7 +198,7 @@ extern unsigned long wait_init_idle;
   19.13  #define set_current_state(_s) do { current->state = (_s); } while (0)
   19.14  void scheduler_init(void);
   19.15  void schedulers_start(void);
   19.16 -void sched_add_domain(struct domain *d, float weight);
   19.17 +void sched_add_domain(struct domain *d);
   19.18  void sched_rem_domain(struct domain *d);
   19.19  long sched_ctl(struct sched_ctl_cmd *);
   19.20  long sched_adjdom(struct sched_adjdom_cmd *);