aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-05 22:49:52 -0500
committerAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 12:05:16 -0400
commit399455c0e529bb07760f17e8fe0fddc342b67bc2 (patch)
treefa6f8e73e1c177c29b59b6503c6f7ce820e3debb
parentb4c52e27caa701a16e120b43a0e70ca6529a58a4 (diff)
Pfair: add release master support.
Merged in release master support for Pfair. Some merge conflicts had to be resolved.
-rw-r--r--litmus/sched_pfair.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/litmus/sched_pfair.c b/litmus/sched_pfair.c
index 0a64273daa47..43119e5149fa 100644
--- a/litmus/sched_pfair.c
+++ b/litmus/sched_pfair.c
@@ -445,6 +445,11 @@ static void schedule_subtasks(struct pfair_cluster *cluster, quanta_t time)
445 list_for_each(pos, &cluster->topology.cpus) { 445 list_for_each(pos, &cluster->topology.cpus) {
446 cpu_state = from_cluster_list(pos); 446 cpu_state = from_cluster_list(pos);
447 retry = 1; 447 retry = 1;
448#ifdef CONFIG_RELEASE_MASTER
449 /* skip release master */
450 if (cluster->pfair.release_master == cpu_id(cpu_state))
451 continue;
452#endif
448 while (retry) { 453 while (retry) {
449 if (pfair_higher_prio(__peek_ready(&cluster->pfair), 454 if (pfair_higher_prio(__peek_ready(&cluster->pfair),
450 cpu_state->linked)) 455 cpu_state->linked))
@@ -615,6 +620,14 @@ static struct task_struct* pfair_schedule(struct task_struct * prev)
615 int blocks; 620 int blocks;
616 struct task_struct* next = NULL; 621 struct task_struct* next = NULL;
617 622
623#ifdef CONFIG_RELEASE_MASTER
624 /* Bail out early if we are the release master.
625 * The release master never schedules any real-time tasks.
626 */
627 if (cpu_cluster(state)->pfair.release_master == cpu_id(state))
628 return NULL;
629#endif
630
618 raw_spin_lock(cpu_lock(state)); 631 raw_spin_lock(cpu_lock(state));
619 632
620 blocks = is_realtime(prev) && !is_running(prev); 633 blocks = is_realtime(prev) && !is_running(prev);
@@ -649,10 +662,16 @@ static void pfair_task_new(struct task_struct * t, int on_rq, int running)
649 cluster = tsk_pfair(t)->cluster; 662 cluster = tsk_pfair(t)->cluster;
650 663
651 raw_spin_lock_irqsave(cluster_lock(cluster), flags); 664 raw_spin_lock_irqsave(cluster_lock(cluster), flags);
652 if (running) 665
666 if (running
667#ifdef CONFIG_RELEASE_MASTER
668 && (task_cpu(t) != cluster->pfair.release_master)
669#endif
670 ) {
653 t->rt_param.scheduled_on = task_cpu(t); 671 t->rt_param.scheduled_on = task_cpu(t);
654 else 672 } else {
655 t->rt_param.scheduled_on = NO_CPU; 673 t->rt_param.scheduled_on = NO_CPU;
674 }
656 675
657 prepare_release(t, cluster->pfair_time + 1); 676 prepare_release(t, cluster->pfair_time + 1);
658 pfair_add_release(cluster, t); 677 pfair_add_release(cluster, t);
@@ -936,6 +955,9 @@ static long pfair_activate_plugin(void)
936 pfair_init_cluster(cluster); 955 pfair_init_cluster(cluster);
937 cluster->pfair_time = now; 956 cluster->pfair_time = now;
938 clust[i] = &cluster->topology; 957 clust[i] = &cluster->topology;
958#ifdef CONFIG_RELEASE_MASTER
959 cluster->pfair.release_master = atomic_read(&release_master_cpu);
960#endif
939 } 961 }
940 962
941 for (i = 0; i < num_online_cpus(); i++) { 963 for (i = 0; i < num_online_cpus(); i++) {