17/04/2015 What does it mean? Re spo nse -time a na lysis c o - - PDF document

17 04 2015
SMART_READER_LITE
LIVE PREVIEW

17/04/2015 What does it mean? Re spo nse -time a na lysis c o - - PDF document

17/04/2015 What does it mean? Re spo nse -time a na lysis c o nditio na l Response-Time Analysis DAG ta sks of Conditional DAG Tasks multipro c e sso r syste ms in Multiprocessor Systems Alessandra


slide-1
SLIDE 1

17/04/2015 1

1

Response-Time Analysis

  • f Conditional DAG Tasks

in Multiprocessor Systems

Alessandra Melani

2

 « Re spo nse -time a na lysis »  « c o nditio na l »  « DAG ta sks »  « multipro c e sso r syste ms »

What does it mean?

3

 « Re spo nse -time a na lysis »  « conditional »  « DAG ta sks »  « multipro c e sso r syste ms »

What does it mean?

If-then-else statements Switch statements 4

 « Re spo nse -time a na lysis »  « c o nditio na l »  « DAG tasks »  « multipro c e sso r syste ms »

What does it mean?

DAG: Directed Acyclic Graph

5

 We will a na lyze a multiprocessor re a l-time syste ms…  … b y me a ns o f a schedulability test b a se d o n response- time analysis  … a ssuming Global Fixed Priority o r Global EDF sc he duling po lic ie s  … a nd a ssuming a parallel task model (i.e ., a ta sk is mo de lle d a s a Directed Acyclic Graph - DAG)

In other words

6

 Ma ny pa ra lle l pro g ra mming mo de ls ha ve b e e n pro po se d to suppo rt pa ra lle l c o mputa tio n o n multipro c e sso r pla tfo rms (e .g ., Ope nMP, Cilk, I nte l T BB)

Parallel task models

E a rly re a l-time sc he duling mo de ls: e a c h re c urre nt ta sk is c o mple te ly se q ue ntia l Re c e ntly, mo re e xpre ssive e xe c utio n mo de ls a llo w e xplo ita tio n

  • f pa ra lle lism within ta sks
slide-2
SLIDE 2

17/04/2015 2

7

 E a c h ta sk is a n a lte rna ting se q ue nc e o f se q ue ntia l a nd pa ra lle l se g me nts  E ve ry pa ra lle l se g me nt ha s a de g re e o f pa ra lle lism (numb e r o f pro c e sso rs)

Fork-join

8

 Ge ne ra liza tio n o f the fo rk-jo in mo de l  Allo ws c o nse c utive pa ra lle l se g me nts  Allo ws a n a rb itra ry de g re e o f pa ra lle lism o f e ve ry se g me nt  Sync hro niza tio n a t se g me nt b o unda rie s: a sub -ta sk in the ne w se g me nt ma y sta rt o nly a fte r c o mple tio n o f a ll sub - ta sks in the pre vio us se g me nt

Synchronous-parallel

  • 9

 Dire c te d a c yc lic g ra ph (DAG)

,

,, … , , ; ⊆ ⨯

  •  Ge ne ra liza tio n o f the pre vio us two mo de ls

 E ve ry no de is a se q ue ntia l sub -ta sk  Arc s re pre se nt pre c e de nc e c o nstra ints b e twe e n sub -ta sks

DAG

10

 Co nditio na l - pa ra lle l DAG (c p-DAG)

,

 T wo type s o f no de s  Regular: a ll suc c e sso rs must b e e xe c ute d in pa ra lle l  Conditional: to mo de l sta rt/ e nd o f a c o nditio na l c o nstruc t (e .g ., if-the n-e lse sta te me nt)  E a c h no de ha s a WCE T ,  I n this le c ture , we will fo c us o n this ta sk mo de l

cp-DAG

11

 , fo rm a conditional pair

 is a sta rting c o nditio na l no de  is the jo ining po int o f the c o nditio na l b ra nc he s sta rting a t

 Restriction: the re c a nno t b e a ny c o nne c tio n b e twe e n a no de b e lo ng ing to a b ra nc h o f a c o nditio na l sta te me nt (e .g ., ) a nd no de s o utside tha t b ra nc h (e .g ., ), inc luding o the r b ra nc he s o f the sa me sta te me nt

Conditional pairs

12

 I t do e s no t ma ke se nse fo r to wa it fo r if is e xe c ute d  Ana lo g o usly, c a nno t b e c o nne c te d to sinc e o nly o ne is e xe c ute d  Vio la tio n o f the c o rre c tne ss o f c o nditio na l c o nstruc ts a nd the se ma ntic s o f the pre c e de nc e re la tio n

Why this restriction?

slide-3
SLIDE 3

17/04/2015 3

13

L e t , b e a pa ir o f c o nditio na l no de s in a DAG

, .

T he pa ir , is a c o nditio na l pa ir if the fo llo wing ho ld:  Suppo se the re a re e xa c tly o utg o ing a rc s fro m to the no de s , , … , , fo r so me 1. T he n the re a re e xa c tly inc o ming a rc s into in , fro m so me no de s , , … ,

Formal definition (1)

14

 F

  • r e a c h ∈ 1,2, … , , le t

a nd ⊆ de no te all

the no de s a nd arc s o n pa ths re a c ha b le fro m tha t do no t inc lude . By de finitio n, is the so le so urc e no de

  • f the

DAG

  • , ′. I

t must ho ld tha t is the so le sink no de o f

.

Formal definition (2)

… …

  • , ′

15

 I t must ho ld tha t

  • ∅ fo r a ll , , .

Additio nally, with the e xc e ptio n o f , , the re sho uld b e no a rc s in into no de s in

′ fro m no de s no t in ′, fo r

e a c h ∈ 1,2, … , . T ha t is, ∩

  • \
  • , sho uld ho ld fo r a ll .

Formal definition (3)

… …

  • 16

 Why is it impo rta nt to e xplic itly mo de l c o nditio nal sta te me nts?  Whic h b ra nc h le a ds to the wo rst-c a se re spo nse -time ?

Motivating example (1)

17

Motivating example (2)

  • 1 processor

10 18

U ppe r-b ra nc h Lower-branch

  • 2 processors

12 10

U ppe r-b ra nc h Lower-branch

18

Motivating example (3)

  • ≥ 3 processors

10

Upper-branch L

  • we r-b ra nc h

6

  • 3 processors + 1 interfering task of 6 time-units

10

U ppe r-b ra nc h Lower-branch

12

slide-4
SLIDE 4

17/04/2015 4

19

Motivating example (4)

 T his e xa mple sho ws tha t it ma ke s se nse to e nric h the ta sk mo de l with c o nditio nal sta te me nts whe n de a ling with parallel task models  De pe nding o n the numb e r o f pro c e sso rs a nd o n the

  • the r ta sks, no t a lwa ys the sa me b ra nc h le a ds to the

wo rst-c a se re spo nse -time  Why we do no t mo de l c o nditio na l sta te me nts a lso with se q ue ntia l ta sk mo de ls?

 Co nditio nal b ra nc he s a re inc o rpo ra te d in the no tio n o f WCE T (lo ng e st c ha in o f e xe c utio n)  T he o nly pa ra me te rs ne e de d to c o mpute the re spo nse -time o f a ta sk a re the WCE T s, pe rio ds a nd de a dline s o f e a c h ta sk in the syste m

20

 c o nditio nal-pa ra lle l ta sks (c p-ta sks) τ, e xpre sse d a s c p- DAGs in the fo rm

,

 pla tfo rm c o mpo se d o f ide ntic a l pro c e sso rs  sporadic a rrival pa tte rn (minimum inte r-a rriva l time

  • b e twe e n jo b s o f ta sk τ)

 constrained re la tive de a dline Pro b le m: c o mpute a safe upper-bound o n the re spo nse -time

  • f

e a c h c p-ta sk, with a ny wo rk-c o nse rving a lg o rithm (inc luding Glo b a l F P a nd Glo b a l E DF )

System model

21

  • 1. Cha in (o r pa th) o f a c p-ta sk
  • 2. L
  • ng e st pa th
  • 3. Vo lume
  • 4. Wo rst-c a se wo rklo a d
  • 5. Critic a l c ha in

Quantities of interest

22

A c hain (o r pa th) o f a c p-ta sk τ is a se q ue nc e o f no de s λ ,, … , , suc h tha t ,, , ∈ , ∀ ∈ , .

  • 1. Chain (or path)

23

A c hain (o r pa th) o f a c p-ta sk τ is a se q ue nc e o f no de s λ ,, … , , suc h tha t ,, , ∈ , ∀ ∈ , . T he le ng th o f the c hain, de no te d b y λ, is the sum o f the WCE T s o f a ll its no de s: λ ,

  • 1. Chain (or path)

24

T he lo ng e st pa th o f a c p-ta sk τ is any so urc e -sink c ha in o f the ta sk tha t a c hie ve s the lo ng e st le ng th a lso re pre se nts the time re q uire d to e xe c ute it whe n the numb e r o f pro c e ssing units is infinite (la rg e e no ug h to a llo w ma ximum pa ra lle lism) Ne c e ssa ry c o nditio n fo r fe a sib ility:

  • 2. Longest path
slide-5
SLIDE 5

17/04/2015 5

25

Ho w to c o mpute the lo ng e st pa th?

  • 1. F

ind a to po lo g ic a l o rde r o f the g ive n c p-DAG  A to po lo g ic a l o rde r is suc h tha t o f the re is a n a rc fro m to in the c p-DAG, the n a ppe a rs b e fo re in the to po lo g ic a l o rde r → c a n b e do ne in  E xa mple : fo r this c p-DAG po ssib le to po lo g ic a l o rde rs a re

  • , , , , , , , ,
  • , , , , , , , ,
  • , , , , , , , ,
  • 2. Longest path

26

Ho w to c o mpute the lo ng e st pa th?

  • 2. F
  • r e a c h ve rte x , o f the c p-DAG in the to po lo g ic a l o rde r,

c o mpute the le ng th o f the lo ng e st pa th e nding a t , b y lo o king a t its inc o ming ne ig hb o rs a nd a dding , to the ma ximum le ng th re c o rde d fo r tho se ne ig hb o rs If , ha s no inc o ming ne ig hb o rs, se t the le ng th o f the lo ng e st pa th e nding a t , to , E xa mple :

  • F
  • r , re c o rd 1
  • F
  • r , re c o rd 2
  • F
  • r , re c o rd 5
  • F
  • r , re c o rd 6
  • F
  • r , re c o rd max 5, 6 6
  • 2. Longest path

27

Ho w to c o mpute the lo ng e st pa th?

  • 3. F

ina lly, the lo ng e st pa th in the c p-DAG ma y b e o b ta ine d b y sta rting a t the ve rte x , with the la rg e st re c o rde d va lue , the n re pe a te dly ste pping b a c kwa rds to its inc o ming ne ig hb o r with the la rg e st re c o rde d va lue , a nd re ve rsing the se q ue nc e fo und in this wa y E xa mple : recorded values Co mple xity o f the lo ng e st pa th c o mputa tio n:

  • 2. Longest path
  • Sta rting a t a nd ste pping

b a c kwa rd we find the se q ue nc e , , , , ,

  • T

he lo ng e st pa th is the n , , , , , 28

I n the absence o f c o nditio nal b ra nc he s, the vo lume o f a ta sk is the wo rst-c a se e xe c utio n time ne e de d to c o mple te it o n a de dic a te d sing le -c o re pla tfo rm I t c a n b e c o mpute d a s the sum o f the WCE T s o f a ll its ve rtic e s: ,

,∈

  • 3. Volume

1

It a lso re pre se nts the ma ximum a mo unt o f wo rklo a d g e ne ra te d b y a sing le insta nc e o f a DAG-ta sk

29

I n the presence o f c o nditio nal b ra nc he s, the wo rst-c a se wo rklo a d o f a ta sk is the wo rst-c a se e xe c utio n time ne e de d to c o mple te it o n a de dic a te d sing le -c o re pla tfo rm, o ve r all c o mbinatio n o f c ho ic e s fo rthe c o nditio nalbranc he s I n this e xa mple , the wo rst-c a se wo rklo a d is g ive n b y a ll the ve rtic e s e xc e pt , sinc e the b ra nc h c o rre spo nding to yie lds a la rg e r wo rklo a d

  • 4. Worst-case workload

It a lso re pre se nts the ma ximum a mo unt o f wo rklo a d g e ne ra te d b y a sing le insta nc e o f a c p-ta sk

30

Ho w c a n it b e c o mpute d?

  • 4. Worst-case workload

re ve rse to po lo g ic a l o rde r ta ke s the e le me nt o f the pe rmuta tio n S ta ke s the a c c umula te d wo rst-c a se wo rklo a d fro m till the e nd o f the c p-DAG if the ve rte x ha s so me suc c e sso rs if the ve rte x is the he a d no de o f a c o nditio na l pa ir ∗ is the suc c e sso r o f a c hie ving the la rg e st pa rtia l wo rklo a d ∗ is me rg e d into if inste a d the ve rte x is a re g ula r o ne the wo rklo a d o f a ll suc c e sso rs is me rg e d into the wo rst-c a se wo rklo a d a c c umula te d by the so urc e ve rte x is re turne d a s o utput

slide-6
SLIDE 6

17/04/2015 6

31

  • 4. Worst-case workload

 Wha t is the c o mple xity o f this a lg o rithm?

  • || se t o pe ra tio ns
  • Any o f the m ma y re q uire to

c o mpute , whic h ha s c o st || T he time c o mple xity is the n |||| 32

 Give n a se t o f c p-ta sks a nd a (wo rk-c o nse rving ) sc he duling a lg o rithm, the critical chain λ

∗ o f a c p-ta sk τ is the c hain o f

ve rtic e s o f τ tha t le a ds to its wo rst-c a se re spo nse -time

  • 5. Critical chain

 Ho w c a n it b e ide ntifie d?

 We sho uld kno w the wo rst-c a se insta nc e o f τ (i.e ., the jo b o f τ tha t ha s the la rg e st re spo nse -time in the wo rst-c a se sc e na rio )  T he n we sho uld ta ke its sink ve rte x , a nd re c ursive ly pre -pe nd the la st to c o mple te a mo ng the pre de c e sso r no de s, until the so urc e ve rte x , ha s b e e n inc lude d in the c ha in

Key observation: the c ritic a l c ha in is unkno wn, b ut is a lwa ys uppe r-b o unde d b y the lo ng e st pa th o f the c p-ta sk!

33

T

  • find

the re spo nse -time

  • f a

c p-ta sk, it is suffic ie nt to c ha ra c te rize the ma ximum inte rfe re nc e suffe re d b y its c ritic al c ha in T he critical interference , impo se d b y ta sk τ o n ta sk τ is the c umula tive wo rklo a d e xe c ute d b y ve rtic e s o f τ while a no de b e lo ng ing to the c ritic a l c hain o f τ is re a dy to e xe c ute b ut is no t e xe c uting

Critical interference

i i i

CPU1 CPU2 CPU3

τ4 τ1 τ2 τ3 τ2 τ5 τ6 τ8 τ5 τ3 τ7 τ3

  • i

Critic a l c ha in

τk

Critic a l inte rfe re nc e

  • f τ o n τ

34

 : to ta l inte rfe re nc e suffe re d b y ta sk τ  ,: to ta l inte rfe re nc e o f ta sk τ o n ta sk τ

Critical interference

i i i

CPU1 CPU2 CPU3

  • λ

∗ + λ ∗ + ∑ ,

  • F
  • r a ny wo rk-c o nse rving a lg o rithm!

∑ ,

  • τ4

τ1 τ2 τ3 τ2 τ5 τ6 τ8 τ5 τ3 τ7 τ3

35

 In the pa rtic ula r c a se whe n , the c ritic a l inte rfe re nc e , inc lude s inte rfe ring c o ntrib utio ns

  • f ve rtic e s o f the sa me ta sk (no t b e lo ng ing to the

c ritic a l c ha in) o n τ itse lf  T his type o f inte rfe re nc e is c a lle d self-interference (o r intra-task inte rfe re nc e ) a nd is peculiar to parallel tasks o nly  T he inte rfe re nc e fro m o the r ta sks in the syste m is c a lle d inter-task interference

Types of interference

λ

∗ λ ∗ ∑ ,

  • λ

  • ,

∑ ,

  • self-int.

inter-task int.

c ritic a l c ha in se lf-inte rf. o n 2 pro c e sso rs

36

 Ca use d b y o the r c p-ta sks e xe c uting in the syste m  F inding it e xa c tly is diffic ult  We ne e d to find a n upper-bound on the workload o f a n inte rfe ring ta sk in the sc he duling windo w ,

Inter-task interference

 In the se q ue ntia l c a se (g lo b a l multipro c e sso rsc he duling ):

Carry-in job Body jobs Carry-out job

Wha t is the sc e na rio tha t ma ximize s the inte rfe ring wo rklo a d?

slide-7
SLIDE 7

17/04/2015 7

37

 Sequential case

 T he first jo b o f τ sta rts e xe c uting a s la te a s po ssib le , with a sta rting time a lig ne d with the b e g inning o f the sc he duling windo w  L a te r jo b s a re e xe c ute d a s so o n a s po ssib le

 Parallel case

 T his sc e na rio ma y no t g ive a sa fe uppe r-b o und o n the inte rfe ring wo rklo a d. Why?

Inter-task interference

Shifting rig ht the sc he duling windo w ma y g ive a la rg e rinte rfe ring wo rklo a d!

  • 38

 Pessimistic assumption

 E a c h inte rfe ring jo b o f ta sk τ e xe c ute s fo r its wo rst-c a se wo rklo a d

  •  T

he c a rry-in a nd c a rry-o ut c o ntrib utio ns a re e ve nly distrib ute d a mo ng a ll pro c e sso rs  Distrib uting the m o n le ss pro c e sso rs c a nno t inc re a se the wo rklo a d within the windo w  Othe r ta sk c o nfig ura tio ns c a nno t le a d to a hig he rwo rklo a d within the windo w

Inter-task interference

  • 39

 Lemma: An uppe r-b o und o n the wo rklo a d o f a n inte rfe ring ta sk τ in a sc he duling windo w o f le ng th is g ive n b y

/

  • min

, ∙

  •  Proof:

 T he ma ximum numb e r o f c a rry-in a nd b o dy insta nc e s within the windo w is

/

  • Inter-task interference
  • /
  • 40

 Proof (continued):  E a c h o f the

/

  • insta nc e s c o ntrib ute s fo r
  •  T

he po rtio n o f the c a rry-o ut jo b inc lude d in the windo w is

  •  At mo st pro c e sso rs ma y b e o c c upie d b y the c a rry-o ut jo b

 T he c a rry-o ut jo b c a nno t e xe c ute fo r mo re tha n

units

Inter-task interference

/

  • min

, ∙

41

 Simple upper-bound λ

∗ λ ∗

  • ,

∑ ,

  • Intra-task interference

,

≝ λ

∗ 1

, λ

∗ 1 λ ∗

1

  • λ

c ritic a l c ha in L e ng th o f the lo ng e st pa th 42

 Schedulability condition Give n a c p-ta sk se t g lo b a lly sc he dule d o n pro c e sso rs, a n uppe r- b o und

  • n the re spo nse -time o f a ta sk τ c a n b e de rive d b y the

fixe d-po int ite ra tio n o f the fo llo wing e xpre ssio n, sta rting with

:

  • 1

1

Putting things together

 Global FP

  • ,

∀ 0,

  •  Global EDF
  • , ∀

De c re a sing prio rity o rde r

/

  • min

, ∙

slide-8
SLIDE 8

17/04/2015 8

43

  • 1

1

Putting things together

 Global FP T he fixe d-po int ite ra tio n upda te s the b o unds in de c re a sing prio rity

  • rde r, sta rting fro m the hig he st prio rity ta sk, until e ithe r:

 o ne o f the re spo nse -time b o unds e xc e e ds the ta sk re la tive de a dline (ne g a tive sc he dula b ility re sult);  OR no mo re upda te is po ssib le (po sitive sc he dula b ility re sult), i.e ., ∀ :  Global EDF  Multiple ro unds ma y b e ne e de d

44

  • A. Me la ni, M. Be rto g na , V. Bo nifa c i, A. Ma rc he tti-

Spa c c a me la , G. Butta zzo , Re sponse -T ime Analysis of Conditional DAG T asks in Multipr

  • c e ssor Syste ms,

Pro c e e ding s o f the 27th E uro mic ro Co nfe re nc e

  • n

Re a l-T ime Syste ms (E CRT S 2015)

Reference

45

T ha nk yo u!

Ale ssa ndra Me la ni a le ssa ndra .me la ni@ sssup.it