aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrn@wyvis.research.intel-research.net <rn@wyvis.research.intel-research.net>2003-03-16 12:02:49 +0000
committerrn@wyvis.research.intel-research.net <rn@wyvis.research.intel-research.net>2003-03-16 12:02:49 +0000
commitee0a177847e4c4cfed0ba02458ab07cd86e40775 (patch)
treeabbfec3319dec17fc3684a2af15b3b35e7cdaffa
parent93615cf27306fc9d8ae7e1302e76d0c9704dd082 (diff)
downloadxen-ee0a177847e4c4cfed0ba02458ab07cd86e40775.tar.gz
xen-ee0a177847e4c4cfed0ba02458ab07cd86e40775.tar.bz2
xen-ee0a177847e4c4cfed0ba02458ab07cd86e40775.zip
bitkeeper revision 1.136.2.1 (3e7467e94A_D2ld8HeK-7FkHLGPCjg)
minor tweak to schedule()
-rw-r--r--xen/common/schedule.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 3ef29e3c5c..5a9a6c9611 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -249,11 +249,16 @@ asmlinkage void schedule(void)
need_resched_back:
perfc_incrc(sched_run2);
- now = NOW();
- next = NULL;
+
prev = current;
+ next = NULL;
+
this_cpu = prev->processor;
+ spin_lock_irq(&schedule_data[this_cpu].lock);
+
+ now = NOW();
+
/* remove timer */
rem_ac_timer(&schedule_data[this_cpu].s_timer);
@@ -261,11 +266,10 @@ asmlinkage void schedule(void)
* deschedule the current domain
*/
- spin_lock_irq(&schedule_data[this_cpu].lock);
-
ASSERT(!in_interrupt());
ASSERT(__task_on_runqueue(prev));
+
if (is_idle_task(prev))
goto deschedule_done;
@@ -363,14 +367,14 @@ asmlinkage void schedule(void)
* work out how long 'next' can run till its evt is greater than
* 'next_prime's evt. Taking context switch allowance into account.
*/
- ASSERT(next_prime->evt > next->evt);
+ ASSERT(next_prime->evt >= next->evt);
r_time = ((next_prime->evt - next->evt)/next->mcu_advance) + ctx_allow;
sched_done:
ASSERT(r_time != 0);
- ASSERT(r_time > ctx_allow);
+ ASSERT(r_time >= ctx_allow);
-#if 0
+#ifndef NDEBUG
if ( (r_time==0) || (r_time < ctx_allow)) {
printk("[%02d]: %lx\n", this_cpu, r_time);
dump_rqueue(&schedule_data[this_cpu].runqueue, "foo");
@@ -389,7 +393,8 @@ asmlinkage void schedule(void)
timer_redo:
schedule_data[this_cpu].s_timer.expires = now + r_time;
if (add_ac_timer(&schedule_data[this_cpu].s_timer) == 1) {
- printk("SCHED[%02d]: Shit this shouldn't happen\n", this_cpu);
+ printk("SCHED[%02d]: Shit this shouldn't happen r_time=%lu\n",
+ this_cpu, r_time);
now = NOW();
goto timer_redo;
}