diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-05 22:49:52 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-05 22:49:52 -0500 |
commit | 9ad6af9eaa75f5023b26b8a8c7b943088a83fd1b (patch) | |
tree | e47dceee961fceb932aab8ed8e7f6a0c4d940ec5 | |
parent | 5f265ef19b75b9bfe41a9cb4f5ba9898dbf767b0 (diff) |
Pfair: add release master support.
-rw-r--r-- | litmus/sched_pfair.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/litmus/sched_pfair.c b/litmus/sched_pfair.c index 7168c77f0872..055ac623edb4 100644 --- a/litmus/sched_pfair.c +++ b/litmus/sched_pfair.c | |||
@@ -418,6 +418,11 @@ static void schedule_subtasks(struct pfair_cluster *cluster, quanta_t time) | |||
418 | list_for_each(pos, &cluster->topology.cpus) { | 418 | list_for_each(pos, &cluster->topology.cpus) { |
419 | cpu_state = from_cluster_list(pos); | 419 | cpu_state = from_cluster_list(pos); |
420 | retry = 1; | 420 | retry = 1; |
421 | #ifdef CONFIG_RELEASE_MASTER | ||
422 | /* skip release master */ | ||
423 | if (cluster->pfair.release_master == cpu_id(cpu_state)) | ||
424 | continue; | ||
425 | #endif | ||
421 | while (retry) { | 426 | while (retry) { |
422 | if (pfair_higher_prio(__peek_ready(&cluster->pfair), | 427 | if (pfair_higher_prio(__peek_ready(&cluster->pfair), |
423 | cpu_state->linked)) | 428 | cpu_state->linked)) |
@@ -588,6 +593,14 @@ static struct task_struct* pfair_schedule(struct task_struct * prev) | |||
588 | int blocks; | 593 | int blocks; |
589 | struct task_struct* next = NULL; | 594 | struct task_struct* next = NULL; |
590 | 595 | ||
596 | #ifdef CONFIG_RELEASE_MASTER | ||
597 | /* Bail out early if we are the release master. | ||
598 | * The release master never schedules any real-time tasks. | ||
599 | */ | ||
600 | if (cpu_cluster(state)->pfair.release_master == cpu_id(state)) | ||
601 | return NULL; | ||
602 | #endif | ||
603 | |||
591 | raw_spin_lock(cpu_lock(state)); | 604 | raw_spin_lock(cpu_lock(state)); |
592 | 605 | ||
593 | if (is_realtime(prev) && get_rt_flags(prev) == RT_F_SLEEP) | 606 | if (is_realtime(prev) && get_rt_flags(prev) == RT_F_SLEEP) |
@@ -628,12 +641,15 @@ static void pfair_task_new(struct task_struct * t, int on_rq, int running) | |||
628 | 641 | ||
629 | prepare_release(t, cluster->pfair_time + 1); | 642 | prepare_release(t, cluster->pfair_time + 1); |
630 | 643 | ||
644 | t->rt_param.scheduled_on = NO_CPU; | ||
645 | |||
631 | if (running) { | 646 | if (running) { |
632 | t->rt_param.scheduled_on = task_cpu(t); | 647 | #ifdef CONFIG_RELEASE_MASTER |
648 | if (task_cpu(t) != cluster->pfair.release_master) | ||
649 | #endif | ||
650 | t->rt_param.scheduled_on = task_cpu(t); | ||
633 | __add_ready(&cluster->pfair, t); | 651 | __add_ready(&cluster->pfair, t); |
634 | } | 652 | } |
635 | else | ||
636 | t->rt_param.scheduled_on = NO_CPU; | ||
637 | 653 | ||
638 | check_preempt(t); | 654 | check_preempt(t); |
639 | 655 | ||
@@ -900,6 +916,9 @@ static long pfair_activate_plugin(void) | |||
900 | pfair_init_cluster(cluster); | 916 | pfair_init_cluster(cluster); |
901 | cluster->pfair_time = now; | 917 | cluster->pfair_time = now; |
902 | clust[i] = &cluster->topology; | 918 | clust[i] = &cluster->topology; |
919 | #ifdef CONFIG_RELEASE_MASTER | ||
920 | cluster->pfair.release_master = atomic_read(&release_master_cpu); | ||
921 | #endif | ||
903 | } | 922 | } |
904 | 923 | ||
905 | for (i = 0; i < num_online_cpus(); i++) { | 924 | for (i = 0; i < num_online_cpus(); i++) { |