Critique #4 Due next Tuesday (4/14) Y. Zhang, C. Lu, C. Gill, P. - - PowerPoint PPT Presentation

critique 4
SMART_READER_LITE
LIVE PREVIEW

Critique #4 Due next Tuesday (4/14) Y. Zhang, C. Lu, C. Gill, P. - - PowerPoint PPT Presentation

Critique #4 Due next Tuesday (4/14) Y. Zhang, C. Lu, C. Gill, P. Lardieri and G. Thaker, Middleware Support for Aperiodic Tasks in Distributed Real-Time Systems, IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS), April


slide-1
SLIDE 1

Critique #4

Ø Due next Tuesday (4/14) Ø Y. Zhang, C. Lu, C. Gill, P. Lardieri and G. Thaker, Middleware Support for Aperiodic Tasks in Distributed Real-Time Systems, IEEE Real-Time and Embedded Technology and Applications Symposium (RTAS), April 2007.

Chenyang Lu 1

slide-2
SLIDE 2

Real-Time Scheduling

Multiprocessor and Distributed Systems

Chenyang Lu

slide-3
SLIDE 3

Multiprocessor System

Ø Tight coupling among processors. Ø Communicate through shared memory and on-board bus. Ø Scheduled by a common scheduler/OS.

q Global scheduling q Partitioned scheduling

Ø States of all processors available to each other.

Chenyang Lu 3

slide-4
SLIDE 4

Distributed System

Ø Loose coupling among processors

q Each processor has its own scheduler q Costly to acquire states of other processors

Ø Wide range of systems

q Processor boards mounted on a

VME bus

q Automobile: 100s processors connected through Control Area

Networks (CANs)

q Air traffic control system on a wide area network

Chenyang Lu 4

slide-5
SLIDE 5

End-to-End Task Model

Ø An (end-to-end) task is composed of multiple subtasks running on multiple processors

q Message, event, remote method invocation

Ø Task = a chain/tree/graph of subtasks

q Ti = {Ti,1, Ti,2,… , Ti,n(i)} q n(i): the number of subtasks of Ti q Precedence constraint: Job Ji,j cannot be released until Ji,j-1 finishes.

Chenyang Lu 5

T1 T2 T3 T11 T12 T13 P1 P2 P3

Precedence Constraints Subtask

slide-6
SLIDE 6

An End-to-End Task on Event Service

Ø Dependency implemented through events Ø Event Channel (EC) dispatches events according to their priorities. Ø Gateway forwards events between processors.

Chenyang Lu 6

Application Processor 1 Application Processor 2 Application Processor 3

T1,2 T1,3 T1,1

EC EC

Gateway

EC

Gateway

slide-7
SLIDE 7

End-to-End Deadline

Ø A task is subject to an end-to-end deadline. Ø Does not care about the response time of a subtask. Ø How to guarantee end-to-end deadlines in distributed systems?

Chenyang Lu 7

slide-8
SLIDE 8

End-to-End Scheduling

1. Task allocation 2. Synchronization protocol 3. Subdeadline assignment 4. Schedulability analysis

Chenyang Lu 8

slide-9
SLIDE 9

Task Allocation

Ø Map tasks to processors Ø Strategies

q Offline à static allocation q Online

  • Allocate a task when it arrives
  • Re-allocate (migrate) a task after it starts

Ø NP-hard à heuristics needed

Chenyang Lu 9

slide-10
SLIDE 10

Bin Packing

Ø Pack subtasks to bins (processors) with limited capacity

q Size of a subtask Ti,j: ui,j = Ci,j/Pi q Capacity of each bin: utilization bound

Ø Goal: minimize #bins subject to capacity constraints

q Ignore communication cost q Assume every subtask is periodic

Chenyang Lu 10

slide-11
SLIDE 11

Bin Packing: First-Fit

Ø Subtasks assigned in arbitrary order Ø To allocate a new subtask Ti,j

q if Ti,j can be added to an existing processor Sm (1£m£k) without

exceeding its capacity

  • allocate Ti,j à Sm

q else

  • add a new processor Sk+1 and allocate Ti,j à Sk+1.

Chenyang Lu 11

slide-12
SLIDE 12

First-Fit Performance

Ø #Processor needed: m/mmin à 1.7 as mmin à ∞

q m: #processor needed under First-Fit q m0: minimum #processor needed

Ø First-Fit can always find a feasible allocation on m processors if total subtask utilization ≤ m(21/2-1) = 0.414m

q Assuming identical processors

Chenyang Lu 12

slide-13
SLIDE 13

Minimize Communication Cost

Ø Inter-subtask communication introduces overhead & delay Ø Minimize communication subject to processor capacity constraints

q Partition subtasks into groups q Allocate groups to processors

Chenyang Lu 13

slide-14
SLIDE 14

End-to-End Scheduling

1. Task allocation 2. Synchronization protocol 3. Subdeadline assignment 4. Schedulability analysis

Chenyang Lu 14

slide-15
SLIDE 15

Synchronization Requirements

Ø Allow schedulability analysis Ø Bounded worst-case response time Ø Low overhead Ø Low jitter Ø Low average response time

Chenyang Lu 15

slide-16
SLIDE 16

Greedy Protocol

Ø Release job Ji,j;k as soon as Ji,j-1;k is completed Ø Subtasks may not be periodic under a greedy protocol

q Difficult to analyze schedulability q High-priority tasks arrive early à long worst-case response time for

low-priority tasks

q Jitter can accumulate over multiple hops

Chenyang Lu 16

slide-17
SLIDE 17

Greedy Protocol Example

Chenyang Lu 17

On P1 On P2 T1 T2,1 T2,2 T3 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12

Phase of T3

T3 misses deadline

P1 P2 (4,2) T1 (6,2) T2,1 (6,2) T2,2 (6,3) T3

slide-18
SLIDE 18

Critique of Greedy Protocol

Ø Low overhead Ø Low average response time Ø High jitter Ø Difficult to analyze schedulability Ø Long worst-case response time

Chenyang Lu 18

slide-19
SLIDE 19
  • Enforce periodic release based on the worst-case response

times of preceding subtasks.

  • Every job Ji,j;k is released at time

– Ri,l: worst case response time of Til

  • Require upper bounds on the response times of all subtasks.
  • Modified PMP (MPMP): Same as PMP and a subtask cannot be

released unless its predecessor has been completed.

Phase-Modification Protocol (PMP)

1 , 1

( 1)

j i i i l l

k P R f

  • =

+

Chenyang Lu 19

slide-20
SLIDE 20

MPMP Illustrated

Chenyang Lu 20

On P1 On P2 T1 T2,1 T2,2 T3 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12

Phase of T3

P1 P2 (4,2) T1 (6,2) T2,1 (6,2) T2,2 (6,3) T3

Synch signal delayed

slide-21
SLIDE 21

Properties of MPMP

Ø Enable schedulability analysis Ø Bounded worst-case response time Ø Low jitter Ø Does not require global clock synchronization

q Indicate “ahead time” in sync message

Ø Require worst-case response times of all subtasks Ø Long average response time

Chenyang Lu 21

slide-22
SLIDE 22

Release Guard

if CPU never idles since releasing Ji,j;k, release Ji,j;k+1 when

q it receives a sync message from Ji,j;k, or q at time ri,j;k-1+Pi

whichever is later // periodic release based on local knowledge

else, release Ji,j;k+1 when

q receiving a sync message from Ji,j;k, or q when processor becomes idle // improve response time

whichever is later

Improve average response time without affecting schedulability

Chenyang Lu 22

slide-23
SLIDE 23

Release Guard Illustrated

Chenyang Lu 23

On P1 On P2 T1 T2,1 T2,2 T3 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12

Phase of T3

P1 P2 (4,2) T1 (6,2) T2,1 (6,2) T2,2 (6,3) T3

g2,2 = 4+6=10 g2,2 = 9

Idle time detected

g2,2 = 0 g2,2 = 9+6=15

slide-24
SLIDE 24

Non-Assumptions

ü Do not require worst-case response times of all subtasks ü Do not require global clock synchronization ü Work best for loosely coupled system!

Chenyang Lu 24

slide-25
SLIDE 25

Properties of Release Guard

Ø Enable schedulability analysis Ø Bounded worst-case response time Ø Does not require global clock synchronization Ø Low jitter (if idle rule is not used) Ø Low average response time (if idle rule is used)

Chenyang Lu 25

slide-26
SLIDE 26

RG: Middleware Implementation

If current time is earlier than the release guard Tg Ø EC I/O thread buffers the event in the release guard queue; Ø At Tg, RG thread removes the buffered event from queue and inserts it into a dispatching lane

Chenyang Lu 26

EC I/O Thread Dispatching Thread RG Thread

  • Y. Zhang, B. Thrall, S. Torri, C. Gill, C.

Lu, A Real-Time Performance Comparison of Distributable Threads and Event Channels, RTAS'05.

slide-27
SLIDE 27

Score Board: Sync Protocols

Schedulability WCRT ART Global State Jitter Greedy Hard H L N H MPMP Y L H Y L RG Y L M/H N M/L

Chenyang Lu 27

  • if information about all tasks are available a priori
  • use RG or MPMP
  • else
  • use RG
slide-28
SLIDE 28

End-to-End Scheduling

1. Task allocation 2. Synchronization protocol 3. Subdeadline assignment 4. Schedulability analysis

Chenyang Lu 28

slide-29
SLIDE 29

Subdeadline Assignment

Ø Subdeadline à priority à response time Ø Optimal subdeadline assignment is NP-hard

q Offline: heuristic search q Online: simpler heuristics

Chenyang Lu 29

slide-30
SLIDE 30

Subdeadline Assignment

Ø Notations

q Relative deadline Di of task Ti q Relative subdeadline Dij of subtask Tij (1 £ j £ n(i))

Ø Ultimate Deadline (UD): Dij = Di

q But some subtasks must finish earlier than the end-to-end deadline!

Chenyang Lu 30

slide-31
SLIDE 31
  • Proportional Deadline (PD):

– Assign slack proportionally to execution time

  • Normalized Proportional Deadline

– Assign more slack to subtasks on busier processors

More Heuristics

( ) 1 ij ij i n i ik k

C D D C

=

=

å

Chenyang Lu 31

, ( ) , 1

( ) ( ( ))

ij i j ij i n i ik i k k

C U V D D C U V

=

=

å

slide-32
SLIDE 32

End-to-End Scheduling

1. Task allocation 2. Synchronization protocol 3. Subdeadline assignment 4. Schedulability analysis

Chenyang Lu 32