From e64781ccf8852ebfbb62a11a02112b0ccffaa600 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Thu, 26 Apr 2012 17:45:05 -0400 Subject: sched_color: Fixed two bugs causing crashing on experiment restart and a rare race condition --- include/litmus/color.h | 4 ++-- litmus/sched_color.c | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/litmus/color.h b/include/litmus/color.h index 8f66bf50d5b7..cdf34b649a6d 100644 --- a/include/litmus/color.h +++ b/include/litmus/color.h @@ -1,8 +1,8 @@ #ifndef LITMUS_COLOR_H #define LITMUS_COLOR_H -#define NUM_COLORS 10 -#define NUM_WAYS 5 +#define NUM_COLORS 64 +#define NUM_WAYS 12 int color_server_params(int cpu, unsigned long *wcet, unsigned long *period); diff --git a/litmus/sched_color.c b/litmus/sched_color.c index d5408c645644..98a46bb1b06f 100644 --- a/litmus/sched_color.c +++ b/litmus/sched_color.c @@ -71,7 +71,10 @@ static void requeue(rt_domain_t *dom, struct task_struct* t) return; TRACE_TASK(t, "Requeueing\n"); - BUG_ON(is_queued(t)); + if (is_queued(t)) { + TRACE_TASK(t, "Already queued!\n"); + return; + } set_rt_flags(t, RT_F_RUNNING); if (is_released(t, litmus_clock())) @@ -343,7 +346,9 @@ static void fifo_update(struct rt_server *server) schedule_server(&fserver->server); /* Reserve needed resources */ + raw_spin_lock(&dgl_lock); acquire_resources(fserver->task); + raw_spin_unlock(&dgl_lock); } } -- cgit v1.2.2