aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-04-01 10:22:12 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-04-01 10:22:12 +0000
commitfb1742bf301fbb46ed8c7cfa066f1877e0277624 (patch)
treec438c9bcca28741dc1ac2af53abdfc9acb4224cd
parent56903d7fa69e6a4203bff8f220777eee00636634 (diff)
downloadxen-fb1742bf301fbb46ed8c7cfa066f1877e0277624.tar.gz
xen-fb1742bf301fbb46ed8c7cfa066f1877e0277624.tar.bz2
xen-fb1742bf301fbb46ed8c7cfa066f1877e0277624.zip
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.
-rw-r--r--xen/arch/i386/irq.c3
-rw-r--r--xen/common/event_channel.c9
-rw-r--r--xen/common/page_alloc.c9
-rw-r--r--xen/common/sched_atropos.c20
4 files changed, 25 insertions, 16 deletions
diff --git a/xen/arch/i386/irq.c b/xen/arch/i386/irq.c
index 30735e0324..f09590b7a2 100644
--- a/xen/arch/i386/irq.c
+++ b/xen/arch/i386/irq.c
@@ -1033,7 +1033,8 @@ int pirq_guest_bind(struct task_struct *p, int irq, int will_share)
}
else if ( !will_share || !action->shareable )
{
- DPRINTK("Cannot bind IRQ %d to guest. Will not share with others.\n");
+ DPRINTK("Cannot bind IRQ %d to guest. Will not share with others.\n",
+ irq);
rc = -EBUSY;
goto out;
}
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 216a794f5b..c0bea86320 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -370,6 +370,7 @@ static long evtchn_status(evtchn_status_t *status)
domid_t dom = status->dom;
int port = status->port;
event_channel_t *chn;
+ long rc = 0;
if ( dom == DOMID_SELF )
dom = current->domain;
@@ -385,8 +386,8 @@ static long evtchn_status(evtchn_status_t *status)
if ( (port < 0) || (port >= p->max_event_channel) )
{
- spin_unlock(&p->event_channel_lock);
- return -EINVAL;
+ rc = -EINVAL;
+ goto out;
}
switch ( chn[port].state )
@@ -414,8 +415,10 @@ static long evtchn_status(evtchn_status_t *status)
BUG();
}
+ out:
spin_unlock(&p->event_channel_lock);
- return 0;
+ put_task_struct(p);
+ return rc;
}
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index ba9c29dd44..adef28ea32 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -280,12 +280,12 @@ retry:
spin_lock_irqsave(&alloc_lock, flags);
/* Find smallest order which can satisfy the request. */
- for ( i = order; i < FREELIST_SIZE; i++ ) {
+ for ( i = order; i < FREELIST_SIZE; i++ )
if ( !FREELIST_EMPTY(i) )
break;
- }
- if ( i == FREELIST_SIZE ) goto no_memory;
+ if ( i == FREELIST_SIZE )
+ goto no_memory;
/* Unlink a chunk. */
alloc_ch = free_head[i];
@@ -327,9 +327,10 @@ retry:
return((unsigned long)alloc_ch);
no_memory:
+ spin_unlock_irqrestore(&alloc_lock, flags);
+
if ( attempts++ < 8 )
{
- spin_unlock_irqrestore(&alloc_lock, flags);
kmem_cache_reap(0);
goto retry;
}
diff --git a/xen/common/sched_atropos.c b/xen/common/sched_atropos.c
index 1a5fd792aa..0a40d9c8ea 100644
--- a/xen/common/sched_atropos.c
+++ b/xen/common/sched_atropos.c
@@ -14,6 +14,9 @@
* these modifications are (C) 2004 Intel Research Cambridge
*/
+#include <xen/config.h>
+#include <xen/init.h>
+#include <xen/lib.h>
#include <xen/time.h>
#include <xen/sched.h>
#include <xen/sched-if.h>
@@ -31,9 +34,9 @@
struct at_dom_info
{
/* MAW Xen additions */
- struct task_struct *owner; /* the struct task_struct this data belongs to */
- struct list_head waitq; /* wait queue */
- int reason; /* reason domain was last scheduled */
+ struct task_struct *owner; /* the task_struct this data belongs to */
+ struct list_head waitq; /* wait queue */
+ int reason; /* reason domain was last scheduled */
/* (what remains of) the original fields */
@@ -112,8 +115,9 @@ static void requeue(struct task_struct *sdom)
prev = WAITQ(sdom->processor);
list_for_each(next, WAITQ(sdom->processor))
{
- struct at_dom_info *i = list_entry(next, struct at_dom_info, waitq);
- if( i->deadline > inf->deadline )
+ struct at_dom_info *i =
+ list_entry(next, struct at_dom_info, waitq);
+ if ( i->deadline > inf->deadline )
{
__list_add(&inf->waitq, prev, next);
break;
@@ -124,10 +128,10 @@ static void requeue(struct task_struct *sdom)
/* put the domain on the end of the list if it hasn't been put
* elsewhere */
- if ( next == WAITQ(sdom->processor))
+ if ( next == WAITQ(sdom->processor) )
list_add_tail(&inf->waitq, WAITQ(sdom->processor));
}
- else if(sdom->state == TASK_RUNNING)
+ else if ( sdom->state == TASK_RUNNING )
{
/* insert into ordered run queue */
prev = RUNQ(sdom->processor);
@@ -471,7 +475,7 @@ task_slice_t ksched_scheduler(s_time_t time)
cur_sdom->min_slice = newtime - time;
DOM_INFO(cur_sdom)->reason = reason;
- TRACE_2D(0, cur_sdom->domain >> 32, (u32)cur_sdom->domain);
+ TRACE_2D(0, (cur_sdom->domain >> 32), ((u32)cur_sdom->domain));
return ret;
}