aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2011-04-17 02:30:50 -0400
committerJonathan Herman <hermanjl@cs.unc.edu>2011-04-17 02:30:50 -0400
commit5846906431466b20b22d9063bf636f2cbb44dba0 (patch)
treec7ca652d8fe8ffef7f3684cc084c746429f0a4b4
parentf03c392b9b809560e960ab3d93d70eb0577f8fdf (diff)
Removed repetitive calls to litmus_clock(), which will sometimes cause abnormal behavior.
-rw-r--r--litmus/sched_edf_hsb.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/litmus/sched_edf_hsb.c b/litmus/sched_edf_hsb.c
index 78f371ee8941..ec4d6b0b27c2 100644
--- a/litmus/sched_edf_hsb.c
+++ b/litmus/sched_edf_hsb.c
@@ -565,11 +565,10 @@ static inline lt_t lt_subtract(lt_t a, lt_t b)
565 return 0; 565 return 0;
566} 566}
567 567
568static void requeue_server(server_t *server) 568static void requeue_server(server_t *server, lt_t now)
569{ 569{
570 int added = 0; 570 int added = 0;
571 hrt_server_t *hrt_server; 571 hrt_server_t *hrt_server;
572 lt_t now = litmus_clock();
573 572
574 BUG_ON(server->type == S_SRT || 573 BUG_ON(server->type == S_SRT ||
575 server->type == S_SLACK); 574 server->type == S_SLACK);
@@ -581,7 +580,7 @@ static void requeue_server(server_t *server)
581 if (!added) { 580 if (!added) {
582 /* Mark servers as released */ 581 /* Mark servers as released */
583 if (server->type == S_HRT) { 582 if (server->type == S_HRT) {
584 TRACE_SERVER_SUB(server, "P%d now ready"); 583 TRACE_SERVER_SUB(server, "P%d now ready at %llu", now);
585 hrt_server = container_of(server, hrt_server_t, server); 584 hrt_server = container_of(server, hrt_server_t, server);
586 hrt_server->ready = 1; 585 hrt_server->ready = 1;
587 } else if (server->type == S_BE) { 586 } else if (server->type == S_BE) {
@@ -688,7 +687,7 @@ static noinline void unlink_server(cpu_entry_t *entry, int requeue)
688 /* Donator needs to absorb slack execution time */ 687 /* Donator needs to absorb slack execution time */
689 reclaim_slack(server); 688 reclaim_slack(server);
690 } else if (server->type != S_SRT) { 689 } else if (server->type != S_SRT) {
691 requeue_server(server); 690 requeue_server(server, litmus_clock());
692 } 691 }
693 692
694 if (server->type == S_HRT && hrt_server->ready) 693 if (server->type == S_HRT && hrt_server->ready)
@@ -1024,7 +1023,7 @@ static struct task_struct* next_eligible_hrt(hrt_server_t *hrt_server)
1024 if (!hrt_server->server.budget && 1023 if (!hrt_server->server.budget &&
1025 !head_in_list(&hrt_server->server.release_list)) { 1024 !head_in_list(&hrt_server->server.release_list)) {
1026 TRACE_SERVER_SUB(&hrt_server->server, "requeing"); 1025 TRACE_SERVER_SUB(&hrt_server->server, "requeing");
1027 requeue_server(&hrt_server->server); 1026 requeue_server(&hrt_server->server, now);
1028 } 1027 }
1029 1028
1030 if (task) { 1029 if (task) {