diff options
author | Jonathan <hermanjl@bonham.cs.unc.edu> | 2011-04-18 15:30:59 -0400 |
---|---|---|
committer | Jonathan <hermanjl@bonham.cs.unc.edu> | 2011-04-18 15:30:59 -0400 |
commit | 49a66dde8cc4214a9f361dfde7232ccaf3dd3ee2 (patch) | |
tree | 9c2be4cab5fa25e607dba6b4d5332c59d25aacb0 | |
parent | d3b50f6e14e6bd9c8f9ce8bb1626909d0bfd8fba (diff) |
Logic for handling a failed SRT preemption due to an HRT task already being linked.
-rw-r--r-- | litmus/sched_edf_hsb.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/litmus/sched_edf_hsb.c b/litmus/sched_edf_hsb.c index bcdb90bee2f4..7a1ceb4458ae 100644 --- a/litmus/sched_edf_hsb.c +++ b/litmus/sched_edf_hsb.c | |||
@@ -645,8 +645,9 @@ static noinline void link_server(cpu_entry_t *entry, | |||
645 | sched_trace_action(entry->linked, next_server->id); | 645 | sched_trace_action(entry->linked, next_server->id); |
646 | } | 646 | } |
647 | 647 | ||
648 | if (next_server->type != S_SLACK) { | 648 | if (next_server->type != S_SLACK && |
649 | BUG_ON(head_in_list(&server_slack(next_server)->list)); | 649 | (head_in_list(&server_slack(next_server)->list))) { |
650 | remove_slack(server_slack(next_server)); | ||
650 | } | 651 | } |
651 | 652 | ||
652 | entry->linked_server = next_server; | 653 | entry->linked_server = next_server; |
@@ -1131,7 +1132,9 @@ static noinline void requeue(struct task_struct *task, rt_domain_t *domain) | |||
1131 | int was_added; | 1132 | int was_added; |
1132 | 1133 | ||
1133 | BUG_ON(!is_realtime(task)); | 1134 | BUG_ON(!is_realtime(task)); |
1134 | BUG_ON(head_in_list(&task_data(task)->candidate_list)); | 1135 | if (head_in_list(&task_data(task)->candidate_list)) { |
1136 | list_del_init(&task_data(task)->candidate_list); | ||
1137 | } | ||
1135 | 1138 | ||
1136 | check_slack_candidate(task); | 1139 | check_slack_candidate(task); |
1137 | 1140 | ||
@@ -2208,15 +2211,14 @@ static struct task_struct* edf_hsb_schedule(struct task_struct *prev) | |||
2208 | entry->scheduled->rt_param.scheduled_on = NO_CPU; | 2211 | entry->scheduled->rt_param.scheduled_on = NO_CPU; |
2209 | } | 2212 | } |
2210 | 2213 | ||
2211 | if (preempted && entry->linked && entry->scheduled && | ||
2212 | is_hrt(entry->linked) && !is_hrt(entry->scheduled)) | ||
2213 | check_for_global_preempt(); | ||
2214 | 2214 | ||
2215 | entry->scheduled = entry->linked; | 2215 | entry->scheduled = entry->linked; |
2216 | entry->scheduled_server = entry->linked_server; | 2216 | entry->scheduled_server = entry->linked_server; |
2217 | sched_state_task_picked(); | 2217 | sched_state_task_picked(); |
2218 | 2218 | ||
2219 | 2219 | if (preempted && entry->linked && curr && | |
2220 | is_hrt(entry->linked) && !is_hrt(curr)) | ||
2221 | check_for_global_preempt(); | ||
2220 | 2222 | ||
2221 | if (entry->scheduled) | 2223 | if (entry->scheduled) |
2222 | TRACE_TASK(entry->scheduled, "scheduled at %llu\n", | 2224 | TRACE_TASK(entry->scheduled, "scheduled at %llu\n", |