aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/sched_sedf.c
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-17 11:00:46 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-17 11:00:46 +0100
commite21b3a393ee99da58409979f082fef6e799249fc (patch)
tree6cf9b6fa5b876ffb57094c1aaccc8adc50ed513c /xen/common/sched_sedf.c
parentfceb225f85d97343d575bec253bd465e9e499d31 (diff)
downloadxen-e21b3a393ee99da58409979f082fef6e799249fc.tar.gz
xen-e21b3a393ee99da58409979f082fef6e799249fc.tar.bz2
xen-e21b3a393ee99da58409979f082fef6e799249fc.zip
Fix sched_sedf adjdom to properly clamp the period max value.
Remove temporary debug tracing. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/sched_sedf.c')
-rw-r--r--xen/common/sched_sedf.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index 2fa363ba24..6e216195a8 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -57,11 +57,9 @@
#define WEIGHT_PERIOD (MILLISECS(100))
#define WEIGHT_SAFETY (MILLISECS(5))
-/* FIXME: need to validate that these are sane */
-#define PERIOD_MAX ULONG_MAX
-#define PERIOD_MIN (MICROSECS(10))
-#define SLICE_MAX ULONG_MAX
-#define SLICE_MIN (MICROSECS(5))
+#define PERIOD_MAX MILLISECS(10000) /* 10s */
+#define PERIOD_MIN (MICROSECS(10)) /* 10us */
+#define SLICE_MIN (MICROSECS(5)) /* 5us */
#define IMPLY(a, b) (!(a) || (b))
#define EQ(a, b) ((!!(a)) == (!!(b)))
@@ -585,11 +583,6 @@ static void update_queues(
curinf->deadl_abs +=
DIV_UP(now - curinf->deadl_abs,
curinf->period) * curinf->period;
- if (unlikely(curinf->deadl_abs < now))
- printk("Fatal scheduler error: %"PRIu64" %"PRIu64" %"PRIu64
- " diff=%"PRIu64"\n",
- curinf->deadl_abs, now, curinf->period,
- now - curinf->deadl_abs);
ASSERT(curinf->deadl_abs >= now);
/*give a fresh slice*/
curinf->cputime = 0;
@@ -1622,9 +1615,8 @@ static int sedf_adjdom(struct domain *p, struct sched_adjdom_cmd *cmd)
*/
if ( (cmd->u.sedf.period > PERIOD_MAX) ||
(cmd->u.sedf.period < PERIOD_MIN) ||
- (cmd->u.sedf.slice > SLICE_MAX) ||
- (cmd->u.sedf.slice < SLICE_MIN) ||
- (cmd->u.sedf.slice > cmd->u.sedf.period) )
+ (cmd->u.sedf.slice > cmd->u.sedf.period) ||
+ (cmd->u.sedf.slice < SLICE_MIN) )
return -EINVAL;
EDOM_INFO(v)->weight = 0;
EDOM_INFO(v)->extraweight = 0;