ph. d. candidate scuola superiore s.anna pisa - italy designing real-time software visiting prof....
Post on 22-Dec-2015
212 views
TRANSCRIPT
Ph. D. candidatePh. D. candidateScuola Superiore S.AnnaScuola Superiore S.Anna
Pisa - Pisa - ItalyItaly
Designing Real-Time Designing Real-Time SoftwareSoftware
visiting prof. Baruahvisiting prof. BaruahUniv. of North CarolinaUniv. of North CarolinaChapel Hill - NCChapel Hill - NC
Designing is optimizingDesigning is optimizing
where:where: the application is represented by a the application is represented by a tuple of design variables tuple of design variables xx;; xx is in a design space is in a design space ;; the reward function the reward function ff express our express our goal.goal.
xxf
subject to)(max
The designer has to find the The designer has to find the application application xx, such that:, such that:
Application modelApplication model
Application model: tasks set Application model: tasks set {{11,, 22, …,, …,
nn}.}. ii = ( = (CCii, , TTii, , DDii)), where:, where:
CCii is the max computation time of is the max computation time of ii (WCET). (WCET). TTii is the min interarrival time (or period). is the min interarrival time (or period). DDii is the relative deadline. is the relative deadline.
UUii = = CCii / / TTii is t is thhe utilization factor of e utilization factor of ii..
DDii T Tii..
Task Task xx = (2, 4, 3) = (2, 4, 3)absolute deadlinesabsolute deadlines
activation instantsactivation instants
Design Design variables/Reward variables/Reward
functionfunction The designer of RT software can The designer of RT software can select among:select among:
many implementations of an algorithm (many implementations of an algorithm (CCii);); different periods on the programmable timers different periods on the programmable timers ((TTii);); different task deadlines (different task deadlines (DDii).). nnnn DTCDTCDTCx ,,,,,,,,, 122111
The reward function The reward function ff((xx)) typically: typically: pushes against the schedulability;pushes against the schedulability; increases for: bigger increases for: bigger CCii (better algorithm), (better algorithm), smaller smaller TTii (the task is run more often), smaller (the task is run more often), smaller DDii (greater responsiveness).(greater responsiveness).
The design space The design space
There may be some external There may be some external constraint:constraint:
task activation periods depend on external task activation periods depend on external events;events; only a bunch of implementation is available.only a bunch of implementation is available.
The selected tasks setThe selected tasks setneeds to be schedulable!needs to be schedulable!
We need to define a We need to define a schedulability schedulability condition/constraintcondition/constraint
nnn DTCDTCDTC ,,,,,, 222111
Una lineaUna lineaAttempt 1: Response Attempt 1: Response
TimeTime
An iterative algorithm applied toAn iterative algorithm applied to
the task set/application the task set/application xx
xx
?Is xYESYES NONO
It does not provide informative result:It does not provide informative result: distance to the boundary.distance to the boundary.
Using Response Time Using Response Time for optimizingfor optimizing
NO
designVar2
designVar1
rewardfunction
Initial solution
? ? ?
??
? ?
??
??
Where?
A “YES/NO” test is not well suited for A “YES/NO” test is not well suited for optimization algorithms!!optimization algorithms!!
Attempt 2: Simpler Attempt 2: Simpler FormulationFormulation
The RT literature offers many The RT literature offers many simpler only sufficient test:simpler only sufficient test:Liu & Layland testLiu & Layland test 12
1
nn
i ii nTC
Hyperbolic BoundHyperbolic Bound 211
n
i ii TC
More restrictiveMore restrictive
Only a Only a suboptimum is suboptimum is
foundfound
Opt. methodsOpt. methodsmay be appliedmay be applied
Closed Closed FormulationFormulation
Attempt 3Attempt 3**: Closed : Closed formulation + formulation + iffiff
** the good the good oneone
nnn DTCDTCDTC ,,,,,, 222111
a a closedclosed (OK for optimization) (OK for optimization)necessary and sufficientnecessary and sufficient (no (no
suboptimum) formulation of the suboptimum) formulation of the schedulableschedulable application domain application domain
The goalThe goal
nnn CCCDDTT ,,,,,,,, 2111 To make it easier, we consider:To make it easier, we consider:
is a domain of is a domain of CCii, function of , function of TTii, , DDii..
First little First little breakbreak
The time demand The time demand YYii((tt))
It occurs when all the task are It occurs when all the task are simultaneously activated at simultaneously activated at tt00, they , they require the maximum possible require the maximum possible CCii, ,
every every TTii. It is:. It is:
i
jj
ji C
T
ttY
1
Time DemandTime Demand YYi i ((tt00 , , tt11))
““Max computation time required by Max computation time required by the first the first ii higher priority tasks in the higher priority tasks in the
interval interval [[tt00 , , tt11]]””
iffiff schedulability schedulability conditioncondition
ttYCDt iii 1 ,0
When the tasks from When the tasks from 11 to to ii-1-1 are are running, the task running, the task ii is schedulable is schedulable iffiff::
Is Is 33 schedulable? schedulable?
101000 55 1515 2020
11
22
33
Shrinking the points Shrinking the points setset
Checking the:Checking the:
on the infinity of points in on the infinity of points in [0, [0, DDii]]
is not feasible!is not feasible!
ttYC ii 1
By arbitrarily By arbitrarily eliminating points eliminating points in the set, results in the set, results in more stringent in more stringent
condition:condition:ONLY SUFFICIENT!ONLY SUFFICIENT!
What is the What is the smallest set of smallest set of
points, such that points, such that the condition keeps the condition keeps
being necessary being necessary and sufficient?and sufficient?
Previous resultPrevious result
1
1
i
jj
ji tC
T
tCt ?
[1989. Lehoczky, Sha, Ding][1989. Lehoczky, Sha, Ding]
tT
tkijkTt
jji 1 ;1 :
S
101000 55 1515 2020
11
22
33
ii D1S
Our resultOur result
tTT
tt
tt
iii
ii 11
0
PPP
P
[2002. Bini, Buttazzo][2002. Bini, Buttazzo] ii D1P
101000 55 1515 2020
11
22
33
Comparing the resultsComparing the results
101000 55 1515 2020
11
22
33
LSDLSDBBBB
[0,D[0,Dii]]
[0,D[0,Dii]] infinity of pointsinfinity of points
LSDLSD finite numberfinite number unbounded,unbounded,grow for large grow for large
DDii / / TTjjBBBB bounded by bounded by 22ii-1-1
ProsPros ConsCons
Schedulability of Schedulability of 11 330 P 31 C
Schedulability of Schedulability of 22 8,68 68 001 PPP
83
62
21
21
CC
CC
00
33
88
CC11
CC22
Task periods areTask periods are: : TT11= 3, = 3, TT22=8, =8, TT33=20=20, , DDii= = TTii..
Applying BBApplying BB
Schedulability of Schedulability of 33
20,18,16,15
20 1620
11
2
PP
P
2037
1836
1626
1525
321
321
321
321
CCC
CCC
CCC
CCC5500 1010 1515 2020
Applying BBApplying BB (cont’d)(cont’d)
31 C
C1
C2 C3
1 1 condition condition
2 2 condition condition
3 3 condition condition
2037
1836
1626
1525
321
321
321
321
CCC
CCC
CCC
CCC
83
62
21
21
CC
CC
Drawing the Drawing the SchScheeddulabilityulability Region Region
Second little Second little breakbreak
Given theGiven thetasks settasks set
Build theBuild theschedulabilischedulabili
tytyregionregion
YEYESS
NONO
WCETs WCETs CCii TTii and and DDii
Check Check CCii inin
the regionthe region
thethe HHyperplanesyperplanes EExactxact TTestest
Hyperplanes Exact TestHyperplanes Exact Test
We compared the number of steps We compared the number of steps of the test with respect to:of the test with respect to:
Response Time AnalysisResponse Time Analysis(by Audsley et al., Dec. 1993)(by Audsley et al., Dec. 1993)
Response Time analysis Response Time analysis ImprovedImproved
(by Sjödin, Hansson, Dec. (by Sjödin, Hansson, Dec. 1995)1995)
Performance of the HETPerformance of the HET
00 5050 100100 150150 200200 25025000
0.020.02
0.040.04
0.060.06
0.080.08
number of steps
density
33 1010 2020 3030 4040 5050
n tasks00
500500
10001000
15001500
average steps number
RTARTA==RResponse esponse TTime ime AAnalysisnalysisRTIRTI==RResponse esponse TTime analysis ime analysis IImprovedmprovedHETHET==HHyperplanes yperplanes EExact xact TTestest
Performance of the HETPerformance of the HET
Putting everything Putting everything togethertogether
When the design variables are:When the design variables are: nCCC ,,, 21
The design problem is so formulated:The design problem is so formulated:
tC
T
tC
CCCf
i
jj
ji
Dtni
n
ii
1
11
21
1
subject to),,,(max
P
The design domain is NOT convex!The design domain is NOT convex!
BAD NEWSBAD NEWS
AA
CC
A CCCCfz 212162
,,max21
Max performance on Max performance on CCii: the : the 2 tasks case2 tasks case
00 11 22 33 44 55 66 8877
CC11
CC22
00
22
33
11
BB
CC
B CCCCfz 212183
,,max21
AB zz
Future workFuture work
Implementing the optimization Implementing the optimization algorithm by Branch & Bound.algorithm by Branch & Bound.
To find the schedulability region To find the schedulability region in the periods/deadlines domain.in the periods/deadlines domain.
Developing a complete tool for Developing a complete tool for the tuning of RT systems.the tuning of RT systems.
The EndThe End