ia64/xen-unstable

changeset 2100:ff029926ccf1

bitkeeper revision 1.1156 (411361dclImK_wtDjHbbaA9eclPocg)

Polishing up the warping mechanism in bvt
author gm281@boulderdash.cl.cam.ac.uk
date Fri Aug 06 10:47:56 2004 +0000 (2004-08-06)
parents b6006dac0b1a
children 1d27d2477ab7
files xen/common/sched_bvt.c
line diff
     1.1 --- a/xen/common/sched_bvt.c	Fri Aug 06 09:35:45 2004 +0000
     1.2 +++ b/xen/common/sched_bvt.c	Fri Aug 06 10:47:56 2004 +0000
     1.3 @@ -111,7 +111,6 @@ static void warp_timer_fn(unsigned long 
     1.4      
     1.5      /* set unwarp timer */
     1.6      inf->unwarp_timer.expires = NOW() + inf->warpu;
     1.7 -    rem_ac_timer(&inf->unwarp_timer);
     1.8      add_ac_timer(&inf->unwarp_timer);
     1.9      spin_unlock_irqrestore(&CPU_INFO(inf->domain->processor)->run_lock, flags);
    1.10  
    1.11 @@ -362,14 +361,23 @@ int bvt_adjdom(struct domain *p,
    1.12          
    1.13          struct bvt_dom_info *inf = BVT_INFO(p);
    1.14          
    1.15 -        DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d"
    1.16 +        DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d, "
    1.17                  "warpl=%lld, warpu=%lld\n",
    1.18                  p->domain, inf->mcu_advance, inf->warpback, inf->warp_value,
    1.19                  inf->warpl, inf->warpu);
    1.20  
    1.21          /* Sanity -- this can avoid divide-by-zero. */
    1.22          if ( mcu_adv == 0 )
    1.23 +        {
    1.24 +            printk("Mcu advance must not be set to 0 (domain %d)\n",p->domain);
    1.25              return -EINVAL;
    1.26 +        }
    1.27 +        else if ( warpl < 0 || warpu < 0)
    1.28 +        {
    1.29 +            printk("Warp limits must be >= 0 (domain %d)\n", p->domain);
    1.30 +            return -EINVAL;
    1.31 +        }
    1.32 +        
    1.33          
    1.34          spin_lock_irqsave(&CPU_INFO(p->processor)->run_lock, flags);   
    1.35          inf->mcu_advance = mcu_adv;
    1.36 @@ -377,14 +385,20 @@ int bvt_adjdom(struct domain *p,
    1.37          /* The warp should be the same as warpback */
    1.38          inf->warp = warpback;
    1.39          inf->warp_value = warpvalue;
    1.40 -        inf->warpl = warpl;
    1.41 -        inf->warpu = warpu;
    1.42 -
    1.43 -        DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d"
    1.44 -                "warpl=%lld, warpu=%lld, values(%lld, %lld)\n",
    1.45 +        inf->warpl = MILLISECS(warpl);
    1.46 +        inf->warpu = MILLISECS(warpu);
    1.47 +        
    1.48 +        /* If the unwarp timer set up it needs to be removed */
    1.49 +        rem_ac_timer(&inf->unwarp_timer);
    1.50 +        /* If we stop warping the warp timer needs to be removed */
    1.51 +        if(!warpback)
    1.52 +            rem_ac_timer(&inf->warp_timer);
    1.53 +        
    1.54 +        DPRINTK("Get domain %u bvt mcu_adv=%u, warpback=%d, warpvalue=%d, "
    1.55 +                "warpl=%lld, warpu=%lld\n",
    1.56                  p->domain, inf->mcu_advance, inf->warpback, inf->warp_value,
    1.57 -                inf->warpl, inf->warpu, warpl, warpu);
    1.58 -
    1.59 +                inf->warpl, inf->warpu);
    1.60 +                
    1.61          spin_unlock_irqrestore(&CPU_INFO(p->processor)->run_lock, flags);
    1.62      }
    1.63      else if ( cmd->direction == SCHED_INFO_GET )