Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,

Slides:



Advertisements
Similar presentations
Fakultät für informatik informatik 12 technische universität dortmund Resource Access Protocols Peter Marwedel Informatik 12 TU Dortmund Germany 2008/12/06.
Advertisements

Fakultät für informatik informatik 12 technische universität dortmund Optimizations - Compilation for Embedded Processors - Peter Marwedel TU Dortmund.
Technische universität dortmund fakultät für informatik informatik 12 Specifications and Modeling Peter Marwedel TU Dortmund, Informatik 12 Graphics: ©
fakultät für informatik informatik 12 technische universität dortmund Additional compiler optimizations Peter Marwedel TU Dortmund Informatik 12 Germany.
Fakultät für informatik informatik 12 technische universität dortmund Petri Nets Peter Marwedel TU Dortmund, Informatik 12 Graphics: © Alexandra Nolte,
Evaluation and Validation
Fakultät für informatik informatik 12 technische universität dortmund Specifications and Modeling Peter Marwedel TU Dortmund, Informatik 12 Graphics: ©
Fakultät für informatik informatik 12 technische universität dortmund Standard Optimization Techniques Peter Marwedel Informatik 12 TU Dortmund Germany.
Technische universität dortmund fakultät für informatik informatik 12 Specifications and Modeling Peter Marwedel TU Dortmund, Informatik
Technische Universität München + Hewlett Packard Laboratories Dynamic Workload Management for Very Large Data Warehouses Juggling Feathers and Bowling.
Multiprocessor Scheduling
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
fakultät für informatik informatik 12 technische universität dortmund Optimizations - Compilation for Embedded Processors - Peter Marwedel TU Dortmund.
Technische universität dortmund fakultät für informatik informatik 12 Embedded System Design: Embedded Systems Foundations of Cyber-Physical Systems Peter.
1 Outline relationship among topics secrets LP with upper bounds by Simplex method basic feasible solution (BFS) by Simplex method for bounded variables.
Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
Real Time Scheduling.
EE5900 Advanced Embedded System For Smart Infrastructure
Pinwheel Scheduling for Power-Aware Real-Time Systems Gaurav Chitroda Komal Kasat Nalini Kumar.
Outline Introduction Assumptions and notations
Priority INHERITANCE PROTOCOLS
1 Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
1 Modeling and Simulation: Exploring Dynamic System Behaviour Chapter9 Optimization.
© 2004, D. J. Foreman 1 Scheduling & Dispatching.
25 seconds left…...
Fakultät für informatik informatik 12 technische universität dortmund Lab 3: Scheduling Solution - Session 10 - Heiko Falk TU Dortmund Informatik 12 Germany.
We will resume in: 25 Minutes.
Mani Srivastava UCLA - EE Department Room: 6731-H Boelter Hall Tel: WWW: Copyright 2003.
How Cells Obtain Energy from Food
Petri Nets Jian-Jia Chen (slides are based on Peter Marwedel)
Technische universität dortmund fakultät für informatik informatik 12 Specifications, Modeling, and Model of Computation Jian-Jia Chen (slides are based.
Overload Scheduling in Real-Time Systems
Hardware/ Software Partitioning 2011 年 12 月 09 日 Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: © Alexandra Nolte, Gesine Marwedel, 2003 These.
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
Fakultät für informatik informatik 12 technische universität dortmund Lab 3: Scheduling - Session 10 - Peter Marwedel Heiko Falk TU Dortmund Informatik.
Mapping of Applications to Platforms Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: © Alexandra Nolte, Gesine Marwedel, 2003 These slides.
Module 2 Priority Driven Scheduling of Periodic Task
Mapping of Applications to Platforms Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: © Alexandra Nolte, Gesine Marwedel, 2003 These slides.
Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,
Scheduling Algorithms for Multiprogramming in a Hard-Real-Time Environment Presented by Pete Perlegos C.L. Liu and James W. Layland.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
Misconceptions About Real-time Computing : A Serious Problem for Next-generation Systems J. A. Stankovic, Misconceptions about Real-Time Computing: A Serious.
Chapter 4 – Periodic Task Scheduling In many real-time systems periodic tasks dominate the demand. Three classic periodic task scheduling algorithms: –
Technische Universität Dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2007/12/14.
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Scheduling policies for real- time embedded systems.
Multiprocessor Real-time Scheduling Jing Ma 马靖. Classification Partitioned Scheduling In the partitioned approach, the tasks are statically partitioned.
Evaluation and Validation Peter Marwedel TU Dortmund, Informatik 12 Germany 2013 年 12 月 02 日 These slides use Microsoft clip arts. Microsoft copyright.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Real-Time Scheduling CS 3204 – Operating Systems Lecture 20 3/3/2006 Shahrooz Feizabadi.
CS244-Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010.
6. Application mapping 6.1 Problem definition
- 1 -  P. Marwedel, Univ. Dortmund, Informatik 12, 2006 Universität Dortmund Periodic scheduling For periodic scheduling, the best that we can do is to.
CS244-Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010.
Mapping: Applications  Processors
CSE 522 Real-Time Scheduling (2)
Real Time Operating Systems Schedulability - Part 2 Course originally developed by Maj Ron Smith 12/20/2015Dr Alain Beaulieu1.
Real-Time Scheduling CS 3204 – Operating Systems Lecture 13 10/3/2006 Shahrooz Feizabadi.
1 Real-Time Scheduling. 2Today Operating System task scheduling –Traditional (non-real-time) scheduling –Real-time scheduling.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2012 年 12 月 19 日 These slides use Microsoft clip.
Mok & friends. Resource partition for real- time systems (RTAS 2001)
Undergraduate course on Real-time Systems Linköping University TDDD07 Real-time Systems Lecture 2: Scheduling II Simin Nadjm-Tehrani Real-time Systems.
Lecture 6: Real-Time Scheduling
Embedded System Scheduling
Standard Optimization Techniques
Processes and operating systems
Ch 4. Periodic Task Scheduling
Presentation transcript:

fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany Graphics: © Alexandra Nolte, Gesine Marwedel, 2003 These slides use Microsoft clip arts. Microsoft copyright restrictions apply

- 2 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Structure of this course 2: Specification 3: ES-hardware 4: system software (RTOS, middleware, …) 8: Test 5: Evaluation & validation & (energy, cost, performance, …) 7: Optimization 6: Application mapping Application Knowledge Design repository Design Numbers denote sequence of chapters

- 3 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Classes of mapping algorithms considered in this course Classical scheduling algorithms Mostly for independent tasks & ignoring communication, mostly for mono- and homogeneous multiprocessors Dependent tasks as considered in architectural synthesis Initially designed in different context, but applicable Hardware/software partitioning Dependent tasks, heterogeneous systems, focus on resource assignment Design space exploration using evolutionary algorithms; Heterogeneous systems, incl. communication modeling

- 4 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Periodic scheduling Each execution instance of a task is called a job. Notion of optimality for aperiodic scheduling does not make sense for periodic scheduling. For periodic scheduling, the best that we can do is to design an algorithm which will always find a schedule if one exists. A scheduler is defined to be optimal iff it will find a schedule if one exists. T1T1 T2T2

- 5 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Periodic scheduling - Scheduling with no precedence constraints - Let { T i } be a set of tasks. Let: p i be the period of task T i, c i be the execution time of T i, d i be the deadline interval, that is, the time between T i becoming available and the time until which T i has to finish execution. l i be the laxity or slack, defined as l i = d i - c i f i be the finishing time. lili didi cici t i pipi

- 6 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Average utilization, a very important characterization of scheduling problems: Average utilization: Necessary condition for schedulability (with m =number of processors):

- 7 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Independent tasks: Rate monotonic (RM) scheduling Most well-known technique for scheduling independent periodic tasks [Liu, 1973]. Assumptions: All tasks that have hard deadlines are periodic. All tasks are independent. d i = p i, for all tasks. c i is constant and is known for all tasks. The time required for context switching is negligible. For a single processor and for n tasks, the following equation holds for the average utilization µ :

- 8 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Rate monotonic (RM) scheduling - The policy - RM policy: The priority of a task is a monotonically decreasing function of its period. At any time, a highest priority task among all those that are ready for execution is allocated. Theorem: If all RM assumptions are met, schedulability is guaranteed.

- 9 - technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Maximum utilization for guaranteed schedulability Maximum utilization as a function of the number of tasks:

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Example of RM-generated schedule T 1 preempts T 2 and T 3. T 2 and T 3 do not preempt each other. t

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Failing RMS Task 1: period 5, execution time 3 Task 2: period 8, execution time 3 µ =3/5+3/8=24/40+15/40=39/ (2 1/2 -1) 0.828

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Case of failing RM scheduling Task 1: period 5, execution time 2 Task 2: period 7, execution time 4 µ=2/5+4/7=34/ (2 1/2 -1) Missed deadline Missing computations scheduled in the next period leviRTS animation t

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Intuitively: Why does RM fail ? No problem if p 2 = m p 1, m : T1T1 T2T2 t fits T1T1 T2T2 t should be completed Switching to T 1 too early, despite early deadline for T 2 t t

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Critical instants Definition: A critical instant of a task is the time at which the release of a task will produce the largest response time. Lemma: For any task, the critical instant occurs if that task is simultaneously released with all higher priority tasks. Proof: Let T ={ T 1, …, T n }: periodic tasks with i: p i p i +1. Source: G. Buttazzo, Hard Real-time Computing Systems, Kluwer, 2002

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Critical instances (1) Response time of T n is delayed by tasks T i of higher priority: c n +2c i TnTn TiTi t Maximum delay achieved if T n and T i start simultaneously. c n +3c i TnTn TiTi Delay may increase if T i starts earlier t

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Critical instants (2) Repeating the argument for all i = 1, … n -1: The worst case response time of a task occurs when it is released simultaneously with all higher-priority tasks. q.e.d. Schedulability is checked at the critical instants. If all tasks of a task set are schedulable at their critical instants, they are schedulable at all release times. Observation helps designing examples

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 The case i: p i+ 1 = m i p i Lemma*: If each task period is a multiple of the period of the next higher priority task, then schedulability is also guaranteed if µ 1. Proof: Assume schedule of T i is given. Incorporate T i+1 : T i+1 fills idle times of T i ; T i+1 completes in time, if µ 1. TiTi T i+1 t T i+1 Used as the higher priority task at the next iteration. * wrong in the book of 2003

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Proof of the RM theorem Let T ={ T 1, T 2 } with p 1 < p 2. Assume RM is not used prio( T 2 ) is highest: T1T1 T2T2 t Schedule is feasible if c 1 +c 2 p 1 (1) c1c1 c2c2 p1p1 Define F = p 2 / p 1 : # of periods of T 1 fully contained in T 2 More in-depth:

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Case 1: c 1 p 2 – Fp 1 Assume RM is used prio( T 1 ) is highest: T1T1 T2T2 t Case 1*: c 1 p 2 – F p 1 (c 1 small enough to be finished before 2nd instance of T 2 ) p2p2 Fp 1 Schedulable if ( F +1) c 1 + c 2 p 2 (2) * Typos in [Buttazzo 2002]: < and mixed up]

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Proof of the RM theorem (3) Not RM: schedule is feasible if c 1 + c 2 p 1 (1) RM: schedulable if ( F +1) c 1 + c 2 p 2 (2) From (1): Fc 1 + Fc 2 Fp 1 Since F 1: Fc 1 + c 2 Fc 1 + Fc 2 Fp 1 Adding c 1 : ( F +1) c 1 + c 2 Fp 1 + c 1 Since c 1 p 2 – Fp 1 : ( F +1) c 1 + c 2 Fp 1 + c 1 p 2 Hence: if (1) holds, (2) holds as well For case 1: Given tasks T 1 and T 2 with p 1 < p 2, then if the schedule is feasible by an arbitrary (but fixed) priority assignment, it is also feasible by RM.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Case 2: c 1 > p 2 – Fp 1 Case 2: c 1 > p 2 – Fp 1 ( c 1 large enough not to finish before 2 nd instance of T 2 ) T1T1 T2T2 t p2p2 Fp 1 Schedulable if F c 1 + c 2 F p 1 (3) c 1 +c 2 p 1 (1) Multiplying (1) by F yields F c 1 + F c 2 F p 1 Since F 1: F c 1 + c 2 F c 1 + Fc 2 F p 1 Same statement as for case 1.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Calculation of the least upper utilization bound Let T ={ T 1, T 2 } with p 1 < p 2. Proof procedure: compute least upper bound U lup as follows Assign priorities according to RM Compute upper bound U up by setting computation times to fully utilize processor Minimize upper bound with respect to other task parameters As before: F = p 2 /p 1 c 2 adjusted to fully utilize processor.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Case 1: c 1 p 2 – Fp 1 Largest possible value of c 2 is c 2 = p 2 – c 1 (F+1) Corresponding upper bound is T1T1 T2T2 t p2p2 Fp 1 { } is <0 U ub monotonically decreasing in c 1 Minimum occurs for c 1 = p 2 – Fp 1

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Case 2: c 1 p 2 – Fp 1 Largest possible value of c 2 is c 2 = (p 1 -c 1 )F Corresponding upper bound is: T1T1 T2T2 t p2p2 Fp 1 { } is 0 U ub monotonically increasing in c 1 (independent of c 1 if {}=0) Minimum occurs for c 1 = p 2 – Fp 1, as before.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Utilization as a function of G=p 2 /p 1 -F For minimum value of c 1 : Since 0 G < 1: G(1-G) 0 U ub increasing in F Minimum of U ub for min( F ): F =1

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Proving the RM theorem for n =2 This proves the RM theorem for the special case of n =2 end

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Properties of RM scheduling RM scheduling is based on static priorities. This allows RM scheduling to be used in an OS with static priorities, such as Windows NT. No idle capacity is needed if i : p i+1 =F p i : i.e. if the period of each task is a multiple of the period of the next higher priority task, schedulability is then also guaranteed if µ 1. A huge number of variations of RM scheduling exists. In the context of RM scheduling, many formal proofs exist.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 EDF EDF can also be applied to periodic scheduling. EDF optimal for every hyper-period (= least common multiple of all periods) Optimal for periodic scheduling EDF must be able to schedule the example in which RMS failed.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Comparison EDF/RMS T 2 not preempted, due to its earlier deadline. EDF-animation RMS: EDF:

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 EDF: Properties EDF requires dynamic priorities EDF cannot be used with an operating system just providing static priorities. However, a recent paper (by Margull and Slomka) at DATE 2008 demonstrates how an OS with static priorities can be extended with a plug-in providing EDF scheduling (key idea: delay tasks becoming ready if they shouldnt be executed under EDF scheduling.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Comparison RMS/EDF RMSEDF Priorities StaticDynamic Works with OS with fixed priorities YesNo* Uses full computational power of processor No, just up till µ = n (2 1/ n -1) Yes Possible to exploit full computational power of processor without provisioning for slack NoYes * Unless the plug-in by Slomka et al. is added.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Sporadic tasks If sporadic tasks were connected to interrupts, the execution time of other tasks would become very unpredictable. Introduction of a sporadic task server, periodically checking for ready sporadic tasks; Sporadic tasks are essentially turned into periodic tasks.

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Dependent tasks The problem of deciding whether or not a schedule exists for a set of dependent tasks and a given deadline is NP-complete in general [Garey/Johnson]. Strategies: 1.Add resources, so that scheduling becomes easier 2.Split problem into static and dynamic part so that only a minimum of decisions need to be taken at run-time. 3.Use scheduling algorithms from high-level synthesis

technische universität dortmund fakultät für informatik p. marwedel, informatik 12, 2010 Summary Periodic scheduling Rate monotonic scheduling EDF Dependent and sporadic tasks (briefly)