Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC
Designing is optimizing where: the application is represented by a tuple of design variables x ; x is in a design space ; the reward function f express our goal. The designer has to find the application x, such that:
Application model Application model: tasks set { 1, 2, …, n }. i = (C i, T i, D i ), where: C i is the max computation time of i (WCET). T i is the min interarrival time (or period). D i is the relative deadline. U i = C i / T i is the utilization factor of i. Di Ti.Di Ti.Di Ti.Di Ti. Task x = (2, 4, 3) absolute deadlines activation instants
Design variables/Reward function The designer of RT software can select among: many implementations of an algorithm ( C i ); different periods on the programmable timers ( T i ); different task deadlines ( D i ). The reward function f(x) typically: pushes against the schedulability; increases for: bigger C i (better algorithm), smaller T i (the task is run more often), smaller D i (greater responsiveness).
The design space There may be some external constraint: task activation periods depend on external events; only a bunch of implementation is available. The selected tasks set needs to be schedulable! We need to define a schedulability condition/constraint
Una linea Attempt 1: Response Time An iterative algorithm applied to the task set/application x x YESNO It does not provide informative result: distance to the boundary.
Using Response Time for optimizing NO designVar2 designVar1 reward function Initial solution ? ? ? ? ? ? ? ? ? ? ? Where? A “YES/NO” test is not well suited for optimization algorithms!!
Attempt 2: Simpler Formulation The RT literature offers many simpler only sufficient test: Liu & Layland test Hyperbolic Bound More restrictive Only a suboptimum is found Opt. methods may be applied Closed Formulation
Attempt 3 * : Closed formulation + iff * the good one a closed (OK for optimization) necessary and sufficient (no suboptimum) formulation of the schedulable application domain The goal To make it easier, we consider: is a domain of C i, function of T i, D i.
First little break
The time demand Y i (t) It occurs when all the task are simultaneously activated at t 0, they require the maximum possible C i, every T i. It is: Time Demand Y i (t 0, t 1 ) “Max computation time required by the first i higher priority tasks in the interval [t 0, t 1 ] ”
iff schedulability condition When the tasks from 1 to i-1 are running, the task i is schedulable iff : Is 3 schedulable? 1111 2222 3333
Shrinking the points set Checking the: on the infinity of points in [0, D i ] is not feasible! By arbitrarily eliminating points in the set, results in more stringent condition: By arbitrarily eliminating points in the set, results in more stringent condition: ONLY SUFFICIENT! What is the smallest set of points, such that the condition keeps being necessary and sufficient?
Previous result ? [1989. Lehoczky, Sha, Ding] 1111 2222 3333
Our result [2002. Bini, Buttazzo] 1111 2222 3333
Comparing the results 1111 2222 3333 LSD BB [0,D i ] infinity of points LSD finite number unbounded, grow for large D i / T j BB bounded by 2 i-1 ProsCons
Schedulability of 1 Schedulability of C1C1C1C1 C2C2C2C2 Task periods are: T 1 = 3, T 2 =8, T 3 =20, D i = T i. Applying BB
Schedulability of Applying BB (cont’d)
C1C1 C2C2 C3C3 1 condition 2 condition 3 condition Drawing the Schedulability Region
Second little break
Given the tasks set Build the schedulabilityregion YESNO WCETs C i T i and D i Check C i in the region the the Hyperplanes Hyperplanes Exact Exact Test Test Hyperplanes Exact Test
We compared the number of steps of the test with respect to: Response Time Analysis (by Audsley et al., Dec. 1993) Response Time analysis Improved (by Sjödin, Hansson, Dec. 1995) Performance of the HET
number of steps density n tasks average steps number RTA=Response Time Analysis RTI=Response Time analysis Improved HET=Hyperplanes Exact Test Performance of the HET
Putting everything together When the design variables are: The design problem is so formulated: The design domain is NOT convex! BAD NEWS
Max performance on C i : the 2 tasks case C1C1C1C1 C2C2C2C
Future work Implementing the optimization algorithm by Branch & Bound. To find the schedulability region in the periods/deadlines domain. Developing a complete tool for the tuning of RT systems.
The End