Clock Driven Scheduling By Dr. Amin Danial Asham.

Slides:



Advertisements
Similar presentations
REAL TIME SYSTEM Scheduling.
Advertisements

Clock-driven Static scheduling 5/24/2013Amrita-UB-MSES
1 EE5900 Advanced Embedded System For Smart Infrastructure RMS and EDF Scheduling.
ECE 493T9 Real Time Embedded System Tutorial Set 5 July 14, Spring 2008.
CSE 522 Real-Time Scheduling (4)
Memory Management Chapter 7.
RUN: Optimal Multiprocessor Real-Time Scheduling via Reduction to Uniprocessor Paul Regnier † George Lima † Ernesto Massa † Greg Levin ‡ Scott Brandt ‡
Module 2 Priority Driven Scheduling of Periodic Task
Memory Management Chapter 7. Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as.
Scheduling in Batch Systems
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management Chapter 5.
Enhancing the Platform Independence of the Real-Time Specification for Java Andy Wellings, Yang Chang and Tom Richardson University of York.
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
1 Lecture 8: Memory Mangement Operating System I Spring 2008.
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
Module 2 Clock-Driven Scheduling
Memory Management Chapter 7.
Task Scheduling By Dr. Amin Danial Asham.
Real Time Operating Systems Scheduling & Schedulers Course originally developed by Maj Ron Smith 8-Oct-15 Dr. Alain Beaulieu Scheduling & Schedulers- 7.
Scheduling policies for real- time embedded systems.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Subject: Operating System.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
Undergraduate course on Real-time Systems Linköping 1 of 45 Autumn 2009 TDDC47: Real-time and Concurrent Programming Lecture 5: Real-time Scheduling (I)
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
SE-3910 Real-time Systems Week 5, Class 2 – Lab turn-in page is up! – Use interrupts in a Linux/C environment – Scheduling – Watchdog follow-up Watchdog.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
Real Time Operating Systems Schedulability - Part 2 Course originally developed by Maj Ron Smith 12/20/2015Dr Alain Beaulieu1.
Real-Time systems By Dr. Amin Danial Asham.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 5 CPU Scheduling Slide 1 Chapter 5 CPU Scheduling.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
Dynamic Priority Driven Scheduling of Periodic Task
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Energy-aware QoS packet scheduling.
Clock Driven Scheduling
Clock Driven Schedulers
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecture 6: Real-Time Scheduling
Clock-Driven Scheduling (in-depth) Task Scheduler: i := 0; k := 0; BEGIN LOOP i := i+1; k:= i mod N; IF J(t k-1 )is empty THEN wakeup(aperiodic) ELSE wakeup(J(t.
Memory Management Chapter 7.
Memory Management.
Clock Driven Scheduling
Structured Cyclic Schedule
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
Clock-driven Static scheduling
Clock-driven Static scheduling
Clock-driven Static scheduling
3: CPU Scheduling Basic Concepts Scheduling Criteria
Chapter5: CPU Scheduling
CSCI1600: Embedded and Real Time Software
Chapter 6: CPU Scheduling
Clock-driven Static scheduling
Scheduling Basic Concepts Ref: Hard Real-Time Computing Systems Giorgio Buttazzo Ref: Real-Time Systems & Software Alan Shaw Processes - Tasks.
CSCI1600: Embedded and Real Time Software
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Module 5: CPU Scheduling
Module 5: CPU Scheduling
Presentation transcript:

Clock Driven Scheduling By Dr. Amin Danial Asham

References Real-time Systems Theory and Practice. By Rajib mall

Example1: A cyclic scheduler is to be used to run the following set of periodic tasks on a uniprocessor: T 1 = (e 1 =1,P 1 =4), T2 = (e 2 =1,P 2 =5), T 3 = (e 3 =1,P 3 =20), T 4 = (e 4 =2,P 4 =20). Select an appropriate frame size. Solution:  For the given task set, an appropriate frame size is the one that satisfies all the three required constraints. 1.The Major Cyle M = LCM(4,5,20) =20. 2.Constraint 1. Frames must be sufficiently long so that every job can start and complete within a single frame:, then maxi {ei} ≤ F. Therefore, we get F ≥ 2 3.Constraint 2. The major cycle must have an integer number of frames. Therefore, the possible values of F are 2, 4, 5, 10, 20.

PiPi F Table of GCD of all possible frame sizes and task periods True False 5TrueFalseTrueFalse 20True 20True didi F Table of the 3 rd constraint 2F - GCD(F,P i ) ≤ d i Suitable Frame Size 4.Constraint 3. To satisfy this constraint, we need to check whether a selected frame size F satisfies the inequality: 2F - GCD(F,P i ) ≤ d i for each P i.

Example1 (cont.): T1T2T3T4T1T2T3T4 T1T1 T1T1 T1T1 T1T1 T2T2 T2T2 T2T2 T1T1 T1T1 T1T1 T1T1 T1T1 T1T2T3T4T1T2T3T4 T3T3 T4T4 T2T2 T2T2 T2T2 T2T T1T2T3T4T1T2T3T4 T1T1 T1T1 T1T1 T1T1 T2T2 T2T2 T2T2 T1T1 T1T1 T1T1 T1T1 T1T1 T1T2T3T4T1T2T3T4 T3T3 T4T4 T2T2 T2T2 T2T2 T2T2 T4T4 T3T3

Example 2 Consider the following set of periodic real-Time tasks to be scheduled by a cyclic scheduler: T 1 (e 1 =1, P 1 =4), T 2 = (e 2 =2,P 2 =5), T 3 = (e 3 =5,P 3 =20). Determine a suitable frame size for the task set. Solution: 1.Major cycle M = LCM (4, 5, 20) = 20 2.Constraint 1: F ≥ 5. 3.Constraint 2: the possible values of F are 5, 10 and Constraint 3: PiPi F False 5TrueFalse 20True didi F Table of GCD of all possible frame sizes and task periods Table of the 3 rd constraint 2F - GCD(F,P i ) ≤ d i No Suitable Frame size

Example 2 (cont.) It is easy to observe that the task T 3 has the largest execution Time and consequently due to the constraint 1 makes the feasible frame sizes quite large. We try splitting T 3 into two or three tasks. After splitting T 3 into three tasks, we have: T 3.1 = (20, 1, 20), T 3.2 = (20, 2, 20), T 3.3 = (20, 2, 20). 1.Constraint 1: F ≥ 2. 2.Constraint 2: the possible values of F are 2,4,5, 10 and Constraint 3: True False 5TrueFalseTrueFalse 20True 20True 20True Table of GCD of all possible frame sizes and task periods Table of the 3 rd constraint 2F - GCD(F,P i ) ≤ d i PiPi F Suitable Frame size didi F

Note It is very difficult to come up with a clear set of guidelines to identify the exact task that is to be split, and the parts into which it needs to be split. This therefore needs to be done by trial and error. Further, as the number of tasks to be scheduled increases, this method of trial and error becomes impractical since each task needs to be checked separately. However, when the task set consists of only a few tasks we can easily apply this technique to find a feasible frame size for a set of tasks otherwise un-schedulable by a cyclic scheduler.

Example 3: T 1 = (e 1 =1,p 1 =4); T 2 = (e 2 =1.8,p 2 =5); T 3 = (e 3 =1,p 3 =20); T 4 = (e 4 =2,p 4 =20). Solution: 1.M=LCM(4,5,20,20)=20 2.U=1/4+1.8/5+1/20+2/20= F≥2 4.Possible frame sizes 2,4,5,10,20 5.2f – GCD(p i,f) ≤ d i 1 ≤ i ≤ 4 i.F=2 T 1 : 4 – 2 ≤ 4 (OK) T 2 : 4 – 1 ≤ 5 (OK) T 3 and T4: 4 – 2 ≤ 20 (OK) ii.F=4 T1 : 8 – 4 ≤ 4 (OK) T2 : 8 – 1 ≤ 5 (NO) iii.F=5 : T 1 : 10 – 1 ≤ 4 (NO) iv.F=10: T 1 : 20 – 2 ≤ 4 (NO) v.F=20: T 1 : 40 – 4 ≤ 4 (NO) Suitable size

T1T2T3T4T1T2T3T4 T1T1 T1T1 T1T1 T1T1 T2T2 T2T2 T2T2 T1T1 T2T2 T1T1 T2T2 T1T1 T1T1 T1T1 T2T2 T2T2 T1T2T3T4T1T2T3T4 T3T3 T4T4 Example 3 (cont.) T1T2T3T4T1T2T3T4 T1T1 T1T1 T1T1 T1T1 T2T2 T2T2 T2T2 T1T1 T2T2 T1T1 T2T2 T1T1 T1T1 T1T1 T2T2 T2T2 T1T2T3T4T1T2T3T4 T3T3 T4T4

Example 4: T 1 = (p 1 =15,e 1 =1,d 1 =14); T 2 = (p 2 =20,e 2 =2,d 2 =26); T 3 = (e 3 =3, p 3 =22). Solution: 1.M=LCM(15,20,22)=660 2.U=1/15+2/20+3/22= F≥3 Possible frame sizes 3,4,5,10,11,15,20,22 (Note: f divides the Major Cycle M; this is true if f divides at least one p i ) 1.2f – GCD(P i,f) ≤ d i 1 ≤ i ≤ 3 i.F=3 T 1 : 6 – 3 ≤ 14 (OK) T 2 : 6 – 1 ≤ 26 (OK) T 3 : 6 – 1 ≤ 22 (OK) ii.F=4 T 1 : 8 – 1 ≤ 14 (OK) T 2 : 8 – 4 ≤ 26 (OK) T 3 : 8 – 2 ≤ 22 (OK) iv.F = 10: T1: 20 – 5 ≤ 14 (NO) v.F= 11: T1: 22 – 1 ≤ 14 (NO) vi.F= 15: T1: 30 –15 ≤ 14 (NO) vii.F= 20: T1: 40 – 5 ≤ 14 (NO) viii.F= 22: T1: 44 – 1 ≤ 14 (NO) Suitable sizes 3,4,and 5 iii.F=5 T 1 : 10 – 5 ≤ 14 (OK) T 2 : 10 – 5 ≤ 26 (OK) T 3 : 10 – 1 ≤ 22 (OK)

Design steps and decisions to consider in the process of constructing a cyclic schedule 1.Determine the Major Cycle M 2.Determine the total utilization U (if >1 schedule is unfeasible) 3.Choose a frame size that meets the constraints 4.Partition jobs into slices, if necessary 5.Place slices in the frames.

A Generalized Task Scheduler Many practical applications typically consist of a mixture of several periodic, aperiodic, and sporadic tasks. Aperiodic and sporadic tasks can be accommodated by cyclic schedulers. In generalized scheduler: In a generalized scheduler, initially a schedule (assignment of tasks to frames) for only periodic tasks is prepared. The sporadic and aperiodic tasks are scheduled in the slack times that may be available in the frames. Slack time in a frame is the time left in the frame after a periodic task allocated to the frame completes its execution. Non-zero slack time in a frame can exist only when the execution time of the task allocated to it is smaller than the frame size.

Notes: A sporadic task is taken up for scheduling only if enough slack time is available for the arriving sporadic task to complete before its deadline. Therefore, a sporadic task on its arrival is subjected to an acceptance test. The acceptance test checks whether the task is likely to be completed within its deadline when executed in the available slack times. If it is not possible to meet the task’s deadline, then the scheduler rejects it and the corresponding recovery routines for the task are run. For aperiodic tasks no acceptance test is done, but no guarantee is given for a task’s completion time and best effort is made to complete the task as early as possible. An efficient implementation of this scheme is that the slack times are stored in a table and during acceptance test this table is used to check the schedulability of the arriving tasks. Another popular alternative is that the aperiodic and sporadic tasks are accepted without any acceptance test, and best effort is made to meet their respective deadlines.

Comparison of Cyclic with Table-Driven Scheduling Both table-driven and cyclic schedulers are important clock-driven schedulers. Cyclic scheduling: needs to set a periodic timer only once at the application initialization time. This timer continues to give an interrupt exactly at every frame boundary. No overhead of setting the timer each time a task starts.

Comparison of Cyclic with Table-Driven Scheduling (cont.) –Table-driven scheduling: a timer has to be set every time a task starts to run. The execution time of a typical real-time task is usually of the order of a few milliseconds. Therefore, a call to a timer is made every few mill Seconds. This represents a significant overhead and results in degraded system performance. However, if the overhead of setting a timer can be ignored, a table-driven scheduler is more proficient than a cyclic scheduler because the size of the frame that needs to be chosen should be at least as long as the size of the largest execution time of a task in the task set. This is a source of inefficiency, since this results in processor time being wasted in case of those tasks whose execution times are smaller than the chosen frame size.

Thanks