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



Similar documents
Processor Scheduling. Queues Recall OS maintains various queues

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

CPU Scheduling Outline

OPERATING SYSTEMS SCHEDULING

Chapter 5 Process Scheduling

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

ICS Principles of Operating Systems

CPU Scheduling. CPU Scheduling

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

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

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

Operating Systems. III. Scheduling.

CPU Scheduling. Core Definitions

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

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

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

Operating System: Scheduling

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

Operating Systems Lecture #6: Process Management

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

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

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

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

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

Real-Time Scheduling 1 / 39

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

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

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

Operating Systems Concepts: Chapter 7: Scheduling Strategies

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

Operating Systems, 6 th ed. Test Bank Chapter 7

OS OBJECTIVE QUESTIONS

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

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

Scheduling Algorithms

REAL TIME OPERATING SYSTEMS. Lesson-10:

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

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

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

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

Operating System Tutorial

Syllabus MCA-404 Operating System - II

PROCESS SCHEDULING ALGORITHMS: A REVIEW

Introduction. Scheduling. Types of scheduling. The basics

Job Scheduling Model

A Comparative Study of CPU Scheduling Algorithms

CHAPTER 15: Operating Systems: An Overview

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

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

W4118 Operating Systems. Instructor: Junfeng Yang

Chapter 2: OS Overview

A Review on Load Balancing In Cloud Computing 1

Linux Process Scheduling Policy

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

Predictable response times in event-driven real-time systems

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

Final Report. Cluster Scheduling. Submitted by: Priti Lohani

Chapter 1: Introduction. What is an Operating System?

What is best for embedded development? Do most embedded projects still need an RTOS?

Real-Time Operating Systems for MPSoCs

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

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

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

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

Thomas Fahrig Senior Developer Hypervisor Team. Hypervisor Architecture Terminology Goals Basics Details

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

Analysis of Job Scheduling Algorithms in Cloud Computing

CHAPTER 1 INTRODUCTION

Lecture 3 Theoretical Foundations of RTOS

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

Tasks Schedule Analysis in RTAI/Linux-GPL

CS0206 OPERATING SYSTEMS Prerequisite CS0201, CS0203

Real-Time Systems Prof. Dr. Rajib Mall Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Overview and History of Operating Systems

CS414 SP 2007 Assignment 1

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

Weighted Total Mark. Weighted Exam Mark

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

Principles of Operating Systems CS 446/646

Components of a Computer System

Aperiodic Task Scheduling

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

How To Understand And Understand An Operating System In C Programming

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

Real Time Operating System for Embedded DSP Applications

Real- Time Scheduling

Introduction. Application Performance in the QLinux Multimedia Operating System. Solution: QLinux. Introduction. Outline. QLinux Design Principles

Performance Comparison of RTOS

Quality of Service su Linux: Passato Presente e Futuro

Analysis and Comparison of CPU Scheduling Algorithms

Embedded Systems. 6. Real-Time Operating Systems

Real-time KVM from the ground up

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

3 - Introduction to Operating Systems

EECS 750: Advanced Operating Systems. 01/28 /2015 Heechul Yun

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

Operating Systems 4 th Class

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

Transcription:

SFWR ENG 3BB4 Software Design 3 Concurrent System Design 2 SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.8 10 CPU Scheduling Chapter 11 CPU Scheduling Policies Deciding which process to run (Deciding which thread to run) Deciding how long the chosen process can run Important for system throughput Important for system responsiveness SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.2 4 Read: CPU Scheduling Policies Silberschatz: 6 Tanenbaum: 2.5 SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.10 12 CPU Scheduling Opportunities CPU scheduling can occur after each of the following process state transitions: (enter) ready: new process is created running ready: e.g., timer interrupt running waiting: e.g., I/O request or wait interrupt running (exit): process is terminated waiting ready: e.g., I/O or process completion

SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.17 19 Kinds of CPU Scheduling Simple: Scheduling is only done after termination Process runs until its program is completed Cooperative or nonpreemptive: Scheduling is only done after termination and after entering the waiting state Preemptive: Interrupts can be sent to processes for implementing scheduling decisions A running process can be preempted by a process that arrives at the ready queue Implemented by periodic clock interrupts SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.32 34 Round Robin (RR) Standard time-sharing algorithm The ready queue is an ordered circle The next process in the ready queue is allocated to the CPU for a fixed time period T preempted if CPU burst is > T Advantages: Scheduling is fair Waiting time may be long Performance is very sensitive to the size of T SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.23 25 Scheduling Performance Measures CPU utilization: portion of time CPU is busy Throughput: number of processes completed per time unit Turnaround time: average time a process takes to complete Waiting time: average total time a process spends waiting in the ready queue Response time: average time a process takes to respond SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.38 40 First Come, First Served (FCFS) Simple non-preemptive job scheduling policy The ready queue is implemented as a queue and its ordering is used to schedule the processes in the queue Available for real-time thread scheduling Advantage: Easy to implement Waiting time is not minimal No attempt to balance I/O and CPU usages

SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.43 45 Shortest Job First (SJF) Prophetic waiting-time minimization Process with shortest next CPU burst comes first preemptive or non-preemptive Advantages: Given the lengths of the next CPU bursts, easy to implement Waiting time is provably minimal Difficult to predict the length of a CPU burst CPU-intensive processes may have to wait SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.55 57 Multiple Queues There is one queue for each process category (such as the category of system processes) Each queue has is own scheduling algorithm The queues are scheduled as units: Each queue may be assigned a priority Each queue is given a portion of CPU time Processes can be allowed to move between queues Advantage: Flexibility Disadvantage: Hard to implement SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.49 51 Priority Processes are assigned priorities; the process with the highest priority is dispatched first Priority assignment criteria: internal (computational requirements, e.g. SJF), or external (application requirements) Advantages: Easy to implement and flexible Assigning priorities may be difficult Low-priority processes may starve SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.60 62 Multiprocessor Scheduling More complex than uniprocessor scheduling Processes must be scheduled effectively Processors must be kept busy Symmetric multiprocessing: Homogeneous processors schedule themselves Data sharing safety is a major issue: Processes running simultaneously on different processors may access and modify common data structures Asymmetric multiprocessing: One processor handles all system activities including processor scheduling and I/O processing

SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.69 71 Real-Time Scheduling Reduce dispatch latency: preemptible system calls preemption points in long-running system calls preemptible kernel protecting all OS data structures with synchronization mechanisms Priority inversion resolved via priority inheritance Hard Real-Time Scheduling: needs to complete critical tasks within guaranteed time resource reservation predictability of duration of actions needed usually: no virtual memory, no secondary storage special-purpose software running on dedicated hardware Soft Real-Time Scheduling: High priority e.g. for multimedia applications or interactive graphics SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.82 84 CPU Scheduling Policy Examples Section 6.7 of [Silberschatz-Galvin-Gagne-2002]: Solaris 2 Hard real-time dispatch latency with preemption enabled: 2ms Windows 2000 Priority boost for foreground process Linux Credit-based priority system Preemptible kernel still experimental SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.78 80 Algorithm Evaluation Methods Analysis of mathematical models Deterministic modelling using fixed workloads Queuing theory (e.g.: Little s formula: n = λ W with av. queue length n, arrival rate λ, and av. waiting time W) Simulation Hard to get realistic workloads Implementation testing Extremely expensive for experiments Results may be platform dependent SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.92 94 CPU Scheduling Policy Example: Solaris 2 Four scheduling classes: Real time, system, time sharing, interactive Priority based. Priorities within classes are converted into global priorities used for scheduling Real-time class has highest priority guaranteed response within a bounded period of time few real-time processes System class for kernel processes Examples: scheduler, paging daemon, No time slicing system processes run until blocked or preempted by higher-priority processes

SFWR ENG 3BB4 Software Design 3 Concurrent System Design 11.97 99 Solaris 2 Time Sharing Same scheduling policies for time sharing and interactive: Inverse relation between priorities and time slices: The higher the priority, the shorter the time slice Interactive processes, in particular windowing applications, typically have higher priority than CPU-bound processes Good interactive response time, good CPU throughput