aboutsummaryrefslogtreecommitdiffstats
path: root/litmus
diff options
context:
space:
mode:
Diffstat (limited to 'litmus')
-rw-r--r--litmus/rt_domain.c1
-rw-r--r--litmus/sched_mc.c42
2 files changed, 12 insertions, 31 deletions
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c
index 81a5ac16f164..fd0e6c235e1b 100644
--- a/litmus/rt_domain.c
+++ b/litmus/rt_domain.c
@@ -304,6 +304,7 @@ void __add_ready(rt_domain_t* rt, struct task_struct *new)
304 304
305 BUG_ON(bheap_node_in_heap(tsk_rt(new)->heap_node)); 305 BUG_ON(bheap_node_in_heap(tsk_rt(new)->heap_node));
306 306
307 new->rt_param.domain = rt;
307 bheap_insert(rt->order, &rt->ready_queue, tsk_rt(new)->heap_node); 308 bheap_insert(rt->order, &rt->ready_queue, tsk_rt(new)->heap_node);
308 rt->check_resched(rt); 309 rt->check_resched(rt);
309} 310}
diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c
index 0bad4516ba50..457bd2a94a29 100644
--- a/litmus/sched_mc.c
+++ b/litmus/sched_mc.c
@@ -238,33 +238,6 @@ static void mc_edf_domain_init(rt_domain_t* rt, check_resched_needed_t resched,
238 rt_domain_init(rt, mc_edf_ready_order, resched, release); 238 rt_domain_init(rt, mc_edf_ready_order, resched, release);
239} 239}
240 240
241
242/* END clone of edf_common.c*/
243
244/* Return the domain of a task */
245static rt_domain_t* domain_of(struct task_struct* task)
246{
247 switch (tsk_mc_crit(task))
248 {
249 case CRIT_LEVEL_A:
250 return remote_a_queue(get_partition(task));
251 break;
252 case CRIT_LEVEL_B:
253 return remote_b_queue(get_partition(task));
254 break;
255 case CRIT_LEVEL_C:
256 return &crit_c;
257 break;
258 case CRIT_LEVEL_D:
259 return &crit_d;
260 break;
261 case NUM_CRIT_LEVELS:
262 default:
263 /*Should never get here*/
264 BUG();
265 }
266}
267
268#define WANT_ALL_SCHED_EVENTS 241#define WANT_ALL_SCHED_EVENTS
269 242
270/* Called by update_cpu_position and lowest_prio_cpu in bheap operations 243/* Called by update_cpu_position and lowest_prio_cpu in bheap operations
@@ -586,7 +559,7 @@ static noinline void unlink(struct task_struct* t)
586 * case. 559 * case.
587 */ 560 */
588 TRACE("Weird is_queued situation happened\n"); 561 TRACE("Weird is_queued situation happened\n");
589 remove(domain_of(t), t); 562 remove(tsk_rt(t)->domain, t);
590 } 563 }
591} 564}
592 565
@@ -612,10 +585,10 @@ static noinline void requeue(struct task_struct* task)
612 BUG_ON(is_queued(task)); 585 BUG_ON(is_queued(task));
613 586
614 if (is_released(task, litmus_clock())) 587 if (is_released(task, litmus_clock()))
615 __add_ready(domain_of(task), task); 588 __add_ready(tsk_rt(task)->domain, task);
616 else { 589 else {
617 /* it has got to wait */ 590 /* it has got to wait */
618 add_release(domain_of(task), task); 591 add_release(tsk_rt(task)->domain, task);
619 } 592 }
620} 593}
621 594
@@ -1078,15 +1051,22 @@ static void mc_finish_switch(struct task_struct *prev)
1078 * No lock required by caller 1051 * No lock required by caller
1079 * Obtains lock and calls mc_job_arrival before releasing lock 1052 * Obtains lock and calls mc_job_arrival before releasing lock
1080 */ 1053 */
1081static void mc_task_new(struct task_struct * t, int on_rq, int running) 1054static void mc_task_new(struct task_struct *t, int on_rq, int running)
1082{ 1055{
1083 unsigned long flags; 1056 unsigned long flags;
1084 cpu_entry_t* entry; 1057 cpu_entry_t* entry;
1058 enum crit_level lvl;
1085 1059
1086 TRACE("mixed crit: task new %d\n", t->pid); 1060 TRACE("mixed crit: task new %d\n", t->pid);
1087 1061
1088 raw_spin_lock_irqsave(&global_lock, flags); 1062 raw_spin_lock_irqsave(&global_lock, flags);
1089 1063
1064 lvl = tsk_mc_crit(t);
1065 t->rt_param.domain =
1066 (lvl == CRIT_LEVEL_A) ? remote_a_queue(get_partition(t)) :
1067 (lvl == CRIT_LEVEL_B) ? remote_b_queue(get_partition(t)) :
1068 (lvl == CRIT_LEVEL_C) ? &crit_c : &crit_d;
1069
1090 /* setup job params */ 1070 /* setup job params */
1091 release_at(t, litmus_clock()); 1071 release_at(t, litmus_clock());
1092 tsk_mc_data(t)->mc_job.ghost_budget = 0; 1072 tsk_mc_data(t)->mc_job.ghost_budget = 0;