Multiprocessor and Real-Time Scheduling

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Real Time Scheduling.
1 Multiprocessor and Real-Time Scheduling Chapter 10.
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.
1 Multiprocessor and Real-Time Scheduling Chapter 10.
1 Multiprocessor and Real-Time Scheduling Chapter 10.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
Tao Yang, UCSB CS 240B’03 Unix Scheduling Multilevel feedback queues –128 priority queues (value: 0-127) –Round Robin per priority queue Every scheduling.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Multiprocessor and Real-Time Scheduling Chapter 10.
1 Traditional OSes with Soft Real- Time Scheduling Module 3.3 For a good summary, visit:
Chapter 11 Operating Systems
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
1 Scheduling in Representative Operating Systems.
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
Informationsteknologi Tuesday, October 9, 2007Computer Systems/Operating Systems - Class 141 Today’s class Scheduling.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
OS and the Computer System  Some OS programs exist permanently in the system area of the memory to monitor and control activities in the computer system.
Chapter 10 Multiprocessor and Real-Time Scheduling
Multiprocessor and Real-Time Scheduling
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.
Operating System 10 MULTIPROCESSOR AND REAL-TIME SCHEDULING
 Scheduling  Linux Scheduling  Linux Scheduling Policy  Classification Of Processes In Linux  Linux Scheduling Classes  Process States In Linux.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction What is an Operating System? Mainframe Systems Desktop Systems.
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Lecture 5 Operating Systems.
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
Chapter 9 Uniprocessor Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Thanks to Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 1: Introduction n What is an Operating System? n Mainframe Systems.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 1 Introduction Read:
Chapter 10 Multiprocessor and Real-Time Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Chapter 6 Scheduling. Basic concepts Goal is maximum utilization –what does this mean? –cpu pegged at 100% ?? Most programs are I/O bound Thus some other.
Real-Time Scheduling CS4730 Fall 2010 Dr. José M. Garrido Department of Computer Science and Information Systems Kennesaw State University.
Chapter 10 Multiprocessor and Real-Time Scheduling Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community.
Page 1 2P13 Week 9. Page 2 Table 9.2 Scheduling Criteria User Oriented, Performance Related Turnaround time This is the interval of time between the submission.
Multiprocessor and Real-Time Scheduling Chapter 10.
Chapter 101 Multiprocessor and Real- Time Scheduling Chapter 10.
1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303.
1.1 Operating System Concepts Introduction What is an Operating System? Mainframe Systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Minimize response time Maximize throughput Maximize processor efficiency.
Chapter 7 Operating Systems. Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the.
1 Multiprocessor Scheduling Module 3.1 For a good summary on multiprocessor and real-time scheduling, visit:
ICOM Noack Scheduling For Distributed Systems Classification – degree of coupling Classification – granularity Local vs centralized scheduling Methods.
CompSci 143A1 5. Process and thread scheduling 5.1 Organization of Schedulers – Embedded and Autonomous Schedulers – Priority Scheduling 5.2 Scheduling.
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
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,
Introduction to Embedded Systems Rabie A. Ramadan 5.
For a good summary, visit:
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
1.  System Characteristics  Features of Real-Time Systems  Implementing Real-Time Operating Systems  Real-Time CPU Scheduling  An Example: VxWorks5.x.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
CONCEPTS OF REAL-TIME OPERATING SYSTEM. OBJECTIVE  To Understand Why we need OS?  To identify Types of OS  To Define Real - Time Systems  To Classify.
Real-Time Operating Systems RTOS For Embedded systems.
CPU Scheduling Scheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource.
Principles of Operating Systems Lecture 16 Abhishek Dubey Daniel Balasubramanian Real Time Scheduling Fall 2014.
Multiprocessor, Multicore, and Real-Time Scheduling Chapter 10
Process Management Process Concept Why only the global variables?
Uniprocessor Scheduling
Real-time Software Design
CPU SCHEDULING.
Multiprocessor and Real-Time Scheduling
Operating System 10 MULTIPROCESSOR AND REAL-TIME SCHEDULING
CS703 – Advanced Operating Systems
Chapter 10 Multiprocessor and Real-Time Scheduling
CS703 - Advanced Operating Systems
CS703 - Advanced Operating Systems
Uniprocessor Scheduling
Presentation transcript:

Multiprocessor and Real-Time Scheduling Chapter 10

Classifications of Multiprocessor Systems Loosely coupled or distributed multiprocessor, or cluster Each processor has its own memory and I/O channels Functionally specialized processors Such as I/O processor or Graphics Processor Controlled by a master processor Tightly coupled multiprocessing Processors share main memory Controlled by operating system

Independent Parallelism Separate application or job No synchronization among processes Example is time-sharing system Each user has his or her own processor to run their programs. But still sharing main memory and I/O resources with the other users.

Independent Parallelism Able to schedule similar to single processor system. Doesn’t matter which process runs on which processor when. Main concern is processes running on the same processor repeatedly to make use of cache memory.

Coarse and Very Coarse-Grained Parallelism Synchronization among processes at a very gross level The processes rarely have to talk to one another. Example: Grocery shopping by having each person go find one item. Good for concurrent processes running on a multiprogrammed uniprocessor. very little swapping needed Can by supported on a multiprocessor with little change

Medium-Grained Parallelism Single application is a collection of threads. Uniprocessor machine these would be swapped in and out to run. Multi-processor machine we can have each thread running on a separate processor. Threads usually interact frequently A lot more communication issues than previously needed. How often one thread runs may have a strong effect on the other threads of the process. One thread potentially overwhelming the other threads with requests because it is running constantly.

Medium-Grained Parallelism In conflict with the Independent processes in that we need multiple processors at once.

Fine-Grained Parallelism Highly parallel applications Taking a group of instructions and attempting to execute them all at once. Graphics processors utilize this with multiple pipelines to render images quickly. Specialized and fragmented area Translation: Not really discussed in this book.

Scheduling Assignment of processes to processors Use of multiprogramming on individual processors Actual dispatching of a process

Assignment of Processes to Processors Treat processors as a pooled resource and assign process to processors on demand Single queue for all processes Multiple queues are used for priorities All queues feed to the common pool of processors Permanently assign process to a processor Known as group or gang scheduling Dedicate short-term queue for each processor Less overhead Processor could be idle while another processor has a backlog

Assignment of Processes to Processors Global queue Schedule to any available processor Master/slave architecture Key kernel functions always run on a particular processor Master is responsible for scheduling Slave sends service request to the master Disadvantages – (Bottleneck at the Master, Master processor dying kills the system)

Assignment of Processes to Processors Peer architecture Operating system can execute on any processor Each processor does self-scheduling Complicates the operating system Make sure two processors do not choose the same process. No central point to synchronize resources.

Thread Scheduling Executes separate from the rest of the process An application can be a set of threads that cooperate and execute concurrently in the same address space Threads running on separate processors yields a dramatic gain in performance Medium-Grained can also get a big decrease if only on one processor.

Multiprocessor Thread Scheduling Load sharing Processes are not assigned to a particular processor Downside is cache memory not as useful. Maximizing Processor Use Gang scheduling A set of related threads is scheduled to run on a set of processors at the same time. Sucks for processes with only one thread. Maximizing Process Efficiency

Multiprocessor Thread Scheduling Dedicated processor assignment Threads are assigned to a specific processor Makes good use of cache memory Dynamic scheduling Number of threads can be altered during course of execution If process needs fewer/more threads while running.

Multiprocessor Thread Scheduling We can track the resident thread size for a process. How many threads it needs running for smooth communication Medium term scheduler for the processors to move processes in and out.

Load Sharing Load is distributed evenly across the processors No centralized scheduler required Use global queues

Disadvantages of Load Sharing Central queue needs mutual exclusion May be a bottleneck when more than one processor looks for work at the same time Preemptive threads are unlikely resume execution on the same processor Cache use is less efficient If all threads are in the global queue, all threads of a program will not gain access to the processors at the same time

Gang Scheduling Simultaneous scheduling of threads that make up a single process Useful for applications where performance severely degrades when any part of the application is not running Threads often need to synchronize with each other

Scheduling Groups

Dedicated Processor Assignment When application is scheduled, its threads are assigned to a processor Some processors may be idle No multiprogramming of processors

Dynamic Scheduling Number of threads in a process are altered dynamically by the application Operating system adjust the load to improve utilization Assign idle processors New arrivals may be assigned to a processor that is used by a job currently using more than one processor Hold request until processor is available Assign processor a jog in the list that currently has no processors (i.e., to all waiting new arrivals)

Real-Time Systems Correctness of the system depends not only on the logical result of the computation but also on the time at which the results are produced Tasks or processes attempt to control or react to events that take place in the outside world These events occur in “real time” and tasks must be able to keep up with them

Real-Time Systems Control of laboratory experiments Process control in industrial plants Robotics Air traffic control Telecommunications Military command and control systems Your car.

Characteristics of Real-Time Operating Systems Two-Main Types of Real-Time Processes Soft Real-Time Task – Bad to miss, but no the end of the world. Hard Real-Time Task – Certain death or failure if not met.

Characteristics of Real-Time Operating Systems Deterministic Operations are performed at fixed, predetermined times or within predetermined time intervals Concerned with how long the operating system delays before acknowledging an interrupt and there is sufficient capacity to handle all the requests within the required time

Characteristics of Real-Time Operating Systems Responsiveness How long, after acknowledgment, it takes the operating system to service the interrupt Includes amount of time to begin execution of the interrupt Includes the amount of time to perform the interrupt Time to restart after the interrupt Effect of interrupt nesting

Characteristics of Real-Time Operating Systems User control User specifies priority Specify paging What processes must always reside in main memory Disk algorithms to use Rights of processes

Characteristics of Real-Time Operating Systems Reliability Degradation of performance may have catastrophic consequences Fail-soft operation Ability of a system to fail in such a way as to preserve as much capability and data as possible Stability

Features of Real-Time Operating Systems Fast process or thread switch Small size Ability to respond to external interrupts quickly Multitasking with interprocess communication tools such as semaphores, signals, and events

Features of Real-Time Operating Systems Use of special sequential files that can accumulate data at a fast rate Preemptive scheduling base on priority Minimization of intervals during which interrupts are disabled Delay tasks for fixed amount of time Special alarms and timeouts

Real-Time Scheduling Static table-driven Determines at run time when a task begins execution Static priority-driven preemptive Traditional priority-driven scheduler is used Dynamic planning-based Feasibility determined at run time Dynamic best effort No feasibility analysis is performed

Deadline Scheduling Information used Ready time – When the task will be ready to run. We are aware of the task before it is ready to start. Starting deadline – When the task needs to be started. Completion deadline – When the task needs to be completed. Processing time – How long it takes to do the task. We know there is enough time to complete, just need to start it in time. Resource requirements Priority Subtask structure

Deadline Scheduling Real-time applications are not concerned with speed but with completing tasks We know when the process has to complete by even if we don’t know how long it will take. We can assume that the real-time system can complete all its tasks in time.

Rate Monotonic Scheduling Assigns priorities to tasks on the basis of their periods Highest-priority task is the one with the shortest period Still need to ensure that lower-priority tasks don’t get held up too long.

Priority Inversion Can occur in any priority-based preemptive scheduling scheme Occurs when circumstances within the system force a higher priority task to wait for a lower priority task

Unbounded Priority Inversion Duration of a priority inversion depends on unpredictable actions of other unrelated tasks

Priority Inheritance Lower-priority task inherits the priority of any higher priority task pending on a resource they share

Linux Scheduling Scheduling classes SCHED_FIFO: First-in-first-out real-time threads SCHED_RR: Round-robin real-time threads SCHED_OTHER: Other, non-real-time threads Within each class multiple priorities may be used

Non-Real-Time Scheduling Linux 2.6 uses a new scheduler the O(1) scheduler Time to select the appropriate process and assign it to a processor is constant Regardless of the load on the system or number of processors

UNIX SVR4 Scheduling Highest preference to real-time processes Next-highest to kernel-mode processes Lowest preference to other user-mode processes

UNIX SVR4 Scheduling Preemptable static priority scheduler Introduction of a set of 160 priority levels divided into three priority classes Insertion of preemption points

SVR4 Priority Classes

SVR4 Priority Classes Real time (159 – 100) Kernel (99 – 60) Guaranteed to be selected to run before any kernel or time-sharing process Can preempt kernel and user processes Kernel (99 – 60) Guaranteed to be selected to run before any time-sharing process Time-shared (59-0) Lowest-priority

SVR4 Dispatch Queues

Windows Scheduling Priorities organized into two bands or classes Real time Variable Priority-driven preemptive scheduler

End of Slides

Scheduling of a Real-Time Process

Scheduling of a Real-Time Process

Two Tasks

Periodic Task Timing Diagram