aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2012-04-26 17:45:05 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2012-04-26 17:45:05 -0400
commite64781ccf8852ebfbb62a11a02112b0ccffaa600 (patch)
treed1e99010ccc0614b9c4a320b11a50375552e9b07
parenta030ea79736cd5aa4aef9800f7ce689fbcab5970 (diff)
sched_color: Fixed two bugs causing crashing on experiment restart and a rare race conditionwip-color-jlh
-rw-r--r--include/litmus/color.h4
-rw-r--r--litmus/sched_color.c7
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 @@
1#ifndef LITMUS_COLOR_H 1#ifndef LITMUS_COLOR_H
2#define LITMUS_COLOR_H 2#define LITMUS_COLOR_H
3 3
4#define NUM_COLORS 10 4#define NUM_COLORS 64
5#define NUM_WAYS 5 5#define NUM_WAYS 12
6 6
7int color_server_params(int cpu, unsigned long *wcet, unsigned long *period); 7int color_server_params(int cpu, unsigned long *wcet, unsigned long *period);
8 8
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)
71 return; 71 return;
72 72
73 TRACE_TASK(t, "Requeueing\n"); 73 TRACE_TASK(t, "Requeueing\n");
74 BUG_ON(is_queued(t)); 74 if (is_queued(t)) {
75 TRACE_TASK(t, "Already queued!\n");
76 return;
77 }
75 78
76 set_rt_flags(t, RT_F_RUNNING); 79 set_rt_flags(t, RT_F_RUNNING);
77 if (is_released(t, litmus_clock())) 80 if (is_released(t, litmus_clock()))
@@ -343,7 +346,9 @@ static void fifo_update(struct rt_server *server)
343 schedule_server(&fserver->server); 346 schedule_server(&fserver->server);
344 347
345 /* Reserve needed resources */ 348 /* Reserve needed resources */
349 raw_spin_lock(&dgl_lock);
346 acquire_resources(fserver->task); 350 acquire_resources(fserver->task);
351 raw_spin_unlock(&dgl_lock);
347 } 352 }
348} 353}
349 354