diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-05-30 19:46:21 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-06-01 10:23:13 -0400 |
commit | cedc8df1cf1ff935af5455a9d565dac05192a47f (patch) | |
tree | 04771859bf08ff847894af6107e4b799a7a00cea /litmus/sched_gsn_edf.c | |
parent | 5b54b24c13b7c5dbaa06eae5e1a0075da354289c (diff) |
Make release master support optional
Introduces CONFIG_RELEASE_MASTER and makes release
master support dependent on the new symbol. This is
useful because dedicated interrupt handling only applies
to "large" multicore platforms. This will allow us to
not implement smp_send_pull_timers() for all platforms.
Diffstat (limited to 'litmus/sched_gsn_edf.c')
-rw-r--r-- | litmus/sched_gsn_edf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index c0c63eba70ce..e101768740ad 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -382,11 +382,13 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev) | |||
382 | int out_of_time, sleep, preempt, np, exists, blocks; | 382 | int out_of_time, sleep, preempt, np, exists, blocks; |
383 | struct task_struct* next = NULL; | 383 | struct task_struct* next = NULL; |
384 | 384 | ||
385 | #ifdef CONFIG_RELEASE_MASTER | ||
385 | /* Bail out early if we are the release master. | 386 | /* Bail out early if we are the release master. |
386 | * The release master never schedules any real-time tasks. | 387 | * The release master never schedules any real-time tasks. |
387 | */ | 388 | */ |
388 | if (gsnedf.release_master == entry->cpu) | 389 | if (gsnedf.release_master == entry->cpu) |
389 | return NULL; | 390 | return NULL; |
391 | #endif | ||
390 | 392 | ||
391 | raw_spin_lock(&gsnedf_lock); | 393 | raw_spin_lock(&gsnedf_lock); |
392 | clear_will_schedule(); | 394 | clear_will_schedule(); |
@@ -518,14 +520,18 @@ static void gsnedf_task_new(struct task_struct * t, int on_rq, int running) | |||
518 | entry = &per_cpu(gsnedf_cpu_entries, task_cpu(t)); | 520 | entry = &per_cpu(gsnedf_cpu_entries, task_cpu(t)); |
519 | BUG_ON(entry->scheduled); | 521 | BUG_ON(entry->scheduled); |
520 | 522 | ||
523 | #ifdef CONFIG_RELEASE_MASTER | ||
521 | if (entry->cpu != gsnedf.release_master) { | 524 | if (entry->cpu != gsnedf.release_master) { |
525 | #endif | ||
522 | entry->scheduled = t; | 526 | entry->scheduled = t; |
523 | tsk_rt(t)->scheduled_on = task_cpu(t); | 527 | tsk_rt(t)->scheduled_on = task_cpu(t); |
528 | #ifdef CONFIG_RELEASE_MASTER | ||
524 | } else { | 529 | } else { |
525 | /* do not schedule on release master */ | 530 | /* do not schedule on release master */ |
526 | preempt(entry); /* force resched */ | 531 | preempt(entry); /* force resched */ |
527 | tsk_rt(t)->scheduled_on = NO_CPU; | 532 | tsk_rt(t)->scheduled_on = NO_CPU; |
528 | } | 533 | } |
534 | #endif | ||
529 | } else { | 535 | } else { |
530 | t->rt_param.scheduled_on = NO_CPU; | 536 | t->rt_param.scheduled_on = NO_CPU; |
531 | } | 537 | } |
@@ -767,7 +773,9 @@ static long gsnedf_activate_plugin(void) | |||
767 | cpu_entry_t *entry; | 773 | cpu_entry_t *entry; |
768 | 774 | ||
769 | bheap_init(&gsnedf_cpu_heap); | 775 | bheap_init(&gsnedf_cpu_heap); |
776 | #ifdef CONFIG_RELEASE_MASTER | ||
770 | gsnedf.release_master = atomic_read(&release_master_cpu); | 777 | gsnedf.release_master = atomic_read(&release_master_cpu); |
778 | #endif | ||
771 | 779 | ||
772 | for_each_online_cpu(cpu) { | 780 | for_each_online_cpu(cpu) { |
773 | entry = &per_cpu(gsnedf_cpu_entries, cpu); | 781 | entry = &per_cpu(gsnedf_cpu_entries, cpu); |
@@ -775,12 +783,16 @@ static long gsnedf_activate_plugin(void) | |||
775 | atomic_set(&entry->will_schedule, 0); | 783 | atomic_set(&entry->will_schedule, 0); |
776 | entry->linked = NULL; | 784 | entry->linked = NULL; |
777 | entry->scheduled = NULL; | 785 | entry->scheduled = NULL; |
786 | #ifdef CONFIG_RELEASE_MASTER | ||
778 | if (cpu != gsnedf.release_master) { | 787 | if (cpu != gsnedf.release_master) { |
788 | #endif | ||
779 | TRACE("GSN-EDF: Initializing CPU #%d.\n", cpu); | 789 | TRACE("GSN-EDF: Initializing CPU #%d.\n", cpu); |
780 | update_cpu_position(entry); | 790 | update_cpu_position(entry); |
791 | #ifdef CONFIG_RELEASE_MASTER | ||
781 | } else { | 792 | } else { |
782 | TRACE("GSN-EDF: CPU %d is release master.\n", cpu); | 793 | TRACE("GSN-EDF: CPU %d is release master.\n", cpu); |
783 | } | 794 | } |
795 | #endif | ||
784 | } | 796 | } |
785 | return 0; | 797 | return 0; |
786 | } | 798 | } |