ia64/xen-unstable

changeset 651:aceefe65b9e5

bitkeeper revision 1.367 (3f1bb7dbrM3DzLAPUm9gAy85tZTqDw)

Merge wyvis.research:/home/irchomes/rneugeba/src/xeno/xeno.bk
into wyvis.research:/home/irchomes/rneugeba/src/xeno/xeno.sched
author rneugeba@wyvis.research
date Mon Jul 21 09:52:27 2003 +0000 (2003-07-21)
parents 9080b9366dbc acb99181f4d3
children a7bfe57ca27f
files BitKeeper/etc/logging_ok xen/common/schedule.c xen/include/xeno/sched.h
line diff
     1.1 --- a/BitKeeper/etc/logging_ok	Fri Jul 18 15:03:00 2003 +0000
     1.2 +++ b/BitKeeper/etc/logging_ok	Mon Jul 21 09:52:27 2003 +0000
     1.3 @@ -19,6 +19,7 @@ rac61@labyrinth.cl.cam.ac.uk
     1.4  rgr22@boulderdash.cl.cam.ac.uk
     1.5  rn@wyvis.camb.intel-research.net
     1.6  rn@wyvis.research.intel-research.net
     1.7 +rneugeba@wyvis.research
     1.8  rneugeba@wyvis.research.intel-research.net
     1.9  smh22@boulderdash.cl.cam.ac.uk
    1.10  smh22@labyrinth.cl.cam.ac.uk
     2.1 --- a/xen/common/schedule.c	Fri Jul 18 15:03:00 2003 +0000
     2.2 +++ b/xen/common/schedule.c	Mon Jul 21 09:52:27 2003 +0000
     2.3 @@ -315,7 +315,7 @@ asmlinkage void schedule(void)
     2.4  
     2.5      now = NOW();
     2.6  
     2.7 -    /* remove timer, if till on list  */
     2.8 +    /* remove timer, if still on list  */
     2.9      rem_ac_timer(&schedule_data[this_cpu].s_timer);
    2.10  
    2.11      /* deschedule the current domain */
    2.12 @@ -383,7 +383,6 @@ asmlinkage void schedule(void)
    2.13      next_prime_evt = 0xffffffff;
    2.14      min_avt        = 0xffffffff;    /* to calculate svt */
    2.15  
    2.16 -
    2.17      list_for_each(tmp, &schedule_data[this_cpu].runqueue) {
    2.18          p = list_entry(tmp, struct task_struct, run_list);
    2.19          if (p->evt < next_evt) {
    2.20 @@ -407,6 +406,22 @@ asmlinkage void schedule(void)
    2.21      /* update system virtual time  */
    2.22      if (min_avt != 0xffffffff) schedule_data[this_cpu].svt = min_avt;
    2.23  
    2.24 +    /* check for virtual time overrun on this cpu */
    2.25 +    if (schedule_data[this_cpu].svt >= 0xf0000000) {
    2.26 +        u_long t_flags; 
    2.27 +        write_lock_irqsave(&tasklist_lock, t_flags); 
    2.28 +        p = &idle0_task;
    2.29 +        do {
    2.30 +            if (p->processor == this_cpu && !is_idle_task(p)) {
    2.31 +                p->evt -= 0xe0000000;
    2.32 +                p->avt -= 0xe0000000;
    2.33 +            }
    2.34 +        } while ( (p = p->next_task) != &idle0_task );
    2.35 +        write_unlock_irqrestore(&tasklist_lock, t_flags); 
    2.36 +        schedule_data[this_cpu].svt -= 0xe0000000;
    2.37 +    }
    2.38 +
    2.39 +    /* work out time for next run through scheduler */
    2.40      if (is_idle_task(next)) {
    2.41          r_time = ctx_allow;
    2.42          goto sched_done;
    2.43 @@ -450,6 +465,7 @@ asmlinkage void schedule(void)
    2.44  
    2.45      spin_unlock_irq(&schedule_data[this_cpu].lock);
    2.46  
    2.47 +    /* done, switch tasks */
    2.48      if ( unlikely(prev == next) )
    2.49      {
    2.50          /* We won't go through the normal tail, so do this by hand */
     3.1 --- a/xen/include/xeno/sched.h	Fri Jul 18 15:03:00 2003 +0000
     3.2 +++ b/xen/include/xeno/sched.h	Mon Jul 21 09:52:27 2003 +0000
     3.3 @@ -115,8 +115,8 @@ struct task_struct
     3.4      s_time_t wokenup;               /* time domain got woken up */
     3.5  
     3.6      unsigned long mcu_advance;      /* inverse of weight */
     3.7 -    s32  avt;                       /* actual virtual time */
     3.8 -    s32  evt;                       /* effective virtual time */
     3.9 +    u32  avt;                       /* actual virtual time */
    3.10 +    u32  evt;                       /* effective virtual time */
    3.11      int  warpback;                  /* warp?  */
    3.12      long warp;                      /* virtual time warp */
    3.13      long warpl;                     /* warp limit */