From 7cb15e61e4ce73eb427b095f266a10a668c80704 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 21 Apr 2011 15:26:54 -0400 Subject: Be servers properly donating slack on release. --- litmus/sched_edf_hsb.c | 16 ++++++++-------- 1 file 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) /* * Donate any available slack from a server. */ -static void check_donate_slack(server_t *donator, struct task_struct *was_scheduled) +static noinline void check_donate_slack(server_t *donator, struct task_struct *was_scheduled) { server_t *slack = server_slack(donator); hrt_server_t *hrt_server; @@ -893,7 +893,7 @@ static inline void catchup_server(server_t *server, lt_t time) TRACE_SERVER_SUB(server, "catching up to %llu", time); } -static int catchup_srt_server(struct task_struct *task) +static noinline int catchup_srt_server(struct task_struct *task) { int jobs, rv = 0; lt_t release; @@ -942,7 +942,7 @@ static int catchup_srt_server(struct task_struct *task) * Returns the next eligible slack server. This will remove any expired * slack servers still present in the list. */ -static server_t* next_eligible_slack_server(void) +static noinline server_t* next_eligible_slack_server(void) { server_t *next_slack = NULL; @@ -967,7 +967,7 @@ static server_t* next_eligible_slack_server(void) * Returns the next SRT task that is tardy or will be tardy. If none * are available, will return a tardy BE task if present. */ -static struct task_struct* next_eligible_slack(void) +static noinline struct task_struct* next_eligible_slack(void) { struct task_struct *next = get_candidate(slack_candidates.next); @@ -985,7 +985,7 @@ static struct task_struct* next_eligible_slack(void) * ineligible or there are no eligible jobs, returns NULL. This will re-release * any servers that are behind. */ -static struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server) +static noinline struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server) { lt_t now = litmus_clock(); lt_t dead, slack, budget; @@ -1068,7 +1068,7 @@ static struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server) /* * This will catch up the SRT's server if it is behind. */ -static struct task_struct* next_eligible_srt(void) +static noinline struct task_struct* next_eligible_srt(void) { int done = 0; struct task_struct *next_srt; @@ -1124,9 +1124,9 @@ static noinline server_t* next_eligible_be_server(void) bheap_delete(server_order, &be_ready_servers, be_server->hn); catchup_server(be_server, now); + check_donate_slack(be_server, NULL); bheap_insert(server_order, &be_ready_servers, be_server->hn); - check_donate_slack(be_server, NULL); be_server = next_be_server(); TRACE_SERVER_SUB(be_server, "catching up BE server"); sched_trace_action(NULL, SERVER_RELEASED_ACTION); /* Release */ @@ -1815,12 +1815,12 @@ static void servers_released(struct list_head *servers) list_del_init(pos); if (server->type == S_BE) { + check_donate_slack(server, NULL); was_be = 1; BUG_ON(bheap_node_in_heap(server->hn)); TRACE_SERVER_SUB(server, "inserting BE server"); bheap_insert(server_order, &be_ready_servers, server->hn); - check_donate_slack(server); } else { /* HRT server */ hrt_server_released(server); } -- cgit v1.2.2