From 054c9fbdb7c40df374dcb80a31ea82a2829d8e44 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Wed, 28 Nov 2012 13:07:51 +0100 Subject: 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. --- native/src/edf/qpa.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'native/src') 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 @@ #include #include +#include + #include "tasks.h" #include "math-helper.h" #include "stl-helper.h" @@ -134,16 +136,17 @@ static integral_t get_largest_testpoint(const TaskSet &ts, bool QPATest::is_schedulable(const TaskSet &ts, bool check_preconditions) { - integral_t max_interval = edf_busy_interval(ts); - unsigned long min_interval = min_relative_deadline(ts); - fractional_t util; ts.get_utilization(util); + if (util > 1) + return false; + + integral_t max_interval = edf_busy_interval(ts); + unsigned long min_interval = min_relative_deadline(ts); + if (util < 1) max_interval = std::min(max_interval, zhang_burns_interval(ts)); - else if (util > 1) - return false; integral_t next = get_largest_testpoint(ts, max_interval); integral_t demand; -- cgit v1.2.2