ia64/xen-unstable

changeset 1266:9c5521fa1195

bitkeeper revision 1.825.3.22 (406bed54_kfGyHK4C9Lf4xDiVaaG6A)

sched_atropos.c, page_alloc.c, event_channel.c, irq.c:
Fix task_struct refcnt bug. Fix compile warnings in debug builds.
author kaf24@scramble.cl.cam.ac.uk
date Thu Apr 01 10:22:12 2004 +0000 (2004-04-01)
parents 421b35ded78b
children 5864a35a6c29
files xen/arch/i386/irq.c xen/common/event_channel.c xen/common/page_alloc.c xen/common/sched_atropos.c
line diff
     1.1 --- a/xen/arch/i386/irq.c	Thu Apr 01 09:22:54 2004 +0000
     1.2 +++ b/xen/arch/i386/irq.c	Thu Apr 01 10:22:12 2004 +0000
     1.3 @@ -1033,7 +1033,8 @@ int pirq_guest_bind(struct task_struct *
     1.4      }
     1.5      else if ( !will_share || !action->shareable )
     1.6      {
     1.7 -        DPRINTK("Cannot bind IRQ %d to guest. Will not share with others.\n");
     1.8 +        DPRINTK("Cannot bind IRQ %d to guest. Will not share with others.\n",
     1.9 +                irq);
    1.10          rc = -EBUSY;
    1.11          goto out;
    1.12      }
     2.1 --- a/xen/common/event_channel.c	Thu Apr 01 09:22:54 2004 +0000
     2.2 +++ b/xen/common/event_channel.c	Thu Apr 01 10:22:12 2004 +0000
     2.3 @@ -370,6 +370,7 @@ static long evtchn_status(evtchn_status_
     2.4      domid_t             dom = status->dom;
     2.5      int                 port = status->port;
     2.6      event_channel_t    *chn;
     2.7 +    long                rc = 0;
     2.8  
     2.9      if ( dom == DOMID_SELF )
    2.10          dom = current->domain;
    2.11 @@ -385,8 +386,8 @@ static long evtchn_status(evtchn_status_
    2.12  
    2.13      if ( (port < 0) || (port >= p->max_event_channel) )
    2.14      {
    2.15 -        spin_unlock(&p->event_channel_lock);
    2.16 -        return -EINVAL;
    2.17 +        rc = -EINVAL;
    2.18 +        goto out;
    2.19      }
    2.20  
    2.21      switch ( chn[port].state )
    2.22 @@ -414,8 +415,10 @@ static long evtchn_status(evtchn_status_
    2.23          BUG();
    2.24      }
    2.25  
    2.26 + out:
    2.27      spin_unlock(&p->event_channel_lock);
    2.28 -    return 0;
    2.29 +    put_task_struct(p);
    2.30 +    return rc;
    2.31  }
    2.32  
    2.33  
     3.1 --- a/xen/common/page_alloc.c	Thu Apr 01 09:22:54 2004 +0000
     3.2 +++ b/xen/common/page_alloc.c	Thu Apr 01 10:22:12 2004 +0000
     3.3 @@ -280,12 +280,12 @@ retry:
     3.4      spin_lock_irqsave(&alloc_lock, flags);
     3.5  
     3.6      /* Find smallest order which can satisfy the request. */
     3.7 -    for ( i = order; i < FREELIST_SIZE; i++ ) {
     3.8 +    for ( i = order; i < FREELIST_SIZE; i++ )
     3.9  	if ( !FREELIST_EMPTY(i) ) 
    3.10  	    break;
    3.11 -    }
    3.12  
    3.13 -    if ( i == FREELIST_SIZE ) goto no_memory;
    3.14 +    if ( i == FREELIST_SIZE ) 
    3.15 +        goto no_memory;
    3.16   
    3.17      /* Unlink a chunk. */
    3.18      alloc_ch = free_head[i];
    3.19 @@ -327,9 +327,10 @@ retry:
    3.20      return((unsigned long)alloc_ch);
    3.21  
    3.22   no_memory:
    3.23 +    spin_unlock_irqrestore(&alloc_lock, flags);
    3.24 +        
    3.25      if ( attempts++ < 8 )
    3.26      {
    3.27 -        spin_unlock_irqrestore(&alloc_lock, flags);
    3.28          kmem_cache_reap(0);
    3.29          goto retry;
    3.30      }
     4.1 --- a/xen/common/sched_atropos.c	Thu Apr 01 09:22:54 2004 +0000
     4.2 +++ b/xen/common/sched_atropos.c	Thu Apr 01 10:22:12 2004 +0000
     4.3 @@ -14,6 +14,9 @@
     4.4   * these modifications are (C) 2004 Intel Research Cambridge
     4.5   */
     4.6  
     4.7 +#include <xen/config.h>
     4.8 +#include <xen/init.h>
     4.9 +#include <xen/lib.h>
    4.10  #include <xen/time.h>
    4.11  #include <xen/sched.h>
    4.12  #include <xen/sched-if.h>
    4.13 @@ -31,9 +34,9 @@
    4.14  struct at_dom_info
    4.15  {
    4.16      /* MAW Xen additions */
    4.17 -    struct task_struct *owner; /* the struct task_struct this data belongs to */
    4.18 -    struct list_head waitq;    /* wait queue                                  */
    4.19 -    int reason;                /* reason domain was last scheduled            */
    4.20 +    struct task_struct *owner; /* the task_struct this data belongs to */
    4.21 +    struct list_head waitq;    /* wait queue                           */
    4.22 +    int reason;                /* reason domain was last scheduled     */
    4.23  
    4.24      /* (what remains of) the original fields */
    4.25  
    4.26 @@ -112,8 +115,9 @@ static void requeue(struct task_struct *
    4.27          prev = WAITQ(sdom->processor);
    4.28          list_for_each(next, WAITQ(sdom->processor))
    4.29          {
    4.30 -            struct at_dom_info *i = list_entry(next, struct at_dom_info, waitq);
    4.31 -            if( i->deadline > inf->deadline )
    4.32 +            struct at_dom_info *i = 
    4.33 +                list_entry(next, struct at_dom_info, waitq);
    4.34 +            if ( i->deadline > inf->deadline )
    4.35              {
    4.36                  __list_add(&inf->waitq, prev, next);
    4.37                  break;
    4.38 @@ -124,10 +128,10 @@ static void requeue(struct task_struct *
    4.39  
    4.40          /* put the domain on the end of the list if it hasn't been put
    4.41           * elsewhere */
    4.42 -        if ( next == WAITQ(sdom->processor))
    4.43 +        if ( next == WAITQ(sdom->processor) )
    4.44              list_add_tail(&inf->waitq, WAITQ(sdom->processor));
    4.45      }
    4.46 -    else if(sdom->state == TASK_RUNNING)
    4.47 +    else if ( sdom->state == TASK_RUNNING )
    4.48      {
    4.49          /* insert into ordered run queue */
    4.50          prev = RUNQ(sdom->processor);
    4.51 @@ -471,7 +475,7 @@ task_slice_t ksched_scheduler(s_time_t t
    4.52      cur_sdom->min_slice = newtime - time;
    4.53      DOM_INFO(cur_sdom)->reason = reason;
    4.54  
    4.55 -    TRACE_2D(0, cur_sdom->domain >> 32, (u32)cur_sdom->domain);
    4.56 +    TRACE_2D(0, (cur_sdom->domain >> 32), ((u32)cur_sdom->domain));
    4.57   
    4.58      return ret;
    4.59  }