CPU Scheduling David Ferry CSCI 3500 – Operating Systems

Slides:



Advertisements
Similar presentations
Operating System CS105. Objectives Role of an operating system Manages resources – Memory – CPU – Secondary storage – I/O devices Memory CPU Hard Disk.
Advertisements

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
Operating Systems 1 K. Salah Module 2.1: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance Evaluation.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Operating Systems (CSCI2413) Lecture 4 Process Scheduling phones off (please)
Cs238 CPU Scheduling Dr. Alan R. Davis. CPU Scheduling The objective of multiprogramming is to have some process running at all times, to maximize CPU.
5: CPU-Scheduling1 Jerry Breecher OPERATING SYSTEMS SCHEDULING.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
Threads & Scheduling What are threads?
 Scheduling  Linux Scheduling  Linux Scheduling Policy  Classification Of Processes In Linux  Linux Scheduling Classes  Process States In Linux.
Recall … Process states –scheduler transitions (red) Challenges: –Which process should run? –When should processes be preempted? –When are scheduling decisions.
CPU Scheduling Chapter 6 Chapter 6.
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.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Scheduler What is the job of.
Chapter 4 Processor Management
OPERATING SYSTEMS CPU SCHEDULING.  Introduction to CPU scheduling Introduction to CPU scheduling  Dispatcher Dispatcher  Terms used in CPU scheduling.
Chapter 6 CPU SCHEDULING.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
1 CSE451 Scheduling Autumn 2002 Gary Kimura Lecture #6 October 11, 2002.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
2.5 Scheduling. Given a multiprogramming system, there are many times when more than 1 process is waiting for the CPU (in the ready queue). Given a multiprogramming.
6.1 CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
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.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
CPU Scheduling CS Introduction to Operating Systems.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
Chapter 7 Scheduling Chien-Chung Shen CIS/UD
Scheduling.
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.
Scheduling of Non-Real-Time Tasks in Linux (SCHED_NORMAL/SCHED_OTHER)
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Sujata Ray Dey Maheshtala College Computer Science Department
Networks and Operating Systems: Exercise Session 2
CPU Scheduling Chapter 5.
Chapter 2 Scheduling.
Questions (True = A, False = B)
Chapter 6: CPU Scheduling
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
3: CPU Scheduling Basic Concepts Scheduling Criteria
Operating systems Process scheduling.
Chapter 6: CPU Scheduling
CPU SCHEDULING.
CPU scheduling decisions may take place when a process:
Sujata Ray Dey Maheshtala College Computer Science Department
CSE 451: Operating Systems Winter 2003 Lecture 6 Scheduling
Scheduling of Regular Tasks in Linux
Processes David Ferry CSCI 3500 – Operating Systems
Processor Scheduling Hank Levy 1.
Scheduling.
Shortest-Job-First (SJR) Scheduling
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Concurrency and Threading: CPU Scheduling
Module 5: CPU Scheduling
Chapter 6: Scheduling Algorithms Dr. Amjad Ali
Chapter 6: CPU Scheduling
Module 5: CPU Scheduling
CSE 451: Operating Systems Winter 2001 Lecture 6 Scheduling
Scheduling of Regular Tasks in Linux
CPU Scheduling David Ferry CSCI 3500 – Operating Systems
Presentation transcript:

CPU Scheduling David Ferry CSCI 3500 – Operating Systems Saint Louis University St. Louis, MO 63103

Recall Multiprogramming CPU time is shared by rapidly switching between processes with context switching: Each time a context switch occurs the OS scheduler runs picks what process gets to run next. When picked, a process gets to run for one scheduling quantum, commonly 1ms. Process A Process B Process C … CSCI 3500 - Operating Systems

The Scheduling Question Blocked Ready Scheduler swaps off Scheduled onto processor Running Given a collection of programs that are ready to run, how do we pick a winner? CSCI 3500 - Operating Systems

Scheduling Considerations Scheduling is an old field with a lot of alternatives. Some possible metrics: Resource fairness – ensure all processes get equal 1/N processor time. Perceived fairness – Perfect resource fairness might not yield desirable performance, so we prioritize some processes. CSCI 3500 - Operating Systems

Scheduling Considerations Response time – Minimize the amount of time it takes a program to respond to events such as key presses. Job completion – Maximize the number of processes retired from the system. No starvation – Make sure that all processes get to run eventually. CSCI 3500 - Operating Systems

Implementation Considerations The scheduler is perhaps the most performance-critical piece of code on the planet. Typically runs 1000 times per second on a desktop machine. If we have 30 computers in this classroom, that’s running at least 30,000 per second. The scheduler is entirely overhead- it only serves to manage the system, but is not an end in itself. CSCI 3500 - Operating Systems

Two Program Archetypes Compute-bound: Spends most of its time churning through instructions with the processor. Limited interaction between program and user, or program and other devices. E.g. simulation, video encoding, video decoding I/O Bound: Spends most of its time waiting for user or other device such as hard drive. Bursty workload behavior. E.g. text editor, web browser CSCI 3500 - Operating Systems

CSCI 3500 - Operating Systems Types of Systems Batch systems: Important that they run efficiently, but nobody is waiting Characterized by large computationally intensive workloads that take hours or days Tend to be compute-bound tasks Interactive systems: Must respond promptly to user input Heterogenous workloads: text editor, compiler, watch video, play a game, listen to music, maybe all simultaneously… Mixed I/O bound and compute-bound tasks CSCI 3500 - Operating Systems

Batch Scheduling Algorithms FIFO – first in, first out – executes programs in the order they are created in the system. Does not do multiprocessing. SJF – shortest job first – executes programs in order of shortest to longest. Does not do multiprocessing. Needs an estimate of process length, but this might be as simple as looking at program name. E.g. “ls” will probably always be quick. CSCI 3500 - Operating Systems

Interactive Scheduling Algorithms Round-Robin – Go through all processes in some arbitrary order, giving each a single quantum of processor time. CSCI 3500 - Operating Systems