Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.

Slides:



Advertisements
Similar presentations
Scheduling Criteria CPU utilization – keep the CPU as busy as possible (from 0% to 100%) Throughput – # of processes that complete their execution per.
Advertisements

CPU Scheduling Tanenbaum Ch 2.4 Silberchatz and Galvin Ch 5.
Topic : Process Management Lecture By: Rupinder Kaur Lecturer IT, SRS Govt. Polytechnic College for Girls,Ludhiana.
CH 5. CPU Scheduling Basic Concepts F CPU Scheduling  context switching u CPU switching for another process u saving old PCB and loading.
Operating Systems Process Scheduling (Ch 3.2, )
CPU Scheduling Questions answered in this lecture: What is scheduling vs. allocation? What is preemptive vs. non-preemptive scheduling? What are FCFS,
SCHEDULING Kshama Desai Bijal Shah Kishore Putta Kashyap Sheth.
CS4315A. Berrached:CMS:UHD1 CPU Scheduling Chapter 7.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 17 Scheduling III.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 16 Scheduling II.
Operating Systems Chapter 6
Chapter 5 CPU Scheduling. CPU Scheduling Topics: Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling.
Scheduling Algorithms
Ceng Operating Systems Chapter 2.2 : Process Scheduling Process concept  Process scheduling Interprocess communication Deadlocks Threads.
CPU Scheduling Algorithms
Day 25 Uniprocessor scheduling. Algorithm: Selection function Selection function – which process among ready processes to select. w – time spent in system,
Chapter 3: CPU Scheduling
Operating Systems (CSCI2413) Lecture 4 Process Scheduling phones off (please)
Uniprocessor Scheduling Chapter 9. Aim of Scheduling The key to multiprogramming is scheduling Scheduling is done to meet the goals of –Response time.
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
Chapter 6: CPU Scheduling
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
Chapter 4 Processor Management
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
More Scheduling cs550 Operating Systems David Monismith.
Fair Resource Access & Allocation  OS Scheduling
Scheduling Strategies Operating Systems Spring 2004 Class #10.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
1 Scheduling The part of the OS that makes the choice of which process to run next is called the scheduler and the algorithm it uses is called the scheduling.
3.1 : Resource Management Part2 :Processor Management.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Chapter 5 Processor Scheduling Introduction Processor (CPU) scheduling is the sharing of the processor(s) among the processes in the ready queue.
1 Uniprocessor Scheduling Chapter 9. 2 Aim of Scheduling Response time Throughput Processor efficiency.
Chapter 5: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 5: CPU Scheduling Basic Concepts Scheduling Criteria.
Uniprocessor Scheduling
Chapter 5: Process Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Basic Concepts Maximum CPU utilization can be obtained.
1 11/29/2015 Chapter 6: CPU Scheduling l Basic Concepts l Scheduling Criteria l Scheduling Algorithms l Multiple-Processor Scheduling l Real-Time Scheduling.
Cpr E 308 Spring 2005 Process Scheduling Basic Question: Which process goes next? Personal Computers –Few processes, interactive, low response time Batch.
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
Uniprocessor Scheduling Chapter 9. Aim of Scheduling Assign processes to be executed by the processor or processors: –Response time –Throughput –Processor.
CSC 322 Operating Systems Concepts Lecture - 10: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
Operating System Concepts and Techniques Lecture 6 Scheduling-2* M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 5: CPU Scheduling.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
1 Uniprocessor Scheduling Chapter 3. 2 Alternating Sequence of CPU And I/O Bursts.
Chapter 4 CPU Scheduling. 2 Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Algorithm Evaluation.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
Process Scheduling. Scheduling Strategies Scheduling strategies can broadly fall into two categories  Co-operative scheduling is where the currently.
Basic Concepts Maximum CPU utilization obtained with multiprogramming
1 Lecture 5: CPU Scheduling Operating System Fall 2006.
Lecture 5 Scheduling. Today CPSC Tyson Kendon Updates Assignment 1 Assignment 2 Concept Review Scheduling Processes Concepts Algorithms.
Lecturer 5: Process Scheduling Process Scheduling  Criteria & Objectives Types of Scheduling  Long term  Medium term  Short term CPU Scheduling Algorithms.
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.
Operating Systems Processes Scheduling.
Chapter 2.2 : Process Scheduling
CPU Scheduling.
Chapter 6: CPU Scheduling
CPU Scheduling G.Anuradha
Chapter 6: CPU Scheduling
Chapter 5: CPU Scheduling
Operating System Concepts
Chapter5: CPU Scheduling
TDC 311 Process Scheduling.
Outline Scheduling algorithms Multi-processor scheduling
Shortest-Job-First (SJR) Scheduling
Presentation transcript:

Operating System Concepts and Techniques Lecture 5 Scheduling-1 M. Naghibzadeh Reference M. Naghibzadeh, Operating System Concepts and Techniques, First ed., iUniverse Inc., To order: or

2 Terms Scheduling policy describes the guideline for selecting the next process to use a computer resource such as CPU. Scheduling algorithm is a finite set of clearly stated unambiguous stepwise operations that when applied to a finite set of processes waiting to use a resource, either one or more of these processes are selected or a time table for the resource usage is produced Scheduling mechanism determines how to do every step of the scheduling algorithm For example, the exact steps to be taken to modify a process-queue and process state

Scheduling Criteria Properties which influence the order in which active entities are selected to run request Time Processing Time Priority  Static priority  dynamic priority Deadline Wait Time Preemptability 3

Scheduling Objectives Throughput Deadline hard real-time soft real-time Turnaround Time Average turnaround time Normalized Response Time Priority Processor Utilization System Balance Fairness 4

Scheduling levels High-Level: select requests Medium-level: decide on process swapping Low-level: decide on giving CPU time to ready processes Input/output scheduling: decide on disk read/write order 5

First-Come-First-Served (FCFS) FCFS: take the request which arrived earliest Nonpreemptive Most natural, link banks, airport check-ins, post offices, and barber shops Irregularity in arrival requires a queue Simple to implement  A single-linked list with two pointers; each link points from each node to the node of the previous request Ddisadvantages: a long request can increase others wait time 6

Shortest Job Next (SJN) SJN (SPN): take the request which needs the least execution time Non-preemptive Executes higher number of requests in one unit of time To implement, a double-linked list with two pointers; keeps requests ordered Disadvantages: need to know execution time, update overhead time of the list, and starvation 7

SRTN & HRRN Shortest Remaining Time Next (SRTN) Nonpreemptive Scheduling decision right after a process is completed Disadvantages similar to SPN Highest Response Rattio Next (HRRN) RR=(w+e)/e; it increases as w increases Nonpreemptive Scheduling decision right after a process is completed Disadvantages similar to SPN 8

Two more Fair-Share Scheduling All users get equal shares of CPU  Prevents a user to get a big chunk of CPU time by creating many child processes or threads Priority scheduling Processes have priorities; A higher priority is executed before a lower priority one Preemptive Disadvantage: starvation of low priority request 9

Round Robin (RR) The most widely used scheduling policy  A time quantum is defined and an interval timer is set to send an interrupt whenever the time quantum has passed, since the timer is set or reset  Time quantum (slice) is very small, one millisecond or less  Upon timer interrupt a process switching is done  If a process cannot use its slice, processor switches to the next process and resets timer  All (same priority) processes share CPU time 10

RR advantages/disadvantages Advantages:  Quick response to interactive requests  Longer waiting time for a process that requires longer CPU time  Possibility of defining many priority levels, Disadvantage:  Task switching overhead 11

Process Scheduling in Linux Many levels of priorities (100 or more) Three schedulers SCHED_FIFO: Nonpreemptive, highest priority, say from , for different processes. SCHED_RR: Preemptive, second highest priority, say from Same level highest priority RR processes are scheduled using round robin  Priorities are assigned so that any SCHED_FIFO process has higher priority than any SCHED_RR; any SCHED_RR has higher priority than any SCHED_OTHER 12

Process Scheduling in Linux… SCHED_OTHER Every process has a static priority Time is divided into variable size frames called epoch At start of every epoch, scheduler calculates every SCHED_OTHER process’ CPU share in integer number of scheduling-clock ticks; called credit, epoch length is calculated Credit is related to static priority Epoch length is related to how many processes are ready, what their priorities are etc. 13

SCHED_OTHER... If a process cannot use its credit it is saved for the next time (see details in the book) Goodness shows which process is executed next For SCHED_FIFO and SCHED_RR, goodness=priority+1000 For SCHED_OTHER, goodness=credit 14

Summary It is not always the case that every service request arrives after the previous service request has been completely served. Service requests may pile up, in which case we would like to serve requests in such an order so as to increase some metrics. This process is called scheduling. Scheduling methodologies and algorithms for single-processor systems are considered Many scheduling strategies are studied, FCFS, SJN, SRTN, HRRN, and RR The Linux operating system was selected to present real- world schedulers 15

16 Find out What an interactive process is The block structure of an interval timer The time slice of your computer’s processor Whether Linux scheduler is a complete one for real-time tasks Why epoch length is not fixed The goals of Linux schedulers The difference between SCHED_FIFO and SCHED_RR

17 Any questions?