aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/sched_cedf.c
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-10 18:41:38 -0500
committerAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 12:00:35 -0400
commitb751e4e17e667f11404fc2f290416c0df050e964 (patch)
tree87def1848a42a8c8eca8c9fd624a7fc73a4fdafc /litmus/sched_cedf.c
parent17e34f413750b26aa493f1f8307f111bc5d487de (diff)
C-EDF: add release master support
As with GSN-EDF, do not insert release master into CPU heap.
Diffstat (limited to 'litmus/sched_cedf.c')
-rw-r--r--litmus/sched_cedf.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/litmus/sched_cedf.c b/litmus/sched_cedf.c
index e29a9fe2a8e8..0707059597d6 100644
--- a/litmus/sched_cedf.c
+++ b/litmus/sched_cedf.c
@@ -411,6 +411,14 @@ static struct task_struct* cedf_schedule(struct task_struct * prev)
411 int out_of_time, sleep, preempt, np, exists, blocks; 411 int out_of_time, sleep, preempt, np, exists, blocks;
412 struct task_struct* next = NULL; 412 struct task_struct* next = NULL;
413 413
414#ifdef CONFIG_RELEASE_MASTER
415 /* Bail out early if we are the release master.
416 * The release master never schedules any real-time tasks.
417 */
418 if (cluster->domain.release_master == entry->cpu)
419 return NULL;
420#endif
421
414 raw_spin_lock(&cluster->lock); 422 raw_spin_lock(&cluster->lock);
415 clear_will_schedule(); 423 clear_will_schedule();
416 424
@@ -546,8 +554,18 @@ static void cedf_task_new(struct task_struct * t, int on_rq, int running)
546 entry = &per_cpu(cedf_cpu_entries, task_cpu(t)); 554 entry = &per_cpu(cedf_cpu_entries, task_cpu(t));
547 BUG_ON(entry->scheduled); 555 BUG_ON(entry->scheduled);
548 556
549 entry->scheduled = t; 557#ifdef CONFIG_RELEASE_MASTER
550 tsk_rt(t)->scheduled_on = task_cpu(t); 558 if (entry->cpu != cluster->domain.release_master) {
559#endif
560 entry->scheduled = t;
561 tsk_rt(t)->scheduled_on = task_cpu(t);
562#ifdef CONFIG_RELEASE_MASTER
563 } else {
564 /* do not schedule on release master */
565 preempt(entry); /* force resched */
566 tsk_rt(t)->scheduled_on = NO_CPU;
567 }
568#endif
551 } else { 569 } else {
552 t->rt_param.scheduled_on = NO_CPU; 570 t->rt_param.scheduled_on = NO_CPU;
553 } 571 }
@@ -731,6 +749,9 @@ static long cedf_activate_plugin(void)
731 749
732 if(!zalloc_cpumask_var(&cedf[i].cpu_map, GFP_ATOMIC)) 750 if(!zalloc_cpumask_var(&cedf[i].cpu_map, GFP_ATOMIC))
733 return -ENOMEM; 751 return -ENOMEM;
752#ifdef CONFIG_RELEASE_MASTER
753 cedf[i].domain.release_master = atomic_read(&release_master_cpu);
754#endif
734 } 755 }
735 756
736 /* cycle through cluster and add cpus to them */ 757 /* cycle through cluster and add cpus to them */
@@ -773,7 +794,11 @@ static long cedf_activate_plugin(void)
773 794
774 entry->linked = NULL; 795 entry->linked = NULL;
775 entry->scheduled = NULL; 796 entry->scheduled = NULL;
776 update_cpu_position(entry); 797#ifdef CONFIG_RELEASE_MASTER
798 /* only add CPUs that should schedule jobs */
799 if (entry->cpu != entry->cluster->domain.release_master)
800#endif
801 update_cpu_position(entry);
777 } 802 }
778 /* done with this cluster */ 803 /* done with this cluster */
779 break; 804 break;