Cyclic Schedules: General Structure. Frame Size Constraints

Similar documents
Clock-Driven Scheduling (in-depth) Cyclic Schedules: General Structure

Clock-driven scheduling

3. Scheduling issues. Common approaches 3. Common approaches 1. Preemption vs. non preemption. Common approaches 2. Further definitions

Real-Time Scheduling

Real-time Scheduling of Periodic Tasks (1) Advanced Operating Systems Lecture 2

Task Models and Scheduling

Aperiodic Task Scheduling

There are three priority driven approaches that we will look at

Lecture 6. Real-Time Systems. Dynamic Priority Scheduling

Real-Time and Embedded Systems (M) Lecture 5

Real-Time Systems. Event-Driven Scheduling

Lecture 13. Real-Time Scheduling. Daniel Kästner AbsInt GmbH 2013

Embedded Systems Development

Real-Time Systems. Event-Driven Scheduling

Real-time operating systems course. 6 Definitions Non real-time scheduling algorithms Real-time scheduling algorithm

System Model. Real-Time systems. Giuseppe Lipari. Scuola Superiore Sant Anna Pisa -Italy

Networked Embedded Systems WS 2016/17

Real-Time Scheduling. Real Time Operating Systems and Middleware. Luca Abeni

Priority-driven Scheduling of Periodic Tasks (1) Advanced Operating Systems (M) Lecture 4

Andrew Morton University of Waterloo Canada

Embedded Systems 14. Overview of embedded systems design

Scheduling Periodic Real-Time Tasks on Uniprocessor Systems. LS 12, TU Dortmund

Real-time Scheduling of Periodic Tasks (2) Advanced Operating Systems Lecture 3

Non-Preemptive and Limited Preemptive Scheduling. LS 12, TU Dortmund

Delay bounds (Simon S. Lam) 1

Scheduling Slack Time in Fixed Priority Pre-emptive Systems

Design of Real-Time Software

EDF Scheduling. Giuseppe Lipari CRIStAL - Université de Lille 1. October 4, 2015

Real-Time Systems. Lecture 4. Scheduling basics. Task scheduling - basic taxonomy Basic scheduling techniques Static cyclic scheduling

EDF Scheduling. Giuseppe Lipari May 11, Scuola Superiore Sant Anna Pisa

Lecture Note #6: More on Task Scheduling EECS 571 Principles of Real-Time Embedded Systems Kang G. Shin EECS Department University of Michigan

Embedded Systems 15. REVIEW: Aperiodic scheduling. C i J i 0 a i s i f i d i

Real-Time Systems. LS 12, TU Dortmund

Process Scheduling for RTS. RTS Scheduling Approach. Cyclic Executive Approach

Resource Sharing in an Enhanced Rate-Based Execution Model

LSN 15 Processor Scheduling

A Dynamic Real-time Scheduling Algorithm for Reduced Energy Consumption

Real-Time Scheduling and Resource Management

Real-time Systems: Scheduling Periodic Tasks

CIS 4930/6930: Principles of Cyber-Physical Systems

Static priority scheduling

Spare CASH: Reclaiming Holes to Minimize Aperiodic Response Times in a Firm Real-Time Environment

RUN-TIME EFFICIENT FEASIBILITY ANALYSIS OF UNI-PROCESSOR SYSTEMS WITH STATIC PRIORITIES

CSE 380 Computer Operating Systems

Scheduling. Uwe R. Zimmer & Alistair Rendell The Australian National University

CPU SCHEDULING RONG ZHENG

IN4343 Real Time Systems April 9th 2014, from 9:00 to 12:00

Optimal Utilization Bounds for the Fixed-priority Scheduling of Periodic Task Systems on Identical Multiprocessors. Sanjoy K.

Task Reweighting under Global Scheduling on Multiprocessors

The Rate-Based Execution Model

Real Time Operating Systems

ENHANCING CPU PERFORMANCE USING SUBCONTRARY MEAN DYNAMIC ROUND ROBIN (SMDRR) SCHEDULING ALGORITHM

Deadline-driven scheduling

CycleTandem: Energy-Saving Scheduling for Real-Time Systems with Hardware Accelerators

Non-preemptive Fixed Priority Scheduling of Hard Real-Time Periodic Tasks

TDDB68 Concurrent programming and operating systems. Lecture: CPU Scheduling II

A Theory of Rate-Based Execution. A Theory of Rate-Based Execution

Non-Work-Conserving Non-Preemptive Scheduling: Motivations, Challenges, and Potential Solutions

Segment-Fixed Priority Scheduling for Self-Suspending Real-Time Tasks

Lecture: Workload Models (Advanced Topic)

A Framework for Automated Competitive Analysis of On-line Scheduling of Firm-Deadline Tasks

Scheduling Lecture 1: Scheduling on One Machine

EECS 571 Principles of Real-Time Embedded Systems. Lecture Note #7: More on Uniprocessor Scheduling

Reducing Tardiness Under Global Scheduling by Splitting Jobs

Time and Schedulability Analysis of Stateflow Models

Comp 204: Computer Systems and Their Implementation. Lecture 11: Scheduling cont d

A Utilization Bound for Aperiodic Tasks and Priority Driven Scheduling

EDF Feasibility and Hardware Accelerators

Improved Schedulability Analysis of EDF Scheduling on Reconfigurable Hardware Devices

On-line scheduling of periodic tasks in RT OS

Real Time Operating Systems

A New Sufficient Feasibility Test for Asynchronous Real-Time Periodic Task Sets

Probabilistic real-time scheduling. Liliana CUCU-GROSJEAN. TRIO team, INRIA Nancy-Grand Est

Exam Spring Embedded Systems. Prof. L. Thiele

Real-Time Systems. Lecture #14. Risat Pathan. Department of Computer Science and Engineering Chalmers University of Technology

Controlling Preemption for Better Schedulability in Multi-Core Systems

Online Energy-Aware I/O Device Scheduling for Hard Real-Time Systems with Shared Resources

Discrete Event Simulation

arxiv: v1 [cs.os] 6 Jun 2013

CEC 450 Real-Time Systems

Semi-Partitioned Fixed-Priority Scheduling on Multiprocessors

A 2-Approximation Algorithm for Scheduling Parallel and Time-Sensitive Applications to Maximize Total Accrued Utility Value

CS 374: Algorithms & Models of Computation, Spring 2017 Greedy Algorithms Lecture 19 April 4, 2017 Chandra Chekuri (UIUC) CS374 1 Spring / 1

Scheduling Stochastically-Executing Soft Real-Time Tasks: A Multiprocessor Approach Without Worst-Case Execution Times

CHAPTER 5 - PROCESS SCHEDULING

CPU Scheduling. Heechul Yun

Schedulability of Periodic and Sporadic Task Sets on Uniprocessor Systems

Real-time scheduling of sporadic task systems when the number of distinct task types is small

Rate Monotonic Analysis (RMA)

Reducing Tardiness Under Global Scheduling by Splitting Jobs

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Feedback EDF Scheduling of Real-Time Tasks Exploiting Dynamic Voltage Scaling

Load Regulating Algorithm for Static-Priority Task Scheduling on Multiprocessors

ENHANCING THE CPU PERFORMANCE USING A MODIFIED MEAN- DEVIATION ROUND ROBIN SCHEDULING ALGORITHM FOR REAL TIME SYSTEMS.

A New Task Model and Utilization Bound for Uniform Multiprocessors

FPCL and FPZL Schedulability Analysis

Paper Presentation. Amo Guangmo Tong. University of Taxes at Dallas February 11, 2014

Environment (E) IBP IBP IBP 2 N 2 N. server. System (S) Adapter (A) ACV

Shedding the Shackles of Time-Division Multiplexing

Complexity and Algorithms for Two-Stage Flexible Flowshop Scheduling with Availability Constraints

Transcription:

CPSC-663: Real-ime Systems Cyclic Schedules: General Structure Scheduling decision is made periodically: Frame Scheduling decision is made periodically: choose which job to execute perorm monitoring and enorcement operations decision points Major Cycle: Frames in a hyperperiod. major cycle hyperperiod H Frame Size Constraints Frames must be suiciently long so that every job can start and complete within a single rame: 1 max ei he hyperperiod must have an integer number o rames: 2 H " divides" H For monitoring purposes, rames must be suiciently small that between release time and deadline o every job there is at least one rame: t t t+ t+2 t +D i t +p i t+3 3 2 t' t D t' t gcd p, 2 gcd p, D i i i i 1

CPSC-663: Real-ime Systems Frame Sizes: Example ask set: 1 2 3 p i e i D i 15, 1, 14 20, 2, 26 22, 3, 22 H 660 1 2 3 i : ei H i : 2 gcd pi, Di 3 2,3,4,5,6,10,.. 2,3,4,5,6 possible values or : 3,4,5,6 Slicing and Scheduling Blocks Slicing 1 2 3 p i e i D i 4, 1, 4 5, 2, 5 20, 5, 20 1 3 5 4?! slice 3 1 2 31 32 33 4, 5, 20, 20, 20, 1, 2, 1, 3, 1, 4 5 20 20 20 1 3 3 4 4 scheduling block 1 2 3 1 1 2 1 3 2 1 2 1 2 3 3.. 0 4 8 12 16 20 H 2

CPSC-663: Real-ime Systems Cyclic Executive Input: "Stored schedule: Lk or k 0,1,,F-1; " "Aperiodic job queue. ASK CYCLIC_EXECUIVE: t 0; /* current time */ k 0; /* current rame */ CurrentBlock : empty; BEGIN LOOP IF <any slice in CurrentBlock is not completed> take action; CurrentBlock : Lk; k : k+1 mod F; t : t+1; set timer to expire at time tf; IF <any slice in CurrentBlock is not released> take action; wake up periodic task server to handle slices in CurrentBlock; sleep until periodic task server completes or timer expires; IF <timer expired> CONINUE; WHILE <the aperiodic job queue is not empty> wake up the irst job in the queue; sleep until the aperiodic job completes; remove the just completed job rom the queue; END WHILE; sleep until next clock interrupt; END LOOP; END CYCLIC_EXECUIVE; What About Aperiodic Jobs? ypically: " Scheduled in the background. heir execution may be delayed. But: Aperiodic jobs are typically results o external events. hereore: he sooner the completion time, the more responsive the system Minimizing response time o aperiodic jobs becomes a design issue. Approach: Execute aperiodic jobs ahead o periodic jobs whenever possible. his is called Slack Stealing. 3

CPSC-663: Real-ime Systems Slack Stealing Lehoczky et al., RSS 87 x k " "Amount o time allocated to slices executed during rame F k. s k " "Slack during rame F k : s k : - x k. he cyclic executive can execute aperiodic jobs or s k amount o time without causing jobs to miss deadlines. Example: 0 4 1.5 8 0.5 2.0 12 16 20 4 9.5 10.5 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: Jd,e s c s c+1 s l d F c-1 F c F c+1 F l F l+1 l s i i c S c, l : otal amount o slack in Frames F c,, F l. Acceptance est: "IF Sc,l < e HEN reject job; ELSE accept job; schedule execution; END; how?! 4

CPSC-663: Real-ime Systems Scheduling o Accepted Jobs Static scheduling: Schedule as large a slice o the accepted job as possible in the current rame. Schedule remaining portions as late as possible. Mechanism: Append slices o accepted job to list o periodic-task slices in rames where they are scheduled. Problem: Early commit. Alternatives: Rescheduling upon arrival. Priority-driven scheduling o sporadic jobs. EDF-Scheduling o Accepted Jobs 1 periodic tasks 2 3 N... acceptance test reject priority queue processor aperiodic 5

CPSC-663: Real-ime Systems Acceptance est or EDF-Scheduled Sporadic Jobs Sporadic Job J with deadline d arrives: est 1: "est whether current amount o slack beore d is " "enough to accommodate J. * " "I not, reject! est 2: "est whether sporadic jobs still in system with " "deadlines ater d will miss deadline i J " "is accepted. ** " "I yes, reject! Accept! * "Deine SJ i : "Amount o slack up to time d i ater J i has " " "been scheduled. ** "Update all SJ i with d i > d, that is, Accept. est or EDF Spor. Jobs Implementation Deine S i,k : slack in Frames F i,..., F k Precompute all S i,k in irst major cycle Initial amounts o slack in later cycles can be computed as S i+jf,k+j F S i,f + S 1,k + j -js 1,F Compute current slack o job with release time in F c-1 and deadline in F l+1 : " "S new c,l S c,l Σ dk<d e k c Implementation: Initially compute S c,l or newly arriving job. I negative, reject. Whenever job with earlier deadline arrives, decrease this value. I negative, reject new job. 6

CPSC-663: Real-ime Systems Static Scheduling o Jobs in Frames Layout o task schedule or cyclic executive can be ormulated as a schedule or jobs in a hyperperiod. his can be ormulated as a network low problem. J 1 F 1 J 2 F 2 Source e i J i............ F j Sink J n-1 J n F m-1 F m Pros and Cons o Pros: Conceptual simplicity iming constraints can be checked and enorced at rame boundaries. Preemption cost can be kept small by having appropriate rame sizes. Easy to validate: Execution times o slices known a priori. Cons: Diicult to maintain. Does not allow to integrate hard and sot deadlines. 7

CPSC-663: Real-ime Systems Putting the Cyclic Executive into Practice. P. Baker, Alan Shaw, he Cyclic Executive Model and Ada Implementation approaches or a Cyclic Executive: Solutions and Diiculties Naive solution using the DELAY statement Using an interrupt rom a hardware clock Dealing with lost or buered interrupts Handling rame overruns Naive Solution Using the DELAY Statement Source:. P. Baker, Alan Shaw, he Cyclic Executive Model and Ada 8

CPSC-663: Real-ime Systems Using an Interrupt rom a Hardware Clock Source:. P. Baker, Alan Shaw, he Cyclic Executive Model and Ada Dealing with Lost or Buered Interrupts Source:. P. Baker, Alan Shaw, he Cyclic Executive Model and Ada 9

CPSC-663: Real-ime Systems Handling Frame Overruns I ABORION: Source:. P. Baker, Alan Shaw, he Cyclic Executive Model and Ada Handling Frame Overruns II EXCEPIONS: Source:. P. Baker, Alan Shaw, he Cyclic Executive Model and Ada 10