aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--litmus/sched_edf_hsb.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/litmus/sched_edf_hsb.c b/litmus/sched_edf_hsb.c
index 12e2cc381397..70dfc20fb8a1 100644
--- a/litmus/sched_edf_hsb.c
+++ b/litmus/sched_edf_hsb.c
@@ -624,7 +624,7 @@ static noinline void link_server(cpu_entry_t *entry,
624 /* Massive state check */ 624 /* Massive state check */
625 if (next_server->type == S_SRT) { 625 if (next_server->type == S_SRT) {
626 /* SRT task cannot get ahead of its server */ 626 /* SRT task cannot get ahead of its server */
627 BUG_ON(next_server->job_no <task_job_no(entry->linked)); 627 BUG_ON(next_server->job_no + 1 < task_job_no(entry->linked));
628 BUG_ON(lt_after(get_deadline(entry->linked), 628 BUG_ON(lt_after(get_deadline(entry->linked),
629 next_server->deadline)); 629 next_server->deadline));
630 } else if (next_server->type == S_HRT) { 630 } else if (next_server->type == S_HRT) {
@@ -863,6 +863,8 @@ static int catchup_srt_server(struct task_struct *task)
863 TRACE_SERVER_SUB(srt_server, "catching up to %llu, job %d", 863 TRACE_SERVER_SUB(srt_server, "catching up to %llu, job %d",
864 release, srt_server->job_no + jobs); 864 release, srt_server->job_no + jobs);
865 865
866 BUG_ON(jobs < 1);
867
866 /* Update server state */ 868 /* Update server state */
867 server_release_at(srt_server, release); 869 server_release_at(srt_server, release);
868 srt_server->job_no += jobs - 1; 870 srt_server->job_no += jobs - 1;
@@ -882,6 +884,8 @@ static int catchup_srt_server(struct task_struct *task)
882 srt_server->job_no = task_job_no(task); 884 srt_server->job_no = task_job_no(task);
883 } 885 }
884 886
887 BUG_ON(srt_server->job_no == 0);
888
885 return rv; 889 return rv;
886} 890}
887 891
@@ -967,11 +971,11 @@ static struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server)
967 TRACE_SERVER_SUB(&hrt_server->server, "now ready"); 971 TRACE_SERVER_SUB(&hrt_server->server, "now ready");
968 hrt_server->ready = 1; 972 hrt_server->ready = 1;
969 hrt_server->no_slack = 0; 973 hrt_server->no_slack = 0;
970 sched_trace_action(NULL, 2); /* Release */ 974 sched_trace_action(task, 2); /* Release */
971 } else if (lt_before_eq(slack, now) && !hrt_server->no_slack) { 975 } else if (lt_before_eq(slack, now) && !hrt_server->no_slack) {
972 /* The server missed the shift to no slack */ 976 /* The server missed the shift to no slack */
973 hrt_server->no_slack = 1; 977 hrt_server->no_slack = 1;
974 sched_trace_action(NULL, 3); 978 sched_trace_action(task, 3);
975 } else if (!hrtimer_active(&hrt_server->slack_timer)) { 979 } else if (!hrtimer_active(&hrt_server->slack_timer)) {
976 slack_timer_arm(hrt_server); 980 slack_timer_arm(hrt_server);
977 } 981 }
@@ -1670,11 +1674,10 @@ static void server_completed(server_t *server, struct task_struct *task)
1670 } 1674 }
1671 1675
1672 unlink(task); 1676 unlink(task);
1673 requeue(task, get_rt_domain(entry, task)); 1677 job_arrival(task, entry);
1674 1678
1675 /* Need to pick the next task to run */ 1679 /* Boot off task if nothing was scheduled */
1676 edf_hsb_pick_next(entry); 1680 if (!entry->linked)
1677 if (!entry->linked || entry->linked != task)
1678 preempt_if_preemptable(entry->scheduled, entry->cpu); 1681 preempt_if_preemptable(entry->scheduled, entry->cpu);
1679} 1682}
1680 1683