1 / 24

Scheduling of Distributed Real-Time Systems

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. 1. 3. 2. 1. 2. 4. 3. 4. os. os. scheduling. a. b. mem. a. b. mem.

Download Presentation

Scheduling of Distributed Real-Time Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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. 1 3 2 1 2 4 3 4 os os scheduling a b mem a b mem Multi-processor scheduling (c) Jan Madsen

  3. 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 (c) Jan Madsen

  4. 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 willnotexist for many years! (c) Jan Madsen

  5. 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 (c) Jan Madsen

  6. 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 (c) Jan Madsen

  7. 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 (c) Jan Madsen

  8. Specification Architecture PE1 PE2 t1 t2 t3 bus Characterization Scheduling PE1 PE2 PE1 t1 t2 t3 PE2 A Simple Example (c) Jan Madsen

  9. PE1 PE2 t1 t2 t3 bus 5 - 20 10 20 15 15 First solution Specification Architecture Characterization Scheduling PE1 PE2 PE1 t1 t2 t1 t2 t3 PE2 t3 (c) Jan Madsen

  10. t1 50 10 5 t2 t3 t2 5 - 10 20 25 15 15 t3 Introducing communication Specification Architecture Can transfer 2 data units per time unit PE1 PE2 bus Characterization Scheduling PE1 PE2 PE1 t1 t1 bus t2 t3 PE2 (c) Jan Madsen

  11. t1 50 10 i1 i2 t2 t3 5 - 10 20 27 15 15 Introducing interfaces Specification Architecture PE1 PE2 Can buffer 10 data units per time unit bus Characterization Scheduling PE1 PE2 PE1 t1 t2 i1 t1 bus t2 i2 t3 PE2 t3 (c) Jan Madsen

  12. PE PE t1 Memory size time Memory? Memory contributions: program t1 data data to be transferred Memory utilization: (c) Jan Madsen

  13. Peak memory 510,2 - 105,5 2010,5 155,5 1510,5 Introducing memory Specification Architecture PE1 PE2 t1 50 10 i1 i2 t2 t3 bus Characterization Scheduling PE1 PE2 PE1 t1 t2 10 = 77 t1 50 t2 2 t3 5 10 (c) Jan Madsen

  14. 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 (c) Jan Madsen

  15. 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 (c) Jan Madsen

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

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

  18. 4 2 2 1 2 3 1 1 4 3 3 4 os os a b Example (c) Jan Madsen

  19. 2 4 RM RM 1 1 3 a 2 0 2 4 6 8 10 12 14 16 3 b 4 0 2 4 6 8 10 12 14 16 Dynamic scheduling os os a b (c) Jan Madsen

  20. 2 4 3 1 Changing synchronization protocol RM EDF 1 a 2 os os a b 0 2 4 6 8 10 12 14 16 3 b 4 0 2 4 6 8 10 12 14 16 (c) Jan Madsen

  21. Multi-processing anomalies • Assume a set of tasks optimally scheduled on a multiprocessor system with: • fixed number of processors • fixed execution times (ei) • precedence constraints • Then • changingthe priority list • increasingthe number of processor • reducing execution times • weakening the precedence constraints • May increase the scheduling length! (c) Jan Madsen

  22. 2 1 2 1 3 5 4 3 4 5 1 2 a a b b 3 4 5 Example of anomalies Task 2 and 4 are sharing a resource, i.e. mutually exclusion Reduce e1 of task 1 (c) Jan Madsen

  23. 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 (c) Jan Madsen

  24. 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 (c) Jan Madsen

More Related