Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof....

27
Ph. D. candidate Ph. D. candidate Scuola Superiore S.Anna Scuola Superiore S.Anna Pisa - Pisa - Italy Italy Designing Real-Time Designing Real-Time Software Software visiting prof. Baruah visiting prof. Baruah Univ. of North Carolina Univ. of North Carolina Chapel Hill - NC Chapel Hill - NC
  • date post

    22-Dec-2015
  • Category

    Documents

  • view

    212
  • download

    0

Transcript of Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof....

Page 1: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 2: 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 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:

Page 3: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 4: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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).

Page 5: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 6: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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.

Page 7: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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!!

Page 8: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 9: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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..

Page 10: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

First little First little breakbreak

Page 11: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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]]””

Page 12: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 13: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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?

Page 14: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 15: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 16: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 17: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 18: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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)

Page 19: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 20: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

Second little Second little breakbreak

Page 21: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 22: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 23: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 24: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 25: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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

Page 26: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

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.

Page 27: Ph. D. candidate Scuola Superiore S.Anna Pisa - Italy Designing Real-Time Software visiting prof. Baruah Univ. of North Carolina Chapel Hill - NC.

The EndThe End