Real-Time Scheduling --- An Overview Real-Time Scheduling --- An Overview Xiaoping He.

Slides:



Advertisements
Similar presentations
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Advertisements

Chapter 9 Uniprocessor Scheduling
Chapter 9 Uniprocessor Scheduling
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.
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008,
Ceng Operating Systems Chapter 2.2 : Process Scheduling Process concept  Process scheduling Interprocess communication Deadlocks Threads.
Chapter 3: CPU Scheduling
1 Multiprocessor and Real-Time Scheduling Chapter 10.
Chapter 9 Uniprocessor Scheduling
Scheduling in Batch Systems
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
Multiprocessor and Real-Time Scheduling Chapter 10.
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
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.
1 Lecture 10: Uniprocessor Scheduling. 2 CPU Scheduling n The problem: scheduling the usage of a single processor among all the existing processes in.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Main Job: Assign processes to be executed by the processor(s) and processes to be loaded in main.
Uniprocessor Scheduling
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
Lecture 5: Uniprocessor Scheduling
Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
Chapter 9 Uniprocessor Scheduling Spring, 2011 School of Computer Science & Engineering Chung-Ang University.
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
MM Process Management Karrie Karahalios Spring 2007 (based off slides created by Brian Bailey)
Chapter 9 Uniprocessor Scheduling Seventh Edition By William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals.
Task Scheduling By Dr. Amin Danial Asham.
Classification of scheduling policies Preemptive methods (typical representative: RR) Non-preemptive methods (typical representative: FCFS) Preemption.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Scheduling policies for real- time embedded systems.
Chapter 10 Multiprocessor and Real-Time Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling To improve: Response time: time it takes a system to react to a given input Turnaround Time (TAT)
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Minimize response time Maximize throughput Maximize processor efficiency.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Response time Throughput Processor efficiency.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Response time Throughput Processor efficiency.
Uniprocessor Scheduling
Operating System 9 UNIPROCESSOR SCHEDULING. TYPES OF PROCESSOR SCHEDULING.
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
CSCI1600: Embedded and Real Time Software Lecture 24: Real Time Scheduling II Steven Reiss, Fall 2015.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Assign processes to be executed by the processor or processors: –Response time –Throughput –Processor.
Real time scheduling G.Anuradha Ref:- Stallings. Real time computing Correctness of the system depends not only on the logical result of computation,
Silberschatz and Galvin  Operating System Concepts Module 5: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 31 – Process Management (Part 1) Klara Nahrstedt Spring 2009.
For a good summary, visit:
1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
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
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Uniprocessor Scheduling
Chapter 2 Scheduling.
Chapter 8 – Processor Scheduling
Chapter 2.2 : Process Scheduling
CprE 458/558: Real-Time Systems
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
OverView of Scheduling
TDC 311 Process Scheduling.
CPU SCHEDULING.
Chapter 10 Multiprocessor and Real-Time Scheduling
Uniprocessor scheduling
Presentation transcript:

Real-Time Scheduling --- An Overview Real-Time Scheduling --- An Overview Xiaoping He

What is Real Time System  Real Time System (RTS):  A computer-controlled mechanism in which there are strict timing constraints on the computer’s actions.

Real-Time System bConsists of four parts: Physical ProcessPhysical Process --controlled by the computer for some productive end --controlled by the computer for some productive end SensorsSensors --converts state of physical process into information analog or digital --converts state of physical process into information analog or digital ComputersComputers --will work based on infromation from sensors, deduces state of physical process and issues commands to control the process. --will work based on infromation from sensors, deduces state of physical process and issues commands to control the process. ActuatorsActuators --will response to commands issued by computer, modifies the physical process. --will response to commands issued by computer, modifies the physical process.

Real-Time System bCharacteristics: DeterminismDeterminism It is concerned with how long an operating system delays before acknowledging an interrupt. It is concerned with how long an operating system delays before acknowledging an interrupt. ResponsivenessResponsiveness It is concerned with how long, after acknowledgment, it takes an operating system to serve the interrupt. It is concerned with how long, after acknowledgment, it takes an operating system to serve the interrupt. User ControlUser Control It is essential to allow the user have control over task priority. The user should be able to distinguish between hard and soft tasks and to specify relative priorities within each class. It is essential to allow the user have control over task priority. The user should be able to distinguish between hard and soft tasks and to specify relative priorities within each class. ReliabilityReliability It is very important because it is responding to and controlling events in real time. It is very important because it is responding to and controlling events in real time. Fail-soft operationFail-soft operation It is refers to the ability of a system to fail in such a way as to preserve as much capability and data as possible. It is refers to the ability of a system to fail in such a way as to preserve as much capability and data as possible.

 Real-Time Computing:  Hard-Real-Time Task It must meet its deadline, otherwise it will cause undesirable damage or a fatal error to the system.  Soft-Real-Time Task It has a associated deadline that is desirable but not mandatory, it still makes sense to schedule and complete the task even if it has passed its deadline. It has a associated deadline that is desirable but not mandatory, it still makes sense to schedule and complete the task even if it has passed its deadline.

Terminology b Static versus dynamic Scheduling Static Scheduling: the scheduling algorithm has complete knowledge of the task set and its constraints.Static Scheduling: the scheduling algorithm has complete knowledge of the task set and its constraints. Dynamic Scheduling: this algorithm has complete knowledge of currently active tasks, but didn’t know new task activation. So this kind of scheduling changes over time.Dynamic Scheduling: this algorithm has complete knowledge of currently active tasks, but didn’t know new task activation. So this kind of scheduling changes over time.

Terminology (continue) b Periodic versus aperiodic tasks Periodic task: the requirement may be stated as "once per period T" or "exactly T units apart".Periodic task: the requirement may be stated as "once per period T" or "exactly T units apart". Aperiodic task: has a deadline by which it must finish or start, or it may have a constraint on both start and finish time.Aperiodic task: has a deadline by which it must finish or start, or it may have a constraint on both start and finish time.

Uniprocessor Scheduling Uniprocessor Scheduling bTypes of scheduling Long-term scheduling: This is a decision to add a new process to the set of processes that are currently active. It is performed when process is created.Long-term scheduling: This is a decision to add a new process to the set of processes that are currently active. It is performed when process is created. Medium-term scheduling: is a part of the swapping function. The decision to add process to the set of processes that are partially or fully on main memory (swapping).Medium-term scheduling: is a part of the swapping function. The decision to add process to the set of processes that are partially or fully on main memory (swapping). Short-term scheduling: is called dispatcher who decide which process to be executed next.Short-term scheduling: is called dispatcher who decide which process to be executed next. I/O scheduling: The decision as to which process’s pending I/O request shall be handled by an available I/O deviceI/O scheduling: The decision as to which process’s pending I/O request shall be handled by an available I/O device

Scheduling and Process state Transitions

Scheduling Policies b First Come First Served (FCFS) The simplest scheduling policy which performs much better for long processes than short ones. See text book example page391 The simplest scheduling policy which performs much better for long processes than short ones. See text book example page391 b Round Robin (RR, also known as Time Slicing) This is a way to reduce the penalty that short jobs is not performed well in FCFS. It use preemption based on a clock.Clock interrupt is generated at periodic intervals. When the interrupt occurs the currently running process is placed in the ready queue, and the next ready job is selectec on an FCFS basis. This is a way to reduce the penalty that short jobs is not performed well in FCFS. It use preemption based on a clock.Clock interrupt is generated at periodic intervals. When the interrupt occurs the currently running process is placed in the ready queue, and the next ready job is selectec on an FCFS basis. b Shortest Process Next (SPN) This is a nonpreemptive policy in which the process with the shortest expected processing time is selected next. This is a nonpreemptive policy in which the process with the shortest expected processing time is selected next. b Shortest Remain Time (SRT) In this case, the scheduler always chooses the process that has the shortest expected remaining processing time. In this case, the scheduler always chooses the process that has the shortest expected remaining processing time.

Scheduling Policies (continue) b Highest Response Ratio Next (HRRN) RR=(W+S)/S (W: waiting time, S: service time) RR=(W+S)/S (W: waiting time, S: service time) b Feed Back (FB) This scheduling is done on a preemptive basis, and a dynamic priority mechanisms is used.When a process first enters the system, it is placed in highest priority queue. After its first execution, when it returns to the ready state, it is placed in second priority queue. Each subsequent time, it is demoted to the next lower-priority queue. Within each queue, except the lowest-priority queue, a simple FCFS mechanism is used. For the lowest-priority queue, a Round Robin mechanism is used. This scheduling is done on a preemptive basis, and a dynamic priority mechanisms is used.When a process first enters the system, it is placed in highest priority queue. After its first execution, when it returns to the ready state, it is placed in second priority queue. Each subsequent time, it is demoted to the next lower-priority queue. Within each queue, except the lowest-priority queue, a simple FCFS mechanism is used. For the lowest-priority queue, a Round Robin mechanism is used.

Uniprocessor Scheduling Algorithms bMany basic algorithms and theoretical results have been developed for uniprocessor scheduling. bTwo famous algorithms: Earliest-Deadline-First SchedulingEarliest-Deadline-First Scheduling Rate-Monotonic SchedulingRate-Monotonic Scheduling

Earliest-Deadline-First Scheduling b This is a dynamic scheduling algorithm, the priority of tasks will be changed. b Priorities are assigned to tasks according to the deadlines of their current requests. b Theorem: Any sequence that at any instant schedules the job with EDF among all the eligible jobs is optimal with respect to minimizing maximum lateness. b Full processor utilization is always achievable(U=C/T, C:computation time, T: period)

Rate-Monotonic Scheduling b This is a static scheduling algorithm with fixed priority for each task. b Priorities are assigned to tasks according to their request rates(1/T: T is a period), independent of their run-times. Tasks with shortest period will have higher priorities. When more than one task is available for execution, the one with the shortest period is served first. b Theorem: 1.For a set of n tasks with fixed priority order, the least upper bound to processor utilization is U=n(2-1). If the total utilization required for a set of tasks is less than the upper bound, then all the tasks will be successfully scheduled. 1.For a set of n tasks with fixed priority order, the least upper bound to processor utilization is U=n(2 1/n -1). If the total utilization required for a set of tasks is less than the upper bound, then all the tasks will be successfully scheduled. 2.The sum of the processor utilizations of the individual tasks cannot exceed a value of 1(C1/T1+C2/T2+…+Cn/Tn<=1) which will guarantees that a perfect scheduling algorithm can successfully schedule. 2.The sum of the processor utilizations of the individual tasks cannot exceed a value of 1(C1/T1+C2/T2+…+Cn/Tn<=1) which will guarantees that a perfect scheduling algorithm can successfully schedule. b Prerequisite: Periodic task deadlines should be equal to the period.

Uniprocessor Scheduling b Problems with these two algorithms Shared resources:Shared resources: When there are mutual exclusion constraints, it is impossible to find a totally in-line optimal runtime scheduler. A much more negative result has shown that: The problem of deciding whether it is possible to schedule a set of periodic processes that use semaphores only to enforce mutual exclusion is NP-hard. (NP is the class of all decision problems that can be solved in polynomial time by a nondeterministic machine). When there are mutual exclusion constraints, it is impossible to find a totally in-line optimal runtime scheduler. A much more negative result has shown that: The problem of deciding whether it is possible to schedule a set of periodic processes that use semaphores only to enforce mutual exclusion is NP-hard. (NP is the class of all decision problems that can be solved in polynomial time by a nondeterministic machine). Overloads:Overloads: experiments show that these algorithms perform very poorly in overload conditions. That's because they give the highest priority to processes that are close to missing their deadlines. experiments show that these algorithms perform very poorly in overload conditions. That's because they give the highest priority to processes that are close to missing their deadlines.

Multiprocessor Scheduling b We know less about real-time scheduling for multiprocessor-based systems than for uniprocessors. Deterministic (Static) SchedulingDeterministic (Static) Scheduling Dynamic Scheduling (EDF not optimal any more)Dynamic Scheduling (EDF not optimal any more)

Static Scheduling Static Scheduling 1. Requests for tasks are periodic, with constant interval between requests. 1. Requests for tasks are periodic, with constant interval between requests. 2. Each task must be completed before the next request for it occurs. 2. Each task must be completed before the next request for it occurs. 3. Tasks are independent. 3. Tasks are independent. 4. Computation time for each task is constant. 4. Computation time for each task is constant.

Dynamic Scheduling Dynamic Scheduling b Distributed Dynamic Scheduling In a distributed dynamic scheduling scheme, tasks arrive independently at each processor. When a task arrives at a processor, the local scheduler at the processor determines whether or not it can satisfy the constraints of the incoming task. The task is accepted if they can be satisfied, otherwise, the local scheduler tries to find another processor which can accept the task. In a distributed dynamic scheduling scheme, tasks arrive independently at each processor. When a task arrives at a processor, the local scheduler at the processor determines whether or not it can satisfy the constraints of the incoming task. The task is accepted if they can be satisfied, otherwise, the local scheduler tries to find another processor which can accept the task. b Centralized Dynamic Scheduling In a centralized scheme, all the tasks arrive at a central processor called the scheduler, from where they are distributed to other processors in the system for execution. The communication between the scheduler and the processors is through dispatch queues. In a centralized scheme, all the tasks arrive at a central processor called the scheduler, from where they are distributed to other processors in the system for execution. The communication between the scheduler and the processors is through dispatch queues.

Conclusion Conclusion Process scheduling is an important issue in the design and maintenance of Real-Time systems. The primary objective of scheduling is to provide a feasible process allocation and sequenc in order to meet deadlines and achieve high resource utilization. As we have shown, classical scheduling theory does provide a basic set of results for real-time system designers. Many results are known for uniprocessors, unfortunately, for multiprocessors, we need new results that deal more directly with relevant metrics and realistic task characteristics. Process scheduling is an important issue in the design and maintenance of Real-Time systems. The primary objective of scheduling is to provide a feasible process allocation and sequenc in order to meet deadlines and achieve high resource utilization. As we have shown, classical scheduling theory does provide a basic set of results for real-time system designers. Many results are known for uniprocessors, unfortunately, for multiprocessors, we need new results that deal more directly with relevant metrics and realistic task characteristics.