ia64/xen-unstable

changeset 318:74019ac2d6ba

bitkeeper revision 1.136.2.1 (3e7467e94A_D2ld8HeK-7FkHLGPCjg)

minor tweak to schedule()
author rn@wyvis.research.intel-research.net
date Sun Mar 16 12:02:49 2003 +0000 (2003-03-16)
parents 48cd5a789e4b
children e081ed2ebcd0
files xen/common/schedule.c
line diff
     1.1 --- a/xen/common/schedule.c	Sun Mar 16 00:18:30 2003 +0000
     1.2 +++ b/xen/common/schedule.c	Sun Mar 16 12:02:49 2003 +0000
     1.3 @@ -249,11 +249,16 @@ asmlinkage void schedule(void)
     1.4   need_resched_back:
     1.5      perfc_incrc(sched_run2);
     1.6  
     1.7 -    now = NOW();
     1.8 +
     1.9 +    prev = current;
    1.10      next = NULL;
    1.11 -    prev = current;
    1.12 +
    1.13      this_cpu = prev->processor;
    1.14  
    1.15 +    spin_lock_irq(&schedule_data[this_cpu].lock);
    1.16 +
    1.17 +    now = NOW();
    1.18 +
    1.19      /* remove timer  */
    1.20      rem_ac_timer(&schedule_data[this_cpu].s_timer);
    1.21  
    1.22 @@ -261,11 +266,10 @@ asmlinkage void schedule(void)
    1.23       * deschedule the current domain
    1.24       */
    1.25  
    1.26 -    spin_lock_irq(&schedule_data[this_cpu].lock);
    1.27 -
    1.28      ASSERT(!in_interrupt());
    1.29      ASSERT(__task_on_runqueue(prev));
    1.30  
    1.31 +
    1.32      if (is_idle_task(prev)) 
    1.33          goto deschedule_done;
    1.34  
    1.35 @@ -363,14 +367,14 @@ asmlinkage void schedule(void)
    1.36       * work out how long 'next' can run till its evt is greater than
    1.37       * 'next_prime's evt. Taking context switch allowance into account.
    1.38       */
    1.39 -    ASSERT(next_prime->evt > next->evt);
    1.40 +    ASSERT(next_prime->evt >= next->evt);
    1.41      r_time = ((next_prime->evt - next->evt)/next->mcu_advance) + ctx_allow;
    1.42  
    1.43   sched_done:
    1.44      ASSERT(r_time != 0);
    1.45 -    ASSERT(r_time > ctx_allow);
    1.46 +    ASSERT(r_time >= ctx_allow);
    1.47  
    1.48 -#if 0
    1.49 +#ifndef NDEBUG
    1.50      if ( (r_time==0) || (r_time < ctx_allow)) {
    1.51          printk("[%02d]: %lx\n", this_cpu, r_time);
    1.52          dump_rqueue(&schedule_data[this_cpu].runqueue, "foo");
    1.53 @@ -389,7 +393,8 @@ asmlinkage void schedule(void)
    1.54   timer_redo:
    1.55      schedule_data[this_cpu].s_timer.expires  = now + r_time;
    1.56      if (add_ac_timer(&schedule_data[this_cpu].s_timer) == 1) {
    1.57 -        printk("SCHED[%02d]: Shit this shouldn't happen\n", this_cpu);
    1.58 +        printk("SCHED[%02d]: Shit this shouldn't happen r_time=%lu\n", 
    1.59 +               this_cpu, r_time);
    1.60          now = NOW();
    1.61          goto timer_redo;
    1.62      }