Presentation is loading. Please wait.

Presentation is loading. Please wait.

Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.

Similar presentations


Presentation on theme: "Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens."— Presentation transcript:

1 courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens Plads, Building 321 DK2800 Lyngby, Denmark Jan@imm.dtu.dk

2 SoC-MOBINET courseware(c) Jan Madsen2 Multi-processor scheduling 1 3 4 2 a mem b b os 3 4 mem a os 2 1 scheduling

3 SoC-MOBINET courseware(c) Jan Madsen3 Scheduling of distributed real-time systems  Much more complicated  Has to handle a large number of characteristics, constraints and requirements

4 SoC-MOBINET courseware(c) Jan Madsen4 Characteristics to be handled  Processes:  preemptive and non-preemptive  periodic and aperidoic  processes with multiple levels of importance  group of processes with single deadline  Constraints and requirements:  end-to-end timing  precedence relations  communication  shared resources  placement  hard and soft deadlines  fault tolerance

5 SoC-MOBINET courseware(c) Jan Madsen5 Handling interfaces between  CPU scheduling and resource allocation  IO scheduling and CPU scheduling  CPU scheduling and communication scheduling  Local and distributed scheduling  Static scheduling of critical processes and dynamic scheduling of other processes Comprehensive results will not exist for many years!

6 SoC-MOBINET courseware(c) Jan Madsen6 Phases of real-time distributed systems scheduling  Allocation  assigning processes and resources to processors in the system  Scheduling  Ordering the execution of processes and communications to meet timing and resource constraints  Dispatching  Executing the processes in conformance with the scheduler’s decisions

7 SoC-MOBINET courseware(c) Jan Madsen7 Approaches to embedded system scheduling  deterministic (static) scheduling  Allocating and static scheduling all periodic processes off-line  Allocate time-slots for handling non-periodic processes  Distributed scheduling  Each CPU runs its own scheduler  Set of processes is distributed, statically allocated but dynamically activated

8 SoC-MOBINET courseware(c) Jan Madsen8 Static distributed scheduling  Typical approach –Construct a comprehensive graph containing all process instances that executes in an interval of length T (T is the least common multiple of all process periods) –Cluster communicating processes –Allocate clusters of processes to PEs and schedule processes and communications

9 SoC-MOBINET courseware(c) Jan Madsen9 ArchitectureSpecification CharacterizationScheduling A Simple Example t1 t3t2 PE1 PE2 bus t1 t2 t3 PE1PE2PE1 PE2

10 SoC-MOBINET courseware(c) Jan Madsen10 First solution t1 t3t2 PE1 PE2 bus ArchitectureSpecification CharacterizationScheduling t1 t2 t3 PE1PE2PE1 PE2 15 1020 5- t1t2 t3 20

11 SoC-MOBINET courseware(c) Jan Madsen11 Introducing communication t1 t3t2 PE1 PE2 bus ArchitectureSpecification CharacterizationScheduling t1 t2 t3 PE1PE2PE1 PE2 15 1020 5- 5010 t1 t2 t3 25 bus Can transfer 2 data units per time unit 5

12 SoC-MOBINET courseware(c) Jan Madsen12 Introducing interfaces t1 t3t2 PE1 PE2 bus ArchitectureSpecification CharacterizationScheduling t1 t2 t3 PE1PE2PE1 PE2 15 1020 5- 5010 i1i2 t1t2 t3 27 bus i1 i2 Can buffer 10 data units per time unit

13 SoC-MOBINET courseware(c) Jan Madsen13 PE Memory? t1 Memory contributions: program data data to be transferred Memory utilization: time Memory size PE t1

14 SoC-MOBINET courseware(c) Jan Madsen14 Introducing memory t1 t3t2 PE1 PE2 bus ArchitectureSpecification CharacterizationScheduling t1 t2 t3 PE1PE2PE1 15 5,515 10,5 10 5,520 10,5 5 10,2- 5010 i1i2 t1t2 Peak memory 10 5 2 50 10 = 77

15 SoC-MOBINET courseware(c) Jan Madsen15 Dynamic multi-processor scheduling  Primary objective is to ensure that all timing constraints are met  Serious difficulties in validating hard timing constraints  Assumptions:  Each processor has its own scheduler  The scheduler uses a uni-processor scheduling algorithm  Schedulers on different processors need not use the same algorithm

16 SoC-MOBINET courseware(c) Jan Madsen16 Multi-processor scheduling  Task assignment  Most real-time systems are static, tasks are partitioned and statically bound to processors  Inter-processor synchronization  Ensuring that precedence constraints of tasks on different processors are always satisfied

17 SoC-MOBINET courseware(c) Jan Madsen17 Task assignment  Often done off-line  NP-hard problem  Assignment based on:  Execution times  Resource requirements  Data dependencies  Timing constraints  Communication cost ... b os a 3 4 2 1

18 SoC-MOBINET courseware(c) Jan Madsen18 Task assignment - RMFF 1 3 4 2 Assume zero communication overhead Scheduling based on fixed priorities A synchronization signal makes sure that is released as soon as has completed 32  Example: 1 a i k i k  Rate-Monotonic First-Fit algorithm: 1.Sort tasks in increasing order according to their period 2.Assign tasks one by one  is assigned to  is assigned to if the total utilization of and the tasks already assigned to < U RM

19 SoC-MOBINET courseware(c) Jan Madsen19 Example 1 3 4 2 riri TiTi eiei 042 062+2 463 1 2 4 3 b os 4 a 1 2 3

20 SoC-MOBINET courseware(c) Jan Madsen20 Dynamic scheduling b os 4 a 1 2 3 0468102141612 1 2 a 0468102141612 3 4 b RM

21 SoC-MOBINET courseware(c) Jan Madsen21 Changing synchronization protocol 0468102 0468 2 141612 141612 b os 4 a 1 2 3 1 3 2 4 a b RMEDF

22 SoC-MOBINET courseware(c) Jan Madsen22 Multi-processing anomalies  Assume a set of tasks optimally scheduled on a multiprocessor system with:  fixed number of processors  fixed execution times (e i )  precedence constraints  Then  changing the priority list  increasing the number of processor  reducing execution times  weakening the precedence constraints  May increase the scheduling length!

23 SoC-MOBINET courseware(c) Jan Madsen23 Example of anomalies 1 3 2 45 1 3 2 45 Reduce e 1 of task 1 a b a b Task 2 and 4 are sharing a resource, i.e. mutually exclusion 13 42 5

24 SoC-MOBINET courseware(c) Jan Madsen24 Consequences of anomalies  Tasks may complete before their WCETs  So most on-line scheduling algorithms are subject to experience anomalies  Simple but inefficient solution:  Have tasks completing early idle

25 SoC-MOBINET courseware(c) Jan Madsen25 Summary  Introduction to classical uni-processor multi-task scheduling  illustration of multi-processor scheduling  Not covered:  Priority inversion when having shared resources  Context switching and cache overhead  Overload conditions  Low power scheduling,  Increasing idle periods on processors  Voltage scaling  Communication


Download ppt "Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens."

Similar presentations


Ads by Google