End-to-End Scheduling in Change periods in requirements. - - PDF document

end to end scheduling in
SMART_READER_LITE
LIVE PREVIEW

End-to-End Scheduling in Change periods in requirements. - - PDF document

What if a system is unschedulable? Reduce execution times of tasks. Reduce blocking factors. End-to-End Scheduling in Change periods in requirements. Distributed Real-Time Systems Get a faster CPU. Replace with software


slide-1
SLIDE 1

1

End-to-End Scheduling in Distributed Real-Time Systems

Chenyang Lu 2

What if a system is unschedulable?

  • Reduce execution times of tasks.
  • Reduce blocking factors.
  • Change periods in requirements.
  • Get a faster CPU.
  • Replace with software components with

hardware (ASIC, FPGA) components

  • Multi-processor and distributed systems.

Chenyang Lu 3

Multi-processor System

  • Tight coupling among processors
  • E.g., Dual-processor Sun workstations
  • Communicate through shared memory and on-

board buses

  • Scheduled by a common scheduler/OS
  • Global scheduling
  • Partitioned scheduling
  • States of all processors available to each other

Chenyang Lu 4

Distributed System

  • Loose coupling among processors
  • Each processor has its own scheduler
  • Costly to acquire states of other processors
  • Broad range of systems
  • Processor boards mounted on a VME bus
  • Automobile: hundreds of processors connected

through a Control Area Network (CAN)

  • Air traffic control system on a wide area network

Chenyang Lu 5

End-to-End Task Model

  • An (end-to-end) task is composed of multiple

subtasks running on multiple processors

  • Message
  • Event
  • Remote method invocation
  • Subtasks are subject to precedence constraints
  • Task = a chain/tree/graph of subtasks

Chenyang Lu 6

Notation

  • Ti = {Ti,1, Ti,2, … , Ti,n(i)}
  • n(i): the number of subtasks of Ti
  • Precedence constraint: Job Ji,j cannot be

released until Ji,j-1 is completed.

slide-2
SLIDE 2

Chenyang Lu 7

End-to-End Deadline

  • A task is subject to an end-to-end

deadline

  • Does not care about the response time of a

particular subtask

  • How to guarantee end-to-end deadlines
  • n a distributed system?

Chenyang Lu 8

End-to-End Scheduling Framework

1. Task allocation: bind tasks to processors 2. Synchronization protocol: enforce precedence constraints 3. Subdeadline assignment 4. Schedulability analysis

Chenyang Lu 9

Task Allocation

  • Load code (e.g., objects) to processors
  • Strategies
  • Offline, static allocation
  • Allocate a task when it arrives
  • Re-allocate (migrate) a task after it starts
  • NP-hard: heuristics needed

Chenyang Lu 10

Bin-Packing Formulation

  • Pack subtasks to bins (processors) with limited

capacity

  • Size of a subtask Ti,j: ui,j = Ci,j/Pi
  • Capacity of each bin is its utilization bound
  • e.g., 0.69 (RMS) or 1 (EDF) under certain assumptions
  • Goal: minimize the number of bins subject to the

capacity constraints

  • Ignore communication cost
  • Assume every subtask is periodic

Chenyang Lu 11

Bin-Packing Heuristics: First-Fit

  • Subtasks assigned in arbitrary order
  • To allocate a new subtask Ti,j
  • If Ti,j can be added to an existing processor Pl (1≤l≤k)

without exceeding its capacity, allocate Ti,j to Pk

  • Else add a new processor Pk+1 and allocate Ti,j to it.

Chenyang Lu 12

Performance Limit of First-Fit

  • Number of processors needed: m/m0 -> 1.7 as

m0 -> ∞

  • m: number of processors needed under First-Fit
  • m0: minimum number of processors needed
  • First-Fit can always find a feasible allocation on

m processors if total subtask utilization is no greater than m(21/2-1) = 0.414m

  • Assuming identical processors
slide-3
SLIDE 3

Chenyang Lu 13

Minimize Communication Cost

  • Inter-subtask communication can

introduce overhead and delay

  • RPC is slower than local invocations
  • Goal: minimize communication cost

subject to processor capacity constraints

  • Two steps
  • Partition subtasks into groups
  • Allocate groups to processors

Chenyang Lu 14

End-to-End Scheduling Framework

1. Task allocation: bind tasks to processors 2. Synchronization protocol: enforce precedence constraints 3. Subdeadline assignment 4. Schedulability analysis

Chenyang Lu 15

Sync Protocols: Requirements

  • Correct: Enforce precedence constraints
  • Allow schedulability analysis
  • Low worst-case response time
  • Low overhead
  • Reduce jitter
  • Low average response time

Chenyang Lu 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

  • Difficult for schedulability analysis
  • Higher-priority tasks arrive early high worst-case

response time for lower-priority tasks

  • Jitter can accumulate over multiple hops

Chenyang Lu 17

Critique on Greedy Protocol

  • Correct
  • Low overhead
  • Low average response time
  • High jitter
  • Difficult schedulability analysis
  • High worst-case response time

Chenyang Lu 18

Phase-Modification Protocol (PMP)

  • Idea: Enforce periodic release based on worst-case

response time

  • Every job Ji,j;k is released at time
  • wil: worst case response time of Til
  • Assumptions
  • Require upper bound on the response time of all subtasks
  • Require global clock

− =

+ − +

1 1 ,

) 1 (

j l l i i i

w P k φ

slide-4
SLIDE 4

Chenyang Lu 19

Critique on PMP

  • Incorrect if tasks have release jitter or overrun
  • Allow schedulability analysis
  • Low worst-case response time
  • Overhead
  • No explicit synchronization
  • Depend on global clock synchronization
  • Low jitter
  • High average response time

Chenyang Lu 20

Modified PMP

  • Same as PMP except
  • A subtask cannot be released unless its predecessor

has been completed

  • Require upper bound on the response times of

all subtasks

  • Require a sync message from predecessor

indicating its predecessor has been completed

  • Does not require global clock synchronization
  • Indicate “ahead time” in sync message

Chenyang Lu 21

Critique on MPMP

  • Correct
  • Allow accurate schedulability analysis
  • Low worst-case response time
  • Overhead
  • require explicit synchronization
  • Does not require global clock sync
  • Low jitter
  • High average response time

Chenyang Lu 22

Release Guard

if processor never idles since last release time ri,j;k

  • release Ji,j;k+1 either when it receives a sync

message from Ji,j;k or at time ri,j;k-1+Pi, whichever is later

else

  • release Ji,j;k+1 when receiving a sync message
  • r when processor becomes idles, whichever

is later.

  • Improve average response time without

affecting schedulability at the cost of jitter

Chenyang Lu 23

Non-Assumptions

  • Does not require upper bound on the response

time of all subtasks

  • Does not require global clock synchronization
  • Work best for loosely coupled system!

Chenyang Lu 24

Critique on Release Guard

  • Correct
  • Allow accurate schedulability analysis
  • Low worst-case response time
  • Overhead
  • require explicit synchronization
  • Does not require global clock synchronization
  • Low jitter (if rule 2 is not used)
  • Improved average response time (if rule 2 is

used)

slide-5
SLIDE 5

Chenyang Lu 25

Score Board: Sync Protocols

H/L L M/H L Y Y RG L H H L Y Y MPMP L H H L Y N PMP H L L H N Y Greedy Jitter Global Info. Avg RT WCRT Sched. Correct

  • Use MPMP or RG if
  • Information about all tasks are available a priori
  • System has global clock sync
  • Otherwise only RG can be used

Chenyang Lu 26

Subdeadline Assignment

  • Subdeadline priorities under EDF & DM

response times

  • Optimal subdeadline assignment is NP-hard
  • Offline: heuristic search algorithms
  • Online: simpler heuristics

Chenyang Lu 27

Subdeadline Assignment Heuristics

  • Notations
  • (Relative) deadline di of task Ti
  • (Relative) subdeadline dij of subtask Tij (1 ≤ j ≤ n(i))
  • Slack of subtask Tij: sij = Dij - Cij
  • Ultimate Deadline (UD): Dij = Di
  • But some subtasks must finish earlier than the end-to-end

deadline!

  • Effective Deadline (ED):
  • Assign all slack to 1st subtask

∑ ∑

+ = − =

− − =

) ( 1 1 1 i n j k ik j k ik i ij

e d d d

Chenyang Lu 28

More Heuristics

  • Proportional Deadline (PD):
  • Assign slack proportionally to execution time
  • Normalized Proportional Deadline
  • Assign more slack to subtasks on busier processors

∑ =

=

) ( 1 i n k ik ij i ij

C C D D

∑ =

=

) ( 1 , ,

)) ( ( ) (

i n k k i ik j i ij i ij

V u C V u C D D