diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-09-10 13:30:24 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-09-10 13:30:24 -0400 |
commit | 893c8943ce5c5527f05ab7e9208d5a942d77d8b5 (patch) | |
tree | aa9e84b3503ff97c1d87bc9c2ce6682e51cfc971 /litmus/sched_gsn_edf.c | |
parent | 901fdd9c22790039a76c1d3ee01828a2f124f6f3 (diff) | |
parent | d3c32e91e3fce2a57083a734efae6d9de06ec02f (diff) |
Merge branch 'prop/robust-tie-break' into wip-gpu-rtas12
Conflicts:
include/litmus/binheap.h
include/litmus/fdso.h
include/litmus/litmus.h
litmus/Makefile
litmus/binheap.c
litmus/edf_common.c
litmus/fdso.c
litmus/jobs.c
litmus/locking.c
Diffstat (limited to 'litmus/sched_gsn_edf.c')
-rw-r--r-- | litmus/sched_gsn_edf.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index 8c48757fa86c..11304d634661 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <litmus/sched_trace.h> | 22 | #include <litmus/sched_trace.h> |
23 | 23 | ||
24 | #include <litmus/preempt.h> | 24 | #include <litmus/preempt.h> |
25 | #include <litmus/budget.h> | ||
25 | 26 | ||
26 | #include <litmus/bheap.h> | 27 | #include <litmus/bheap.h> |
27 | #include <litmus/binheap.h> | 28 | #include <litmus/binheap.h> |
@@ -136,7 +137,7 @@ DEFINE_PER_CPU(cpu_entry_t, gsnedf_cpu_entries); | |||
136 | cpu_entry_t* gsnedf_cpus[NR_CPUS]; | 137 | cpu_entry_t* gsnedf_cpus[NR_CPUS]; |
137 | 138 | ||
138 | /* the cpus queue themselves according to priority in here */ | 139 | /* the cpus queue themselves according to priority in here */ |
139 | static struct binheap_handle gsnedf_cpu_heap; | 140 | static struct binheap gsnedf_cpu_heap; |
140 | 141 | ||
141 | static rt_domain_t gsnedf; | 142 | static rt_domain_t gsnedf; |
142 | #define gsnedf_lock (gsnedf.ready_lock) | 143 | #define gsnedf_lock (gsnedf.ready_lock) |
@@ -340,11 +341,11 @@ static void check_for_preemptions(void) | |||
340 | &per_cpu(gsnedf_cpu_entries, task_cpu(task))); | 341 | &per_cpu(gsnedf_cpu_entries, task_cpu(task))); |
341 | if (affinity) | 342 | if (affinity) |
342 | last = affinity; | 343 | last = affinity; |
343 | else if (last->linked) | 344 | else if (requeue_preempted_job(last->linked)) |
344 | requeue(last->linked); | 345 | requeue(last->linked); |
345 | } | 346 | } |
346 | #else | 347 | #else |
347 | if (last->linked) | 348 | if (requeue_preempted_job(last->linked)) |
348 | requeue(last->linked); | 349 | requeue(last->linked); |
349 | #endif | 350 | #endif |
350 | 351 | ||
@@ -786,9 +787,8 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev) | |||
786 | /* (0) Determine state */ | 787 | /* (0) Determine state */ |
787 | exists = entry->scheduled != NULL; | 788 | exists = entry->scheduled != NULL; |
788 | blocks = exists && !is_running(entry->scheduled); | 789 | blocks = exists && !is_running(entry->scheduled); |
789 | out_of_time = exists && | 790 | out_of_time = exists && budget_enforced(entry->scheduled) |
790 | budget_enforced(entry->scheduled) && | 791 | && budget_exhausted(entry->scheduled); |
791 | budget_exhausted(entry->scheduled); | ||
792 | np = exists && is_np(entry->scheduled); | 792 | np = exists && is_np(entry->scheduled); |
793 | sleep = exists && get_rt_flags(entry->scheduled) == RT_F_SLEEP; | 793 | sleep = exists && get_rt_flags(entry->scheduled) == RT_F_SLEEP; |
794 | preempt = entry->scheduled != entry->linked; | 794 | preempt = entry->scheduled != entry->linked; |
@@ -837,9 +837,9 @@ static struct task_struct* gsnedf_schedule(struct task_struct * prev) | |||
837 | /* Any task that is preemptable and either exhausts its execution | 837 | /* Any task that is preemptable and either exhausts its execution |
838 | * budget or wants to sleep completes. We may have to reschedule after | 838 | * budget or wants to sleep completes. We may have to reschedule after |
839 | * this. Don't do a job completion if we block (can't have timers running | 839 | * this. Don't do a job completion if we block (can't have timers running |
840 | * for blocked jobs). Preemption go first for the same reason. | 840 | * for blocked jobs). |
841 | */ | 841 | */ |
842 | if (!np && (out_of_time || sleep) && !blocks && !preempt) | 842 | if (!np && (out_of_time || sleep) && !blocks) |
843 | job_completion(entry->scheduled, !sleep); | 843 | job_completion(entry->scheduled, !sleep); |
844 | 844 | ||
845 | /* Link pending task if we became unlinked. | 845 | /* Link pending task if we became unlinked. |