Integrating Cache-Related Pre-emption Delays into Analysis of

advertisement

Integrating Cache-Related

Pre-emption Delays into Analysis of

Fixed-Priority Scheduling with Preemption Thresholds

Reinder J. Bril, Sebastian Altmeyer,

Martijn M.H.P. v.d. Heuvel, Robert I. Davis, and

Moris Behnam

RTSS-2014 (Rome, Italy)

Background and motivation

• Why caches?

• bridges speed-gap between processors and memory;

• reduces conflicts on the system bus;

• give rise to additional delays upon preemptions…

• Why Fixed-Priority Pre-emptive Scheduling (FPPS)?

• described in standards, e.g. OSEK/AUTOSAR [1, 2];

• supported by most COTS RTOS;

• de facto standard in industry;

• arbitrary pre-emptions.

• SotA: integrated CRPD into analysis for FPPS [3].

[1] OSEK/VDX operation system, 2005.

[2] AUTOSAR 2010.

[3] S. Altmeyer, R.I. Davis and C. Maiza, RTSJ, 2012.

RTTS-2014 (Rome, Italy) PAGE 2

Background and motivation

• Basic notions for CRPD [26, 4]:

• evicting cache blocks (ECBs):

− any block that can be accessed by a task;

• useful cache blocks (UCBs):

− blocks that may be re-used without self-eviction;

• block reload time (BRT):

− time needed to load a block in cache;

• number of cache sets ( N ): size of the cache;

• cache utilization of task

 i

( U i

C ): |ECB i

|/ N ;

• total cache utilization ( U C ):

 i

|ECB i

|/ N .

[26] C.-G. Lee et al., IEEE TC, 1998.

[4] S. Altmeyer and C. Maiza, JSA, 2011.

RTTS-2014 (Rome, Italy) PAGE 3

Background and motivation

• SotA: integrated CRPD into analysis for FPPS [3].

Experiment:

• n = 10 tasks;

T i

(= D i

)

[10,1000] ms;

U i task util. by UUnifast [11];

• 1000 systems per

U set util.

Cache related:

N = 512 cache sets, BRT = 8

 s;

U C = 4 total cache utilization

(total # of ECBs is 512 x 4);

U i

C task cache util. by UUnifast;

• 40% of ECBs are UCBs.

CRPD has a significant impact on schedulability!

[11] E. Bini and G. Buttazzo, RTSJ, 2005.

[3] S. Altmeyer, R.I. Davis and C. Maiza, RTSJ, 2012.

RTTS-2014 (Rome, Italy) PAGE 4

Background and motivation

• SotA: integrated CRPD into analysis for FPPS [3].

Experiment:

• n = 10 tasks;

T i

(= D i

)

[10,1000] ms;

U i task util. by UUnifast [11];

• 1000 systems per

U set util.

Cache related:

N = 512 cache sets;

U C = 4 total cache utilization

(total # of ECBs is 512 x 4);

U i

C task cache util. by UUnifast;

• 40% of ECBs are UCBs.

CRPD has a significant impact on schedulability!

[11] E. Bini and G. Buttazzo, RTSJ, 2005.

[3] S. Altmeyer, R.I. Davis and C. Maiza, RTSJ, 2012.

RTTS-2014 (Rome, Italy) PAGE 5

Background and motivation

• Problem: Arbitrary pre-emptions of FPPS

• Challenge:

• reduce CRPD for FPS by limiting arbitrary pre-emptions

• Approach:

• use a “practical” limited-pre-emptive FPS

• forth-coming de facto standard in industry?

RTTS-2014 (Rome, Italy) PAGE 6

Background and motivation

• Orthogonal limited pre-emptive FPS approaches

1. non-pre-emptive regions (NPRs): a) static , each job is a sequence of NPRs [16]; b) dynamic or floating , upon another activation [34];

2. pre-emption thresholds [33].

• Evaluation

• theoretical

 static NPRs (FPDS) [18];

• practical

pre-emption thresholds (FPTS).

[16] A. Burns, in: Advances in Real-Time Systems , 2004.

[34] G. Yao, G. Buttazzo, and M. Bertogna, RTCSA, 2009.

[33] Y. Wang and M. Saksena, RTCSA, 1999.

[18] G. Buttazzo, M. Bertogna, and G. Yao, IEEE-TII, 2013.

RTTS-2014 (Rome, Italy) PAGE 7

Background and motivation

• Why FPTS?

• pre-emption thresholds assignment at integration time

− (NPR configuration problematic for FPDS);

• supported by

− code-wrappers;

− OSEK/AUTOSAR (partially via internal resources );

− (dedicated RTOS-support required by floating NPRs);

• limits arbitrary pre-emptions

− (unlike floating NPRs).

• Evolutionary successor of FPPS as defacto standard!

RTTS-2014 (Rome, Italy) PAGE 8

Goals / contributions

1.

Integrate CRPD in Analysis of FPTS for sporadic tasks with arbitrary deadlines;

2.

Conceive an OTA (Optimal Threshold Assignment) algorithm for FPTS with CRPD;

3.

Evaluate schedulability ratio of FPPS with CRPD and FPTS with CRPD for constrained deadlines.

RTTS-2014 (Rome, Italy) PAGE 9

Recap: CRPD in Analysis for FPPS [3]

• Worst-case response time R i of task

 i

:

R i

C i

 

 j

 hp (

E i

) j

( R i

)

C j

  i , j

( R i

)

• where

E j

( R i

) =

R i

/ T j

 i,j

( R i

) : CRPD of task

 i

due to task

 j

.

• Definition of

 i,j

( R i

) is CRPD-approach specific.

[3] S. Altmeyer, R.I. Davis and C. Maiza, RTSJ, 2012.

RTTS-2014 (Rome, Italy) PAGE 10

Recap: CRPD in Analysis for FPPS

• Approaches for

 i,j

( R i

) :

• pre-empting tasks only [17]:

− based on ECBs only;

• pre-empted tasks only [26]:

− based on UCBs only;

• pre-empting and pre-empted tasks [32, 3]:

− based on ECBs and UCBs.

• For details, see [3].

[17] T.V. Busquets-Mataix et al., RTAS, 1996.

[26] C.-G. Lee et al., IEEE-TC, 1998.

[32] J. Staschulat et al., ECRTS, 2005.

[3] S. Altmeyer, R.I. Davis and C. Maiza, RTSJ, 2012.

RTTS-2014 (Rome, Italy) PAGE 11

Recap: CRPD in Analysis for FPPS

Interval

FPPS ( D i

T i

)

Execute

Affected by

 j

[0, R i

) hep (

 i

) lp(

 j

)

hep(

 i

)

Basics to determine

 i,j

( R i

) for FPPS.

Number of jobs

E h

( R i

)

0 if h

 hep ( otherwise

π i

)

• When we focus on:

• pre-empting tasks, we need “Affected by”;

• pre-empted tasks, we also need “Number of jobs”.

RTTS-2014 (Rome, Italy) PAGE 12

Recap: Analysis for FPTS

• Distinguishing characteristic of FPTS:

• pre-emption threshold

 i

for task

 i

with

 i

  i

 

1

;

• Compared to FPPS, a job of task

 i

may now be

• blocked by a task

 b

with a lower priority and a higher pre-emption threshold than

 i

: b

lp(

 i

) \ lt(

 i

) ;

• delayed by its previous job, even for constrained deadlines;

• pre-empted by a task

 j

with a priority higher than the pre-emption threshold

 i of

 i

: j

hp(

 i

) .

RTTS-2014 (Rome, Italy) PAGE 13

Recap: Analysis for FPTS

• Distinguishing characteristic of FPTS:

• pre-emption threshold

 i

for task

 i

with

 i

  i

 

1

;

• To determine R i

of task

 i

[30, 25]:

• determine worst-case blocking B i

;

• consider all jobs of

 i

in a leveli active period L i

;

− determine worst-case start time S i,k

of job k ;

− optional blocking + delays of tasks

 j

with

 j

>

 i

;

− determine worst-case finalization time F i,k

of job k ;

− interference in [ S i,k

, F i,k

) by tasks

 j

with

 j

>

 i

;

R i

= max k

( F i,k

– kT i

).

[30] J. Regher, RTSS, 2002.

[25] U. Keskin et al., ETFA, 2010.

RTTS-2014 (Rome, Italy) PAGE 14

Hold times versus response times

A job can only be pre-empted during its hold -time.

Worst-case hold-time H i

and worst-case response R i

are equal ( H i

= R i

) for:

FPPS, independent tasks and constrained deadlines [12].

[12] R.J. Bril, PhD-thesis, TU/e, 2004.

RTTS-2014 (Rome, Italy) PAGE 15

Hold times versus response times

1

2

T

5

7

D

5

9

C

2

4.2

=

2

1

R

2

8.6

H

2

8.2

A previous job may delay the current job.

Worst-case hold-time H i

can be smaller than R i

for:

FPPS, independent tasks and arbitrary deadlines [13].

[13] R.J. Bril, G. Fohler, and W.F.J. Verhaegh, TU/e, 2008.

RTTS-2014 (Rome, Italy) PAGE 16

Hold times versus response times

1

2

3

4

T = D

6

7

9

11

C

1

2

2

2

4

3

2

1

4

4

3

3

R

3

5

8

8

Figure illustrates H i

and R i for

3

.

Task

3

can be:

• blocked by task

4

;

• delayed (without pre-emption) by task

2

;

• pre-empted only once by task

1

.

Task

2

cannot be pre-empted by

1

.

H

1

2

3

3

RTTS-2014 (Rome, Italy) PAGE 17

Hold times versus response times

Interval

Execute

Affected by

 j

Number of jobs

FPPS ( D i

T i

) FPTS

[0, R i

) hep (

 i

) lp(

 j

)

hep(

 i

)

[0, H i

)

{ i }

hp(

 i

) lt(

 j

)

({ i }

hp(

 i

))

E h

( R i

)

0 if h

 hep ( otherwise

π i

)

E h

(

1

0

H i

) if h if i

 hp ( θ otherwise i

)

Notes:

• exactly 1 job of

 i

in R i for FPPS ( D

• exactly 1 job of  i

in H i for FPTS. i

T i

);

RTTS-2014 (Rome, Italy) PAGE 18

Leveli active period, S i,k and F i,k

FPTS FPTS FPTS

Interval

Execute

Affected by

 j

Number of jobs

[0, L i

)

{ b }

hep(

 i

)

[0, S i,k

)

See [0, L i

)

[0, F i,k

)

See [0, L i

)

 lt(

 j

)

({ b }

hep(

 i

))

E h

(

1

0

L i

) if h

 hep if b

( otherwise

π i

)

See [0, L i

)

E h k

0

( S i , k

)

1 if if if h i b

 hp ( π otherwise i

)

See [0, L i

)

E h

( F i , k

) if h

 hp ( θ i

)



E k h

1

0

( S

 i ,

1 k

) if if if i h b

 hp ( π i

) \ hp otherwise

( θ i

)

Notes:

• exactly 1 job of  b

in L i

, S i,k exactly k jobs of

 i

in S exactly k +1 jobs of

 i,k

; i

in F i,k and F

. i,k

RTTS-2014 (Rome, Italy) PAGE 19

CRPD in FPTS

• Given this table,

• determining CRPD for FPTS is mainly math...

(for each of the aproaches described in [3])

• see (and enjoy) paper!

[3] S. Altmeyer, R.I. Davis and C. Maiza, RTSJ, 2012.

RTTS-2014 (Rome, Italy) PAGE 20

An OTA algorithm for FPTS with CRPD

• Recap: OTA alg. for FPTS without CRPD [33, 31]:

• assumptions:

1. priorities are given;

2. schedulability test for

 i

independent of pre-emption thresholds of tasks with a higher priority than

 i

;

• alg. traverses priorities in ascending order.

• Problem: 2 doesn’t hold for FPTS and CRPD

• pre-emption of

 h

by

 j

with

 i

<

 h

<

 j

depends on

 h

.

• Solution (see paper):

• traverse priorities in descending order.

[33] Y. Wang and M. Saksena, RTCSA, 1999.

[31] M. Saksena and Y. Wang, RTSS, 2001.

RTTS-2014 (Rome, Italy) PAGE 21

Comparative evaluation – I

• Ratio of schedulable task sets (example revisited)

Experiment:

• n = 10 tasks;

T i

(= D i

)

[10,1000] ms;

U i task util. by UUnifast [11];

• 1000 systems per

U set util.

Cache related:

N = 512 cache sets, BRT = 8

 s;

U C = 4 total cache utilization

(total # of ECBs is 512 x 4);

U i

C task cache util. by UUnifast;

• 40% of ECBs are UCBs.

FPTS significantly improves schedulability ratio!

[11] E. Bini and G. Buttazzo, RTSJ, 2005.

RTTS-2014 (Rome, Italy) PAGE 22

Comparative evaluation – II

• Weighted schedulability ratio [7] versus BRT

Experiment:

• n = 10 tasks;

T i

(= D i

)

[10,1000] ms;

U i task util. by UUnifast [11];

• 1000 systems per

U set util.

Cache related:

N = 512 cache sets;

U C = 4 total cache utilization

(total # of ECBs is 512 x 4);

U i

C task cache util. by UUnifast;

• 40% of ECBs are UCBs.

FPTS remains better than FPNS!

[11] E. Bini and G. Buttazzo, RTSJ, 2005.

[7] A. Bastoni, B. Brandurg, and J. Anderson, OSPERT, 2010.

RTTS-2014 (Rome, Italy) PAGE 23

Contributions

1.

Integrated CRPD into analysis for FPTS

• for sporadic tasks and arbitrary deadlines, covering the most effective approaches known to date;

• specializes to existing analysis for FPPS [3] for sporadic tasks with constrained deadlines.

2.

Optimal Threshold Assignment (OTA) algorithm

• minimizes effects of CRPD.

3.

Comparative evaluations for FPTS and FPPS

• significant extension of performance advantage;

• performance advantage of FPTS over FPNS (!)

[3] S. Altmeyer, R.I. Davis, and C. Maiza, RTSJ, 2012.

RTTS-2014 (Rome, Italy) PAGE 24

Conclusion and Future work

• Conclusion:

FPTS as forth-coming defacto standard in industry

− (partially) supported by OSEK and AUTOSAR

• Future work:

1.

CRPD reduction via layout of tasks in memory

2.

Optimal Priority and Pre-emption Threshold

Assignment (OPTA) algorithm

− computational tractable method...

RTTS-2014 (Rome, Italy) PAGE 25

Download