diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-04-23 09:34:21 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2009-04-23 09:34:21 -0400 |
commit | c13c6bb71587473e241637698c048887cb877e61 (patch) | |
tree | c04008079a622cf369c72b387dc5af243858411d | |
parent | 75cfa12d9f9af9ce285398a92bcf43ba90945fd9 (diff) |
G-EDF: make use of release_master interface
The current release_master setting is copied when activating
the plugin. Changing it during execution is currently not
supported.
-rw-r--r-- | litmus/sched_gedf.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/litmus/sched_gedf.c b/litmus/sched_gedf.c index 7725d92fd5..87469253a8 100644 --- a/litmus/sched_gedf.c +++ b/litmus/sched_gedf.c | |||
@@ -339,6 +339,12 @@ static struct task_struct* gedf_schedule(struct task_struct * prev) | |||
339 | int out_of_time, sleep, preempt, exists, blocks; | 339 | int out_of_time, sleep, preempt, exists, blocks; |
340 | struct task_struct* next = NULL; | 340 | struct task_struct* next = NULL; |
341 | 341 | ||
342 | /* Bail out earlier if we are the release master. | ||
343 | * The release master never schedules any real-time tasks. | ||
344 | */ | ||
345 | if (gedf.release_master == entry->cpu) | ||
346 | return NULL; | ||
347 | |||
342 | TRACE_TASK(prev, "invoked gedf_schedule.\n"); | 348 | TRACE_TASK(prev, "invoked gedf_schedule.\n"); |
343 | 349 | ||
344 | /* sanity checking */ | 350 | /* sanity checking */ |
@@ -540,14 +546,20 @@ static long gedf_activate_plugin(void) | |||
540 | cpu_entry_t *entry; | 546 | cpu_entry_t *entry; |
541 | 547 | ||
542 | heap_init(&gedf_cpu_heap); | 548 | heap_init(&gedf_cpu_heap); |
549 | gedf.release_master = atomic_read(&release_master_cpu); | ||
550 | |||
543 | for_each_online_cpu(cpu) { | 551 | for_each_online_cpu(cpu) { |
544 | TRACE("G-EDF: Initializing CPU #%d.\n", cpu); | ||
545 | entry = &per_cpu(gedf_cpu_entries, cpu); | 552 | entry = &per_cpu(gedf_cpu_entries, cpu); |
546 | heap_node_init(&entry->hn, entry); | 553 | heap_node_init(&entry->hn, entry); |
547 | entry->linked = NULL; | 554 | entry->linked = NULL; |
548 | entry->scheduled = NULL; | 555 | entry->scheduled = NULL; |
549 | entry->picked = 0; | 556 | entry->picked = 0; |
550 | update_cpu_position(entry); | 557 | if (cpu != gedf.release_master) { |
558 | TRACE("G-EDF: Initializing CPU #%d.\n", cpu); | ||
559 | update_cpu_position(entry); | ||
560 | } else { | ||
561 | TRACE("G-EDF: CPU %d is release master.\n", cpu); | ||
562 | } | ||
551 | } | 563 | } |
552 | return 0; | 564 | return 0; |
553 | } | 565 | } |