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.

Slides:



Advertisements
Similar presentations
Washington WASHINGTON UNIVERSITY IN ST LOUIS Real-Time: Periodic Tasks Fred Kuhns Applied Research Laboratory Computer Science Washington University.
Advertisements

REAL TIME SYSTEM Scheduling.
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.
CPE555A: Real-Time Embedded Systems
Real Time Scheduling Terminologies define Fixed Priority Scheduler
CSE 522 Real-Time Scheduling (4)
Mehdi Kargahi School of ECE University of Tehran
CSE 522 Real-Time Scheduling (1) Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)
1 Swiss Federal Institute of Technology Computer Engineering and Networks Laboratory Embedded Systems Exercise 2: Scheduling Real-Time Aperiodic Tasks.
Tasks Periodic The period is the amount of time between each iteration of a regularly repeated task Time driven The task is automatically activated by.
Module 2 Priority Driven Scheduling of Periodic Task
Putting the Cyclic Executive into Practice T. P. BakerAlan Shaw, “The Cyclic Executive Model and Ada” Implementation approaches for a Cyclic Executive:
Project 2 – solution code
Integrated Control and Scheduling James Yang, Steve Sheng, Bill Li Instructor: Prof. Insup Lee.
Examples of real-time applications On-line transaction systems and interaction systems Real-time monitoring systems Signal processing systems –typical.
Aperiodic Task Scheduling
By Group: Ghassan Abdo Rayyashi Anas to’meh Supervised by Dr. Lo’ai Tawalbeh.
Real-Time Operating System Chapter – 8 Embedded System: An integrated approach.
 Scheduling  Linux Scheduling  Linux Scheduling Policy  Classification Of Processes In Linux  Linux Scheduling Classes  Process States In Linux.
Module 2 Clock-Driven Scheduling
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Combined Scheduling of Periodic and Aperiodic Tasks.
Task Scheduling By Dr. Amin Danial Asham.
Real-Time Systems Lecture 1: Introduction. Course Outline Design Methodologies Scheduling Theory  Schedulability Analysis  Real-Time Scheduling Algorithms.
Scheduling Aperiodic and Sporadic Jobs
Real Time Operating Systems Scheduling & Schedulers Course originally developed by Maj Ron Smith 8-Oct-15 Dr. Alain Beaulieu Scheduling & Schedulers- 7.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Clock Driven Scheduling By Dr. Amin Danial Asham.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
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
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)
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems RMS and EDF Schedulers.
CS244-Introduction to Embedded Systems and Ubiquitous Computing Instructor: Eli Bozorgzadeh Computer Science Department UC Irvine Winter 2010.
Mapping: Applications  Processors
Special Class on Real-Time Systems
Module 2 Overview of Real Time System Scheduling
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Real time scheduling G.Anuradha Ref:- Stallings. Real time computing Correctness of the system depends not only on the logical result of computation,
Common Approaches to Real-Time Scheduling Clock-driven (time-driven) schedulers Priority-driven schedulers Examples of priority driven schedulers Effective.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Dynamic Priority Driven Scheduling of Periodic Task
Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund, Informatik 12 Germany 2012 年 12 月 19 日 These slides use Microsoft clip.
CS333 Intro to Operating Systems Jonathan Walpole.
For a good summary, visit:
Cliff’s Notes for Real-Time Systems
Clock Driven Scheduling
Clock Driven Schedulers
Real-Time Operating Systems RTOS For Embedded systems.
Embedded System Scheduling
RTOS Scheduling 3 Cyclic scheduling, EDF. Tasks with precedence, Scheduling impact of DMA, cache, interrupts & context switch overhead, Aperiodic Georgio.
Chapter 2 Scheduling.
Chapter 8 – Processor Scheduling
Clock Driven Scheduling
CprE 458/558: Real-Time Systems
Chapter 6: CPU Scheduling
Chapter 6 Dynamic Priority Servers
Clock-driven Static scheduling
Clock-driven Static scheduling
Clock-driven Static scheduling
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
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
Scheduling.
Supporting Time-Sensitive Applications on a Commodity OS
Ch.7 Scheduling Aperiodic and Sporadic Jobs in Priority-Driven Systems
CHAPTER 3 A Reference Model of Real-Time Systems
Presentation transcript:

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 k-1 )) END LOOP END Scheduler; Precompute static schedule off-line (e.g. at design time): can afford expensive algorithms. Idle times can be used for aperiodic jobs. Possible implementation: Table-driven Scheduling table has entries of type (t k, J(t k )), where t k :decision time J(t k ): job to start at time t k Input: Schedule (t k, J(t k )) k = 0,1,…,N-1

Cyclic Schedules: General Structure Scheduling decision is made periodically: –choose which job to execute –perform monitoring and enforcement operations Major Cycle: Frames in a hyperperiod. frame f decision points hyperperiod H major cycle

Frame Size Constraints Frames must be sufficiently long so that every job can start and complete within a single frame: The hyperperiod must have an integer number of frames: For monitoring purposes, frames must be sufficiently small that between release time and deadline of every job there is at least one frame: t t+ft+2ft+3f t’t’+D i t’+p i )max()1( i ef  )""()2(HdividesfHf ii i i Dfpf fptt Dttf    ),gcd(2)3( ), ' )'(2

Frame Sizes: Example Task set: pipi eiei DiDi 660 )22,3, ( )26,2,20( )14,1,15(     H T T T 6,5,4,3:for valuespossible 6,5,4,3,2),gcd(2:)3(,..10,6,5,4,3,2)2( 3:)1( f fDifpifi fHf fefi i    

Slicing and Scheduling Blocks Slicing slice T ….. scheduling block H pipi eiei DiDi ?! 4)3( 5)1( )20,5, ( )5,2,5( )4,1,4(        f f T T T 4 4)3( 3)1( )20,1, ( ),3, ( ),1, ( )5,2,5( )4,1,4(           f f f T T T T T

Cyclic Executive Input: Stored schedule: L(k) for k = 0,1,…,F-1; Aperiodic job queue. TASK CYCLIC_EXECUTIVE: t = 0; /* current time */ k = 0; /* current frame */ CurrentBlock := empty; BEGIN LOOP IF take action; CurrentBlock := L(k); k := k+1 mod F; t := t+1; set timer to expire at time tF; IF take action; wake up periodic task server to handle slices in CurrentBlock; sleep until periodic task server completes or timer expires; IF CONTINUE; WHILE wake up the first job in the queue; sleep until the aperiodic job completes; remove the just completed job from the queue; END WHILE; sleep until next clock interrupt; END LOOP; END CYCLIC_EXECUTIVE;

What About Aperiodic Jobs? Typically: –Scheduled in the background. –Their execution may be delayed. But: –Aperiodic jobs are typically results of external events. Therefore: –The sooner the completion time, the more responsive the system –Minimizing response time of aperiodic jobs becomes a design issue. Approach: –Execute aperiodic jobs ahead of periodic jobs whenever possible. –This is called Slack Stealing.

Slack Stealing (Lehoczky et al., RTSS’87) x k Amount of time allocated to slices executed during frame F k. s k Slack during frame F k : s k := f - x k. The cyclic executive can execute aperiodic jobs for s k amount of time without causing jobs to miss deadlines. Example:

Slack Stealing (2) aperiodic jobs periodic (real-time) jobs slack stealing

Sporadic Jobs Reminder: Sporadic jobs have hard deadlines; the release time and the execution time are not known a priori. Worst-case execution time known when job is released. Need acceptance test: J(d,e) F c-1 FcFc F c+1 FlFl F l+1 scsc s c+1 slsl d : Total amount of slack in Frames F c, …, F l Acceptance Test: IF S(c,l) < e THEN reject job; ELSE accept job; schedule execution; END; how?!    l ci i slcS),(

Scheduling of Accepted Jobs Static scheduling: –Schedule as large a slice of the accepted job as possible in the current frame. –Schedule remaining portions as late as possible. Mechanism: –Append slices of accepted job to list of periodic-task slices in frames where they are scheduled. Problem: Early commit. Alternatives: –Rescheduling upon arrival. –Priority-driven scheduling of sporadic jobs.

EDF-Scheduling of Accepted Jobs... T1T1 T2T2 T3T3 TNTN priority queue aperiodic processor reject acceptance test periodic tasks

Acceptance Test for EDF-Scheduled Sporadic Jobs Sporadic Job J with deadline d arrives: Test 1: Test whether current amount of slack before d is enough to accommodate J. (*) If not, reject! Test 2: Test whether sporadic jobs still in system with deadlines after d will miss deadline if J is accepted. (**) If yes, reject! Accept! (*) Define S(J i ) : Amount of slack up to time d i after J i has been scheduled. (**) Update all S(J i ) with d i > d, that is, eJSJSddi iii  )()( : such that

Accept. Test for EDF Spor. Jobs (Implementation) Define S i,k : slack in Frames F i,..., F k Precompute all S i,k in first major cycle Initial amounts of slack in later cycles can be computed as S i+jF,k+j’F = S i,F + S 1,k + (j’-j)S 1,F Compute current slack of job with release time in frame c - 1 and deadline in frame l + 1 : S(J new ) = S c,l –  (dk<d) e k (c) Implementation: –Initially compute S(J) for newly arriving job. If negative, reject. –Whenever job with earlier deadline arrives, decrease this value. If negative, reject new job.

Pros and Cons of Clock-Driven Scheduling Pros: –Conceptual simplicity –Timing constraints can be checked and enforced at frame boundaries. –Preemption cost can be kept small by having appropriate frame sizes. –Easy to validate: Execution times of slices known a priori. Cons: –Difficult to maintain. –Does not allow to integrate hard and soft deadlines.