aboutsummaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-11-28 07:07:51 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-11-28 07:07:51 -0500
commit054c9fbdb7c40df374dcb80a31ea82a2829d8e44 (patch)
treea1a48a31146a9c32eb775b2376309ce853159f53 /native/src
parent591ef2a19aa5e2c327e9e1c198762b0c3ff5830a (diff)
Minor bug fixes in the QPA implementation
1) On Linux hosts, limits.h must be included explicitly. 2) Don't try to compute the busy interval if the task system is over-utilized.
Diffstat (limited to 'native/src')
-rw-r--r--native/src/edf/qpa.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/native/src/edf/qpa.cpp b/native/src/edf/qpa.cpp
index 23865ca..f138b7c 100644
--- a/native/src/edf/qpa.cpp
+++ b/native/src/edf/qpa.cpp
@@ -2,6 +2,8 @@
2#include <set> 2#include <set>
3 3
4#include <stdlib.h> 4#include <stdlib.h>
5#include <limits.h>
6
5#include "tasks.h" 7#include "tasks.h"
6#include "math-helper.h" 8#include "math-helper.h"
7#include "stl-helper.h" 9#include "stl-helper.h"
@@ -134,16 +136,17 @@ static integral_t get_largest_testpoint(const TaskSet &ts,
134 136
135bool QPATest::is_schedulable(const TaskSet &ts, bool check_preconditions) 137bool QPATest::is_schedulable(const TaskSet &ts, bool check_preconditions)
136{ 138{
137 integral_t max_interval = edf_busy_interval(ts);
138 unsigned long min_interval = min_relative_deadline(ts);
139
140 fractional_t util; 139 fractional_t util;
141 ts.get_utilization(util); 140 ts.get_utilization(util);
142 141
142 if (util > 1)
143 return false;
144
145 integral_t max_interval = edf_busy_interval(ts);
146 unsigned long min_interval = min_relative_deadline(ts);
147
143 if (util < 1) 148 if (util < 1)
144 max_interval = std::min(max_interval, zhang_burns_interval(ts)); 149 max_interval = std::min(max_interval, zhang_burns_interval(ts));
145 else if (util > 1)
146 return false;
147 150
148 integral_t next = get_largest_testpoint(ts, max_interval); 151 integral_t next = get_largest_testpoint(ts, max_interval);
149 integral_t demand; 152 integral_t demand;