diff options
author | Jonathan <hermanjl@bonham.cs.unc.edu> | 2011-04-21 15:26:54 -0400 |
---|---|---|
committer | Jonathan <hermanjl@bonham.cs.unc.edu> | 2011-04-21 15:26:54 -0400 |
commit | 7cb15e61e4ce73eb427b095f266a10a668c80704 (patch) | |
tree | 41d8867b4196749dd135749820c2d128663ce6a8 | |
parent | a1dcb10eb16d6e71a755124376de16e2bba44339 (diff) |
Be servers properly donating slack on release.
-rw-r--r-- | litmus/sched_edf_hsb.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/litmus/sched_edf_hsb.c b/litmus/sched_edf_hsb.c index 7fd3d545234d..20531eb663ec 100644 --- a/litmus/sched_edf_hsb.c +++ b/litmus/sched_edf_hsb.c | |||
@@ -330,7 +330,7 @@ static void donate_slack(server_t *donator) | |||
330 | /* | 330 | /* |
331 | * Donate any available slack from a server. | 331 | * Donate any available slack from a server. |
332 | */ | 332 | */ |
333 | static void check_donate_slack(server_t *donator, struct task_struct *was_scheduled) | 333 | static noinline void check_donate_slack(server_t *donator, struct task_struct *was_scheduled) |
334 | { | 334 | { |
335 | server_t *slack = server_slack(donator); | 335 | server_t *slack = server_slack(donator); |
336 | hrt_server_t *hrt_server; | 336 | hrt_server_t *hrt_server; |
@@ -893,7 +893,7 @@ static inline void catchup_server(server_t *server, lt_t time) | |||
893 | TRACE_SERVER_SUB(server, "catching up to %llu", time); | 893 | TRACE_SERVER_SUB(server, "catching up to %llu", time); |
894 | } | 894 | } |
895 | 895 | ||
896 | static int catchup_srt_server(struct task_struct *task) | 896 | static noinline int catchup_srt_server(struct task_struct *task) |
897 | { | 897 | { |
898 | int jobs, rv = 0; | 898 | int jobs, rv = 0; |
899 | lt_t release; | 899 | lt_t release; |
@@ -942,7 +942,7 @@ static int catchup_srt_server(struct task_struct *task) | |||
942 | * Returns the next eligible slack server. This will remove any expired | 942 | * Returns the next eligible slack server. This will remove any expired |
943 | * slack servers still present in the list. | 943 | * slack servers still present in the list. |
944 | */ | 944 | */ |
945 | static server_t* next_eligible_slack_server(void) | 945 | static noinline server_t* next_eligible_slack_server(void) |
946 | { | 946 | { |
947 | server_t *next_slack = NULL; | 947 | server_t *next_slack = NULL; |
948 | 948 | ||
@@ -967,7 +967,7 @@ static server_t* next_eligible_slack_server(void) | |||
967 | * Returns the next SRT task that is tardy or will be tardy. If none | 967 | * Returns the next SRT task that is tardy or will be tardy. If none |
968 | * are available, will return a tardy BE task if present. | 968 | * are available, will return a tardy BE task if present. |
969 | */ | 969 | */ |
970 | static struct task_struct* next_eligible_slack(void) | 970 | static noinline struct task_struct* next_eligible_slack(void) |
971 | { | 971 | { |
972 | struct task_struct *next = get_candidate(slack_candidates.next); | 972 | struct task_struct *next = get_candidate(slack_candidates.next); |
973 | 973 | ||
@@ -985,7 +985,7 @@ static struct task_struct* next_eligible_slack(void) | |||
985 | * ineligible or there are no eligible jobs, returns NULL. This will re-release | 985 | * ineligible or there are no eligible jobs, returns NULL. This will re-release |
986 | * any servers that are behind. | 986 | * any servers that are behind. |
987 | */ | 987 | */ |
988 | static struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server) | 988 | static noinline struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server) |
989 | { | 989 | { |
990 | lt_t now = litmus_clock(); | 990 | lt_t now = litmus_clock(); |
991 | lt_t dead, slack, budget; | 991 | lt_t dead, slack, budget; |
@@ -1068,7 +1068,7 @@ static struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server) | |||
1068 | /* | 1068 | /* |
1069 | * This will catch up the SRT's server if it is behind. | 1069 | * This will catch up the SRT's server if it is behind. |
1070 | */ | 1070 | */ |
1071 | static struct task_struct* next_eligible_srt(void) | 1071 | static noinline struct task_struct* next_eligible_srt(void) |
1072 | { | 1072 | { |
1073 | int done = 0; | 1073 | int done = 0; |
1074 | struct task_struct *next_srt; | 1074 | struct task_struct *next_srt; |
@@ -1124,9 +1124,9 @@ static noinline server_t* next_eligible_be_server(void) | |||
1124 | bheap_delete(server_order, &be_ready_servers, | 1124 | bheap_delete(server_order, &be_ready_servers, |
1125 | be_server->hn); | 1125 | be_server->hn); |
1126 | catchup_server(be_server, now); | 1126 | catchup_server(be_server, now); |
1127 | check_donate_slack(be_server, NULL); | ||
1127 | bheap_insert(server_order, &be_ready_servers, | 1128 | bheap_insert(server_order, &be_ready_servers, |
1128 | be_server->hn); | 1129 | be_server->hn); |
1129 | check_donate_slack(be_server, NULL); | ||
1130 | be_server = next_be_server(); | 1130 | be_server = next_be_server(); |
1131 | TRACE_SERVER_SUB(be_server, "catching up BE server"); | 1131 | TRACE_SERVER_SUB(be_server, "catching up BE server"); |
1132 | sched_trace_action(NULL, SERVER_RELEASED_ACTION); /* Release */ | 1132 | sched_trace_action(NULL, SERVER_RELEASED_ACTION); /* Release */ |
@@ -1815,12 +1815,12 @@ static void servers_released(struct list_head *servers) | |||
1815 | list_del_init(pos); | 1815 | list_del_init(pos); |
1816 | 1816 | ||
1817 | if (server->type == S_BE) { | 1817 | if (server->type == S_BE) { |
1818 | check_donate_slack(server, NULL); | ||
1818 | was_be = 1; | 1819 | was_be = 1; |
1819 | BUG_ON(bheap_node_in_heap(server->hn)); | 1820 | BUG_ON(bheap_node_in_heap(server->hn)); |
1820 | TRACE_SERVER_SUB(server, "inserting BE server"); | 1821 | TRACE_SERVER_SUB(server, "inserting BE server"); |
1821 | bheap_insert(server_order, &be_ready_servers, | 1822 | bheap_insert(server_order, &be_ready_servers, |
1822 | server->hn); | 1823 | server->hn); |
1823 | check_donate_slack(server); | ||
1824 | } else { /* HRT server */ | 1824 | } else { /* HRT server */ |
1825 | hrt_server_released(server); | 1825 | hrt_server_released(server); |
1826 | } | 1826 | } |