aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMac Mollison <mollison@cs.unc.edu>2010-11-06 11:20:23 -0400
committerMac Mollison <mollison@cs.unc.edu>2010-11-06 11:20:23 -0400
commitf4cf77b8fc657b153bfbf3158213fb6bc07f22c5 (patch)
treebc0e3acebb57a65a960f5026884f5470528554b1
parentc1994855d96f6614a60a6b0f1b0a940f16bce96d (diff)
Minor changes
-rw-r--r--litmus/sched_mc.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/litmus/sched_mc.c b/litmus/sched_mc.c
index 5ad386f66c18..aff5018c8bcc 100644
--- a/litmus/sched_mc.c
+++ b/litmus/sched_mc.c
@@ -182,13 +182,13 @@ static int mc_edf_ready_order(struct bheap_node* a, struct bheap_node* b)
182static void mc_edf_domain_init(rt_domain_t* rt, check_resched_needed_t resched, 182static void mc_edf_domain_init(rt_domain_t* rt, check_resched_needed_t resched,
183 release_jobs_t release) 183 release_jobs_t release)
184{ 184{
185 rt_domain_init(rt, mc_edf_ready_order, resched, release); 185 rt_domain_init(rt, mc_edf_ready_order, resched, release);
186} 186}
187 187
188 188
189/* END clone of edf_common.c*/ 189/* END clone of edf_common.c*/
190 190
191static rt_domain_t *proper_domain(struct task_struct* task) 191static rt_domain_t* proper_domain(struct task_struct* task)
192{ 192{
193 switch (task->rt_param.task_params.crit) 193 switch (task->rt_param.task_params.crit)
194 { 194 {
@@ -200,8 +200,10 @@ static rt_domain_t *proper_domain(struct task_struct* task)
200 break; 200 break;
201 case 2: 201 case 2:
202 return &crit_c; 202 return &crit_c;
203 break;
203 case 3: 204 case 3:
204 return &crit_d; 205 return &crit_d;
206 break;
205 default: 207 default:
206 /*Should never get here*/ 208 /*Should never get here*/
207 BUG(); 209 BUG();
@@ -357,9 +359,6 @@ static noinline void requeue(struct task_struct* task)
357 BUG_ON(!task || !is_realtime(task)); 359 BUG_ON(!task || !is_realtime(task));
358 /* sanity check before insertion */ 360 /* sanity check before insertion */
359 BUG_ON(is_queued(task)); 361 BUG_ON(is_queued(task));
360 /* Should never call on a level A task.*/
361 /*Allowing this for now*/
362/* BUG_ON(task->rt_param.task_params.crit == CRIT_LEVEL_A);*/
363 362
364 if (is_released(task, litmus_clock())) 363 if (is_released(task, litmus_clock()))
365 __add_ready(proper_domain(task), task); 364 __add_ready(proper_domain(task), task);
@@ -428,16 +427,16 @@ static void check_for_a_preemption(cpu_entry_t* entry)
428} 427}
429 428
430/* Check for level B preemption*/ 429/* Check for level B preemption*/
431static void check_for_pedf_preemption(cpu_entry_t* entry) 430static void check_for_b_preemption(cpu_entry_t* entry)
432{ 431{
433 struct task_struct *task; 432 struct task_struct *task;
434 rt_domain_t *queue; 433 rt_domain_t *queue;
435 434
436 queue = remote_b_queue(entry->cpu); 435 queue = remote_b_queue(entry->cpu);
437 TRACE("check_for_pedf_preemption triggered\n"); 436 TRACE("check_for_b_preemption triggered\n");
438 if (mc_edf_preemption_needed(queue, entry->linked)) { 437 if (mc_edf_preemption_needed(queue, entry->linked)) {
439 task = __take_ready(queue); 438 task = __take_ready(queue);
440 TRACE("check_for_pedf_preemption: attempting to link task %d to %d\n", 439 TRACE("check_for_b_preemption: attempting to link task %d to %d\n",
441 task->pid, entry->cpu); 440 task->pid, entry->cpu);
442 if (entry->linked) 441 if (entry->linked)
443 requeue(entry->linked); 442 requeue(entry->linked);
@@ -458,7 +457,7 @@ static noinline void mc_job_arrival(struct task_struct* task)
458 check_for_a_preemption(remote_cpu_entry(get_partition(task))); 457 check_for_a_preemption(remote_cpu_entry(get_partition(task)));
459 } 458 }
460 else if (task->rt_param.task_params.crit == CRIT_LEVEL_B){ 459 else if (task->rt_param.task_params.crit == CRIT_LEVEL_B){
461 check_for_pedf_preemption(remote_cpu_entry( 460 check_for_b_preemption(remote_cpu_entry(
462 get_partition(task))); 461 get_partition(task)));
463 } 462 }
464 else if (task->rt_param.task_params.crit == CRIT_LEVEL_C){ 463 else if (task->rt_param.task_params.crit == CRIT_LEVEL_C){
@@ -481,7 +480,7 @@ static void mc_release_jobs(rt_domain_t* rt, struct bheap* tasks)
481 480
482 for (i = 0; i < NR_CPUS; i++){ 481 for (i = 0; i < NR_CPUS; i++){
483 if (rt == remote_b_queue(i)){ 482 if (rt == remote_b_queue(i)){
484 check_for_pedf_preemption(remote_cpu_entry(i)); 483 check_for_b_preemption(remote_cpu_entry(i));
485 } 484 }
486 else if (rt == remote_a_queue(i)){ 485 else if (rt == remote_a_queue(i)){
487 check_for_a_preemption(remote_cpu_entry(i)); 486 check_for_a_preemption(remote_cpu_entry(i));