Preemptive Scheduling Policies. Round-Robin Scheduling with Time- Slicing (RR)

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

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

Introduction. Scheduling. Types of scheduling. The basics

CPU Scheduling. CPU Scheduling

OPERATING SYSTEMS SCHEDULING

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

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

W4118 Operating Systems. Instructor: Junfeng Yang

Operating Systems Lecture #6: Process Management

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

ICS Principles of Operating Systems

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

Processor Scheduling. Queues Recall OS maintains various queues

CPU Scheduling Outline

Chapter 5 Process Scheduling

Operating Systems. III. Scheduling.

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

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

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

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

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

Operating Systems, 6 th ed. Test Bank Chapter 7

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

Operating System: Scheduling

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

CS414 SP 2007 Assignment 1

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

Syllabus MCA-404 Operating System - II

CPU Scheduling. Core Definitions

Job Scheduling Model

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

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

OS OBJECTIVE QUESTIONS

Operating Systems Concepts: Chapter 7: Scheduling Strategies

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

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

PROCESS SCHEDULING ALGORITHMS: A REVIEW

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

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

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

A Comparative Study of CPU Scheduling Algorithms

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

Linux Process Scheduling Policy

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

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

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

Chapter 2: OS Overview

Processes and Non-Preemptive Scheduling. Otto J. Anshus

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

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

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

Operating System Tutorial

Scheduling Algorithms

Chapter 3. Operating Systems

CS0206 OPERATING SYSTEMS Prerequisite CS0201, CS0203

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

Analysis and Comparison of CPU Scheduling Algorithms

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

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

REAL TIME OPERATING SYSTEMS. Lesson-10:

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

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

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

Predictable response times in event-driven real-time systems

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

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

Operating Systems. Lecture 03. February 11, 2013

Embedded Systems. 6. Real-Time Operating Systems

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.

Components of a Computer System

Tasks Schedule Analysis in RTAI/Linux-GPL

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

Technical Properties. Mobile Operating Systems. Overview Concepts of Mobile. Functions Processes. Lecture 11. Memory Management.

4. Fixed-Priority Scheduling

A Review on Load Balancing In Cloud Computing 1

W4118 Operating Systems. Instructor: Junfeng Yang

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

CPUInheritance Scheduling. UniversityofUtah

CHAPTER 15: Operating Systems: An Overview

Real-Time Scheduling 1 / 39

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

System Virtual Machines

<Insert Picture Here> An Experimental Model to Analyze OpenMP Applications for System Utilization

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

Undergraduate Course Syllabus

Real- Time Scheduling

Overview of the Linux Scheduler Framework

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

Chapter 10: Virtual Memory. Lesson 08: Demand Paging and Page Swapping

Comparison between scheduling algorithms in RTLinux and VxWorks

218 Chapter 5 CPU Scheduling

Completely Fair Scheduler and its tuning 1

Real-Time Operating Systems for MPSoCs

ò Scheduling overview, key trade-offs, etc. ò O(1) scheduler older Linux scheduler ò Today: Completely Fair Scheduler (CFS) new hotness

Chapter 1 8 Essay Question Review

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

Transcription:

Preemptive Scheduling Policies In preemptive scheduling, server can switch to next request before completing current one Preempted request is put back into pending list Its servicing is resumed when it is scheduled again A request may be scheduled many times before it is completed Larger scheduling overhead than with nonpreemptive scheduling Used in multiprogramming and time-sharing OSs 7.1 Round-Robin Scheduling with Time- Slicing (RR) In this example, δ = 1 7.2 1

Example: Variation of Response Time in RR Scheduling At small values of δ, rt for a request may be higher for smaller values of δ 7.3 Least Completed Next (LCN) LCN policy schedules the process that has consumed the least amount of CPU time Issues: - Short processes will finish ahead of long processes - Starves long processes of CPU attention - Neglects existing processes if new processes keep arriving in the system 7.4 2

Shortest Time to Go (STG) STG policy schedules a process whose remaining CPU time requirement is the smallest Since it is analogous to the SRN policy, long processes might face starvation. 7.5 Scheduling in Practice To provide a suitable combination of system performance and user service, OS has to adapt its operation to the nature and number of user requests and availability of resources A single scheduler using a classical scheduling policy cannot address all these issues effectively Modern OSs employ several schedulers Up to three schedulers Some of the schedulers may use a combination of different scheduling policies 7.6 3

Long-, Medium-, and Short-Term Schedulers These schedulers perform the following functions: Long-term: Decides when to admit an arrived process for scheduling, depending on: Nature (whether CPU-bound or I/O-bound) Availability of resources Kernel data structures, swapping space Medium-term: Decides when to swap out a process from memory and when to load it back, so that a sufficient number of ready processes are in memory Short-term: Decides which ready process to service next on the CPU and for how long Also called the process scheduler, or scheduler 7.7 Example: Long, Medium-, and Short- Term Scheduling in a Time-Sharing OS 7.8 4

Scheduling Data Structures and Mechanisms Interrupt servicing routine invokes context save Dispatcher loads two PCB fields - PSW and GPRs - into CPU to resume operation of process 7.9 Priority-Based Scheduling Overhead depends on number of distinct priorities, not on the number of ready processes Can lead to starvation of low-priority processes Aging can be used to overcome this problem process priorities are dynamic Can lead to priority inversion Addressed by using the priority inheritance protocol 7.10 5

Round-Robin Scheduling with Time- Slicing Can be implemented through a single list of PCBs of ready processes List is organized as a queue Scheduler removes first PCB from queue and schedules process described by it If time slice elapses, PCB is put at the end of queue If process starts I/O operation, its PCB is added at end of queue when its I/O operation completes PCB of a ready process moves toward the head of the queue until the process is scheduled 7.11 Multilevel Scheduling Combines priority-based scheduling and round-robin scheduling Scheduler maintains a number of ready queues; a priority and a time slice are associated with each ready queue RR scheduling with time slicing is performed within it High priority queue has a small time slice Good response times for processes Low priority queue has a large time slice Low process switching overhead A process at the head of a queue is scheduled only if the queues for all higher priority levels are empty Scheduling is preemptive 7.12 6

Multilevel Scheduling (continued) Priorities are static Cannot handle a change in the computational or I/O behavior of a process Cannot prevent starvation of processes in low priority levels Cannot employ the priority inheritance protocol to overcome priority inversion 7.13 Multilevel Adaptive Scheduling Also called multilevel feedback scheduling Scheduler varies priority of a process so it receives a time slice consistent with its CPU requirement Scheduler determines correct priority level for a process by observing its recent CPU and I/O usage Moves the process to this level Example: CTSS, a time-sharing OS for the IBM 7094 in the 1960s Eight-level priority structure (0 is highest-priority level) Level n has a time slice of 0.5*2 n CPU seconds If a process completely used up the time slice at its current priority level, it was demoted to the next higher numbered level If a process spent more than a minute in ready state in its current priority level without obtaining any CPU service, it was promoted to the next lower numbered level 7.14 7

Fair Share Scheduling Fair share: fraction of CPU time to be devoted to a group of processes from same user or application Ensures an equitable use of the CPU by processes belonging to different users or different applications Lottery scheduling is a technique for sharing a resource in a probabilistically fair manner Tickets are issued to applications (or users) on the basis of ftheir fair share of fcputi time To allocate a CPU time slice, the scheduler holds a lottery in which only tickets of ready processes participate The process holding the winning ticket is scheduled 7.15 8