ia64/xen-unstable

changeset 9308:03d7b5b2c212

Fix sched_sedf adjdom to properly clamp the period max value.
Remove temporary debug tracing.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Mar 17 11:00:46 2006 +0100 (2006-03-17)
parents b8640cd55fd7
children eceb7ffe1e67
files xen/common/sched_sedf.c
line diff
     1.1 --- a/xen/common/sched_sedf.c	Fri Mar 17 10:57:28 2006 +0100
     1.2 +++ b/xen/common/sched_sedf.c	Fri Mar 17 11:00:46 2006 +0100
     1.3 @@ -57,11 +57,9 @@
     1.4  #define WEIGHT_PERIOD (MILLISECS(100))
     1.5  #define WEIGHT_SAFETY (MILLISECS(5))
     1.6  
     1.7 -/* FIXME: need to validate that these are sane */
     1.8 -#define PERIOD_MAX ULONG_MAX
     1.9 -#define PERIOD_MIN (MICROSECS(10))
    1.10 -#define SLICE_MAX ULONG_MAX
    1.11 -#define SLICE_MIN (MICROSECS(5))
    1.12 +#define PERIOD_MAX MILLISECS(10000) /* 10s  */
    1.13 +#define PERIOD_MIN (MICROSECS(10))  /* 10us */
    1.14 +#define SLICE_MIN (MICROSECS(5))    /*  5us */
    1.15  
    1.16  #define IMPLY(a, b) (!(a) || (b))
    1.17  #define EQ(a, b) ((!!(a)) == (!!(b)))
    1.18 @@ -585,11 +583,6 @@ static void update_queues(
    1.19                  curinf->deadl_abs += 
    1.20                      DIV_UP(now - curinf->deadl_abs,
    1.21                             curinf->period) * curinf->period;
    1.22 -            if (unlikely(curinf->deadl_abs < now))
    1.23 -                printk("Fatal scheduler error: %"PRIu64" %"PRIu64" %"PRIu64
    1.24 -                       " diff=%"PRIu64"\n",
    1.25 -                       curinf->deadl_abs, now, curinf->period,
    1.26 -                       now - curinf->deadl_abs);
    1.27              ASSERT(curinf->deadl_abs >= now);
    1.28              /*give a fresh slice*/
    1.29              curinf->cputime = 0;
    1.30 @@ -1622,9 +1615,8 @@ static int sedf_adjdom(struct domain *p,
    1.31                   */
    1.32                  if ( (cmd->u.sedf.period > PERIOD_MAX) ||
    1.33                       (cmd->u.sedf.period < PERIOD_MIN) ||
    1.34 -                     (cmd->u.sedf.slice  > SLICE_MAX)  ||
    1.35 -                     (cmd->u.sedf.slice  < SLICE_MIN)  ||
    1.36 -                     (cmd->u.sedf.slice > cmd->u.sedf.period) )
    1.37 +                     (cmd->u.sedf.slice  > cmd->u.sedf.period) ||
    1.38 +                     (cmd->u.sedf.slice  < SLICE_MIN) )
    1.39                      return -EINVAL;
    1.40                  EDOM_INFO(v)->weight = 0;
    1.41                  EDOM_INFO(v)->extraweight = 0;