Two Level Scheduling. Interactive Scheduling. Our Earlier Example. Round Robin Scheduling. Round Robin Schedule. Round Robin Schedule

Similar documents
Interactive Scheduling

Scheduling Bits & Pieces

Learning Outcomes. Scheduling. Is scheduling important? What is Scheduling? Application Behaviour. Is scheduling important?

Operating Systems. Scheduling

Scheduling. Scheduling. Scheduling. Scheduling Criteria. Priorities. Scheduling

8: Scheduling. Scheduling. Mark Handley

Last Class: Processes

Course Syllabus. Operating Systems

1.1 CPU I/O Burst Cycle

Announcements. Program #1. Program #0. Reading. Is due at 9:00 AM on Thursday. Re-grade requests are due by Monday at 11:59:59 PM.

Lecture Topics. Announcements. Today: Uniprocessor Scheduling (Stallings, chapter ) Next: Advanced Scheduling (Stallings, chapter

Scheduling of processes

Last class: Today: CPU Scheduling. CPU Scheduling Algorithms and Systems

Uniprocessor Scheduling. Chapter 9

Practice Exercises 305

Scheduling in the Supermarket

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

Uniprocessor Scheduling

Example: CPU-bound process that would run for 100 quanta continuously 1, 2, 4, 8, 16, 32, 64 (only 37 required for last run) Needs only 7 swaps

Announcements. Program #1. Reading. Due 2/15 at 5:00 pm. Finish scheduling Process Synchronization: Chapter 6 (8 th Ed) or Chapter 7 (6 th Ed)

Chapter 9. Uniprocessor Scheduling

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems, 3rd edition. Uses content with permission from Assoc. Prof. Florin Fortis, PhD

Scheduling II. Today. Next Time. ! Proportional-share scheduling! Multilevel-feedback queue! Multiprocessor scheduling. !

Ch 4 : CPU scheduling

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

Frequently asked questions from the previous class survey

Operating Systems: Quiz2 December 15, Class: No. Name:

Operating Systems. Lecture Process Scheduling. Golestan University. Hossein Momeni

Properties of Processes

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

Subject Name: OPERATING SYSTEMS. Subject Code: 10EC65. Prepared By: Kala H S and Remya R. Department: ECE. Date:

Chapter 5: CPU Scheduling

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Unix SVR4 (Open Solaris and illumos distributions) CPU Scheduling

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

CSCI-GA Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

CSL373: Lecture 6 CPU Scheduling

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

Processes. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005

CPU Scheduling. Rab Nawaz Jadoon. Assistant Professor DCS. Pakistan. COMSATS, Lahore. Department of Computer Science

Operating System Review Part

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Scheduling. The Basics

Operating System Concepts Ch. 5: Scheduling

Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling

Process Scheduling. Copyright : University of Illinois CS 241 Staff

Chapter 6: CPU Scheduling

Scheduling policy. Reference: ULK3e 7.1. Scheduling in Linux 1 / 20

COSC243 Part 2: Operating Systems

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

CMPS 111 Spring 2003 Midterm Exam May 8, Name: ID:

Operating Systems. Process scheduling. Thomas Ropars.

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

Start of Lecture: February 10, Chapter 6: Scheduling

CS418 Operating Systems

CISC 7310X. C05: CPU Scheduling. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/1/2018 CUNY Brooklyn College

Last Class: CPU Scheduling! Adjusting Priorities in MLFQ!

Scheduling. CSC400 - Operating Systems. 7: Scheduling. J. Sumey. one of the main tasks of an OS. the scheduler / dispatcher

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

CS 326: Operating Systems. CPU Scheduling. Lecture 6

W4118: advanced scheduling

Chapter 9 Uniprocessor Scheduling

Unit 3 : Process Management

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

CSE 120. Summer, Inter-Process Communication (IPC) Day 3. Inter-Process Communication (IPC) Scheduling Deadlock. Instructor: Neil Rhodes

CPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts

Assignment 3 (Due date: Thursday, 10/15/2009, in class) Part One: Provide brief answers to the following Chapter Exercises questions:

CPU Scheduling Algorithms

Chapter 5: CPU Scheduling

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

FCM 710: Architecture of Secure Operating Systems

Multi-Level Feedback Queues

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

CPU Scheduling (1) CPU Scheduling (Topic 3) CPU Scheduling (2) CPU Scheduling (3) Resources fall into two classes:

The different Unix contexts

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Multiprocessor and Real-Time Scheduling. Chapter 10

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Chapter 2 Processes and Threads. Interprocess Communication Race Conditions

But this will not be complete (no book covers 100%) So consider it a rough approximation Last lecture OSPP Sections 3.1 and 4.1

Scheduling II. q q q q. Proportional-share scheduling Multilevel-feedback queue Multiprocessor scheduling Next Time: Memory management

Job Scheduling. CS170 Fall 2018

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

CSCE Operating Systems Scheduling. Qiang Zeng, Ph.D. Fall 2018

SIMULATION-BASED COMPARISON OF SCHEDULING TECHNIQUES IN MULTIPROGRAMMING OPERATING SYSTEMS ON SINGLE AND MULTI-CORE PROCESSORS *

Supplementary Materials on Multilevel Feedback Queue

Chapter 5: CPU Scheduling

CS3733: Operating Systems

Operating Systems ECE344. Ding Yuan

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Process- Concept &Process Scheduling OPERATING SYSTEMS

by Maria Lima Term Paper for Professor Barrymore Warren Mercy College Division of Mathematics and Computer Information Science

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Lecture 14: M/G/1 Queueing System with Priority

LECTURE 3:CPU SCHEDULING

238P: Operating Systems. Lecture 14: Process scheduling

Operating Systems CS 323 Ms. Ines Abbes

Transcription:

Two Level Scheduling Interactive Scheduling Interactive systems commonly employ two-level scheduling CPU scheduler and Memory Scheduler Memory scheduler was covered in VM We will focus on CPU scheduling 1 2 Round Robin Scheduling Each process is given a timeslice to run in When the timeslice expires, the next process preempts the current process, and runs for its timeslice, and so on The preempted process is placed at the end of the queue Implemented with A ready queue A regular timer interrupt 3 Our Earlier 5 Process Process 1 arrives slightly before process 2, etc All are immediately runnable Execution times indicated by scale on x-axis 4 Round Robin Schedule Round Robin Schedule Timeslice = 1 unit Timeslice = 3 units 5 6 1

Round Robin Pros Fair, easy to implement Con Assumes everybody is equal Issue: What should the timeslice be? Too short Waste a lot of time switching between processes : timeslice of 4ms with 1 ms context switch = 20% round robin overhead Too long System is not responsive : timeslice of 100ms If 10 people hit enter key simultaneously, the last guy to run will only see progress after 1 second. Degenerates into FCFS if timeslice longer than burst length 7 Priorities Each Process (or thread) is associated with a priority Provides basic mechanism to influence a scheduler decision: Scheduler will always chooses a thread of higher priority over lower priority Priorities can be defined internally or externally Internal: e.g. I/O bound or CPU bound External: e.g. based on importance to the user 8 5 Jobs Job number equals priority Priority 1 > priority 5 Release and execution times as shown Priority-driven preemptively scheduled 9 10 11 12 2

13 14 15 16 17 18 3

19 20 21 22 23 24 4

25 26 27 28 29 30 5

Priorities Traditional UNIX Scheduler Usually implemented by multiple priority queues, with round robin on each queue Con Low priorities can starve Need to adapt priorities periodically Based on ageing or execution history Two-level scheduler High-level scheduler schedules processes between memory and disk Low-level scheduler is CPU scheduler Based on a multilevel queue structure with round robin at each level 31 32 Traditional UNIX Scheduler Traditional UNIX Scheduler The highest priority (lower number) is scheduled Priorities are re-calculated once per second, and re-inserted in appropriate queue Avoid starvation of low priority threads Penalise CPU-bound threads Priority = CPU_usage +nice +base CPU_usage = number of clock ticks Decays over time to avoid permanently penalising the process Nice is a value given to the process by a user to permanently boost or reduce its priority Reduce priority of background jobs Base is a set of hardwired, negative values used to boost priority of I/O bound system activities Swapper, disk I/O, Character I/O 33 34 Some Issues with Priorities Require adaption over time to avoid starvation (not considering hard real-time which relies on strict priorities). Adaption is: usually ad-hoc, hence behaviour not thoroughly understood, and unpredictable Gradual, hence unresponsive Difficult to guarantee a desired share of the CPU No way for applications to trade CPU time Lottery Scheduling Each process is issued with lottery tickets which represent the right to use/consume a resource : CPU time Access to a resource is via drawing a lottery winner. The more tickets a process possesses, the higher chance the process has of winning. 35 36 6

Lottery Scheduling Advantages Simple to implement Highly responsive can reallocate tickets held for immediate effect Tickets can be traded to implement individual scheduling policy between co-operating threads Starvation free A process holding a ticket will eventually be scheduled. Lottery Scheduling Four process running concurrently Process A: 15% CPU Process B: 25% CPU Process C: 5% CPU Process D: 55% CPU How many tickets should be issued to each? 37 38 Lottery Scheduling Performance Observed performance of two processes with varying ratios of tickets 39 40 Fair-Share Scheduling So far we have treated processes as individuals Assume two users One user has 1 process Second user has 9 processes The second user gets 90% of the CPU Some schedulers consider the owner of the process in determining which process to schedule E.g., for the above example we could schedule the first user s process 9 times more often than the second user s processes Many possibilities exist to determine a fair schedule E.g. Appropriate allocation of tickets in lottery scheduler 41 7