Introduction. Scheduling. Types of scheduling. The basics



Similar documents
CPU Scheduling. Basic Concepts. Basic Concepts (2) Basic Concepts Scheduling Criteria Scheduling Algorithms Batch systems Interactive systems

OPERATING SYSTEMS SCHEDULING

/ Operating Systems I. Process Scheduling. Warren R. Carithers Rob Duncan

W4118 Operating Systems. Instructor: Junfeng Yang

Objectives. Chapter 5: CPU Scheduling. CPU Scheduler. Non-preemptive and preemptive. Dispatcher. Alternating Sequence of CPU And I/O Bursts

CPU Scheduling. CPU Scheduling

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

Announcements. Basic Concepts. Histogram of Typical CPU- Burst Times. Dispatcher. CPU Scheduler. Burst Cycle. Reading

CPU Scheduling Outline

Chapter 5 Process Scheduling

Operating Systems Lecture #6: Process Management

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Operating Systems. III. Scheduling.

ICS Principles of Operating Systems

Objectives. Chapter 5: Process Scheduling. Chapter 5: Process Scheduling. 5.1 Basic Concepts. To introduce CPU scheduling

Scheduling 0 : Levels. High level scheduling: Medium level scheduling: Low level scheduling

Operating Systems, 6 th ed. Test Bank Chapter 7

Process Scheduling CS 241. February 24, Copyright University of Illinois CS 241 Staff

A Comparative Study of CPU Scheduling Algorithms

Scheduling. Yücel Saygın. These slides are based on your text book and on the slides prepared by Andrew S. Tanenbaum

PROCESS SCHEDULING ALGORITHMS: A REVIEW

Road Map. Scheduling. Types of Scheduling. Scheduling. CPU Scheduling. Job Scheduling. Dickinson College Computer Science 354 Spring 2010.

Analysis and Comparison of CPU Scheduling Algorithms

Process Scheduling. Process Scheduler. Chapter 7. Context Switch. Scheduler. Selection Strategies

OS OBJECTIVE QUESTIONS

Operating Systems Concepts: Chapter 7: Scheduling Strategies

Processor Scheduling. Queues Recall OS maintains various queues

2. is the number of processes that are completed per time unit. A) CPU utilization B) Response time C) Turnaround time D) Throughput

Operating System: Scheduling

Linux Process Scheduling Policy

Main Points. Scheduling policy: what to do next, when there are multiple threads ready to run. Definitions. Uniprocessor policies

Deciding which process to run. (Deciding which thread to run) Deciding how long the chosen process can run

CPU Scheduling. Multitasking operating systems come in two flavours: cooperative multitasking and preemptive multitasking.

Chapter 5: CPU Scheduling. Operating System Concepts 8 th Edition

CPU Scheduling. Core Definitions

REDUCING TIME: SCHEDULING JOB. Nisha Yadav, Nikita Chhillar, Neha jaiswal

Scheduling Algorithms

Scheduling. Scheduling. Scheduling levels. Decision to switch the running process can take place under the following circumstances:

Syllabus MCA-404 Operating System - II

CPU Scheduling 101. The CPU scheduler makes a sequence of moves that determines the interleaving of threads.

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Job Scheduling Model

CPU Scheduling. CSC 256/456 - Operating Systems Fall TA: Mohammad Hedayati

Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

A Group based Time Quantum Round Robin Algorithm using Min-Max Spread Measure

Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

Readings for this topic: Silberschatz/Galvin/Gagne Chapter 5

W4118 Operating Systems. Instructor: Junfeng Yang

Konzepte von Betriebssystem-Komponenten. Linux Scheduler. Valderine Kom Kenmegne Proseminar KVBK Linux Scheduler Valderine Kom

REAL TIME OPERATING SYSTEMS. Lesson-10:

CS Fall 2008 Homework 2 Solution Due September 23, 11:59PM

4. Fixed-Priority Scheduling

A Review on Load Balancing In Cloud Computing 1

Analysis of Job Scheduling Algorithms in Cloud Computing

Lecture 3 Theoretical Foundations of RTOS

Final Report. Cluster Scheduling. Submitted by: Priti Lohani

Operatin g Systems: Internals and Design Principle s. Chapter 10 Multiprocessor and Real-Time Scheduling Seventh Edition By William Stallings

Comparison between scheduling algorithms in RTLinux and VxWorks

CS414 SP 2007 Assignment 1

Linux Block I/O Scheduling. Aaron Carroll December 22, 2007

A Priority based Round Robin CPU Scheduling Algorithm for Real Time Systems

Real-Time Scheduling (Part 1) (Working Draft) Real-Time System Example

Module 8. Industrial Embedded and Communication Systems. Version 2 EE IIT, Kharagpur 1

A LECTURE NOTE ON CSC 322 OPERATING SYSTEM I DR. S. A. SODIYA

Convenience: An OS makes a computer more convenient to use. Efficiency: An OS allows the computer system resources to be used in an efficient manner.

Operating System Tutorial

OPERATING SYSTEM - VIRTUAL MEMORY

Real-Time Scheduling 1 / 39

Windows Server Performance Monitoring

Load Balancing Scheduling with Shortest Load First

Performance Comparison of RTOS

Scheduling policy. ULK3e 7.1. Operating Systems: Scheduling in Linux p. 1

Operating System Aspects. Real-Time Systems. Resource Management Tasks

This tutorial will take you through step by step approach while learning Operating System concepts.

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Types Of Operating Systems

Chapter 19: Real-Time Systems. Overview of Real-Time Systems. Objectives. System Characteristics. Features of Real-Time Systems

Efficient Scheduling Of On-line Services in Cloud Computing Based on Task Migration

3. Scheduling issues. Common approaches /1. Common approaches /2. Common approaches / /13 UniPD / T. Vardanega 23/01/2013. Real-Time Systems 1

The International Journal Of Science & Technoledge (ISSN X)

LAB 5: Scheduling Algorithms for Embedded Systems

Efficiency of Batch Operating Systems

Linux scheduler history. We will be talking about the O(1) scheduler

Load Balancing in Distributed System Using FCFS Algorithm with RBAC Concept and Priority Scheduling

ò Paper reading assigned for next Thursday ò Lab 2 due next Friday ò What is cooperative multitasking? ò What is preemptive multitasking?

Quality of Service versus Fairness. Inelastic Applications. QoS Analogy: Surface Mail. How to Provide QoS?

Chapter 2: OS Overview

Linux O(1) CPU Scheduler. Amit Gud amit (dot) gud (at) veritas (dot) com

Survey on Job Schedulers in Hadoop Cluster

Efficient Parallel Processing on Public Cloud Servers Using Load Balancing

Embedded Systems. 6. Real-Time Operating Systems

Real-Time Software. Basic Scheduling and Response-Time Analysis. René Rydhof Hansen. 21. september 2010

Predictable response times in event-driven real-time systems

Transcription:

Introduction In multiprogramming systems, when there is more than one runable (i.e., ready), the operating system must decide which one to activate. The decision is made by the part of the operating system called the scheduler, using a scheduling algorithm. In the beginning there was no need for scheduling, since the users of computers lined up in front of the computer room or gave their job to an operator. atch ing the jobs were executed in first come first served manner. Multiprogramming life became complicated! The scheduler is concerned with deciding policy, not providing a mechanism. The basics Types of scheduling refers to a set of policies and mechanisms to control the order of work to be performed by a computer system. Of all the resources in a computer system that are scheduled before use, the PU is by far the most important. Multiprogramming is the (efficient) scheduling of the PU. The basic idea is to keep the PU busy as much as possible by executing a (user) until it must wait for an event, and then switch to another. Processes alternate between consuming PU cycles (PU-burst) and performing I/O (I/O-burst). In general, (job) scheduling is performed in three stages: short-, medium-, and long-term. The activity frequency of these stages are implied by their names. Long-term (job) scheduling is done when a new is created. It initiates es and so controls the degree of multi-programming (number of es in memory). Medium-term scheduling involves suspending or resuming es by swapping (rolling) them out of or into memory. Short-term ( or PU) scheduling occurs most frequently and decides which to execute next. 2 3

Life cycle of a typical Long- & medium-term scheduling Long Term arrives active Short Term blocked Medium Term swapped cting as the primary resource allocator, the longterm scheduler admits more jobs when the resource utilization is low, and blocks the incoming jobs from entering the ready queue when utilization is too high. When the main memory becomes over-committed, the medium-term scheduler releases the memory of a suspended (blocked or stopped) by swapping (rolling) it out. In summary, both schedulers control the level of multiprogramming and avoid (as much as possible) overloading the system by many es and cause thrashing (more on this later). exits 4 Short-term scheduling Short-term scheduler, also known as the or PU scheduler, controls the PU sharing among the ready es. The selection of a to execute next is done by the short-term scheduler. Usually, a new is selected under the following circumstances: When a must wait for an event. When an event occurs (e.g., I/O completed, quantum expired). When a terminates. Short-term scheduling criteria The goal of short-term scheduling is to optimize the system performance, and yet provide responsive service. In order to achieve this goal, the following set of criteria is used: PU utilization I/O device throughput Total service Responsiveness Fairness eadlines 6 7

Scheduler design typical scheduler is designed to select one or more primary performance criteria and rank them in order of importance. One problem in selecting a set of performance criteria is that they often conflict with each other. For example, increased or utilization is usually achieved by increasing the number of active es, but then response deteriorates. So, the design of a scheduler usually involves a careful balance of all requirements and constraints. The following is only a small subset of possible characteristics: I/O throughput, PU utilization, response (batch or interactive), urgency of fast response, priority, maximum allowed, total required. policies In general, scheduling policies may be preemptive or non-preemptive. In a non-preemptive pure multiprogramming system, the short-term scheduler lets the current run until it blocks, waiting for an event or a resource, or it terminates. Preemptive policies, on the other hand, force the currently active to release the PU on certain events, such as a clock interrupt, some I/O interrupts, or a system call. 8 9 algorithms The following are some common scheduling algorithms: Non-preemptive First-ome-First-Served (FFS) Shortest Job first (SJF) Good for background batch jobs. Preemptive Round-Robin (RR) Priority Good for foreground interactive jobs. First-ome-First-Served (FFS) FFS, also known as First-In-First-Out (FIFO), is the simplest scheduling policy. rriving jobs are inserted into the tail (rear) of the ready queue and the to be executed next is removed from the head (front) of the queue. FFS performs better for long jobs. Relative importance of jobs measured only by arrival (poor choice). long PU-bound job may hog the PU and may force shorter (or I/O-bound) jobs to wait prolonged periods. This in turn may lead to a lengthy queue of ready jobs, and thence to the convoy effect. 0

n example FFS Shortest Job First (SJF) 0 service turnaround waiting t s t t t w 0 0 0 0 3 4 4 8 4 VERGE 3.2 8.7 t t /t w =. t t /t s =.29 SJF policy selects the job with the shortest (expected) ing first. Shorter jobs are always executed before long jobs. One major difficulty with SJF is the need to know or estimate the ing of each job (can only predict the future!) 3 lso, long running jobs may starve, because the PU has a steady supply of short jobs. 4 0 2 3 n example SJF Round-Robin (RR) 3 4 0 service turnaround waiting t s t t t w 0 8 8 0 3 4 4 8 4 VERGE 7.7 3.2 t t /t w = 2.38 t t /t s =.3 RR reduces the penalty that short jobs suffer with FFS by preempting running jobs periodically. The PU suspends the current job when the reserved quantum (-slice) is exhausted. The job is then put at the end of the ready queue if not yet completed. The critical issue with the RR policy is the length of the quantum. If it is too short, then the PU will be spending more on context switching. Otherwise, interactive es will suffer. 0 4

n example RR Priority-based Quantum = service turnaround waiting t s t t t w 0 8 8 2 3 9 6 4 2 8 Each is assigned a priority. The ready list contains an entry for each ordered by its priority. The at the beginning of the list (highest priority) is picked first. 6 VERGE 0.2.7 t t /t w =.78 t t /t s = 2.4 variation of this scheme allows preemption of the current when a higher priority arrives. 0 nother variation of the policy adds an aging scheme, where the priority of a increases as it remains in the ready queue; hence, will eventually execute to completion. 6 7 n example Priority omparison of scheduling policies priority service turnaround waiting t s t t t w 4 0 8 8 3 8 7 2 3 7 4 4 4 0 Unfortunately, the performance of scheduling policies vary substantially depending on the characteristics of the jobs entering the system (job mix), thus it is not practical to make definitive comparisons. 4 3 0 0 VERGE 9.2 4.7 t t /t w =.98 t t /t s = 3.28 For example, FFS performs better for long es and tends to favor PU-bound jobs. Whereas SJF is risky, since long es may suffer from PU starvation. Furthermore, FFS is not suitable for interactive jobs, and similarly, RR is not suitable for long batch jobs. The (ing) overhead of FFS is negligible, but it is moderate in RR and can be high for SJF. 8 9

Other policies s discussed earlier, the previous policies cannot efficiently handle a mixed collection of jobs (e.g., batch, interactive, and PU-bound). So, other schemes were developed: Multi-level queue scheduling Multi-level feedback queue scheduling Multi-level queue Multi-Level Queue (MLQ) scheme solves the mix job problem by maintaining separate ready queues for each type of job class and apply different scheduling algorithms to each. highest priority job classes system es priority-based primary PU scheduling interactive es Round-Robin PU lowest priority background es FFS 20 2 Multi-level feedback queue Real- computing This is a variation of MLQ, where es (jobs) are not permanently assigned to a queue when they enter the system. In this approach, if a exhausts its quantum (i.e., it is PU-bound), it is moved to another queue with a longer quantum and a lower priority. The last level usually uses FFS algorithm in this scheme. Quantum = 2 Quantum = 8 FFS primary PU scheduling PU real- (R-T) system controls or monitors external events that have their own timing requirements, thus a R-T operating system should be tailored to respond to these activities. Examples of R- T applications include control of laboratory experiments, control, robotics, video games, and telecommunications. n OS designed to support batch, interactive, or -sharing is different from that for a R-T. One basic difference is the way external events are handled. 22 23

Real- tasks (usually referred to as a task in R-T systems) that controls or reacts to an event in a R-T system is associated with a deadline specifying either a start or a completion. epending on its deadline, a can be classified as one of the following: Hard real- must meet the deadlines (-critical). Soft real- meeting a deadline is desirable (better performance). Multior scheduling thread scheduling load sharing/balancing gang scheduling dedicated or assignment dynamic scheduling 24 2