Job Scheduling Model

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

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

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

CPU Scheduling Outline

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

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

W4118 Operating Systems. Instructor: Junfeng Yang

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

OPERATING SYSTEMS SCHEDULING

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

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

ICS Principles of Operating Systems

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

Chapter 5 Process Scheduling

Operating Systems. III. Scheduling.

CPU Scheduling. Core Definitions

CPU Scheduling. CPU Scheduling

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

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

Scheduling Algorithms

Operating Systems Lecture #6: Process Management

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

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

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

Operating Systems Concepts: Chapter 7: Scheduling Strategies

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

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

Operating System: Scheduling

Devices and Device Controllers

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

OS OBJECTIVE QUESTIONS

PROCESS SCHEDULING ALGORITHMS: A REVIEW

Multiprocessor Scheduling and Scheduling in Linux Kernel 2.6

CPU SCHEDULING (CONT D) NESTED SCHEDULING FUNCTIONS

Real-Time Scheduling 1 / 39

A Comparative Study of CPU Scheduling Algorithms

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

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

Analysis and Comparison of CPU Scheduling Algorithms

Processor Scheduling. Queues Recall OS maintains various queues

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

Introduction. Scheduling. Types of scheduling. The basics

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

Operating Systems, 6 th ed. Test Bank Chapter 7

ò Paper reading assigned for next Thursday ò Lab 2 due next Friday ò What is cooperative multitasking? ò What is preemptive multitasking?

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

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

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

CHAPTER 1 INTRODUCTION

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

W4118 Operating Systems. Instructor: Junfeng Yang

Load Balancing Scheduling with Shortest Load First

Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm

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

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

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

A Review on Load Balancing In Cloud Computing 1

Analysis of Job Scheduling Algorithms in Cloud Computing

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

Linux Process Scheduling. sched.c. schedule() scheduler_tick() hooks. try_to_wake_up() ... CFS CPU 0 CPU 1 CPU 2 CPU 3

Operating System Tutorial

Linux Block I/O Scheduling. Aaron Carroll December 22, 2007

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

Real Time Scheduling Basic Concepts. Radek Pelánek

Linux Scheduler. Linux Scheduler

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

Keywords Load balancing, Dispatcher, Distributed Cluster Server, Static Load balancing, Dynamic Load balancing.

Final Report. Cluster Scheduling. Submitted by: Priti Lohani

Syllabus MCA-404 Operating System - II

Lecture 3 Theoretical Foundations of RTOS

Aperiodic Task Scheduling

Tasks Schedule Analysis in RTAI/Linux-GPL

ADAPTIVE LOAD BALANCING ALGORITHM USING MODIFIED RESOURCE ALLOCATION STRATEGIES ON INFRASTRUCTURE AS A SERVICE CLOUD SYSTEMS

4.2: Multimedia File Systems Traditional File Systems. Multimedia File Systems. Multimedia File Systems. Disk Scheduling

Public Cloud Partition Balancing and the Game Theory

Task Scheduling for Multicore Embedded Devices

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

Operating Systems. 05. Threads. Paul Krzyzanowski. Rutgers University. Spring 2015

Load Balancing in Distributed System. Prof. Ananthanarayana V.S. Dept. Of Information Technology N.I.T.K., Surathkal

3. Scheduling issues. Common approaches /1. Common approaches /2. Common approaches / /13 UniPD / T. Vardanega 23/01/2013. Real-Time Systems 1

Statistics Analysis for Cloud Partitioning using Load Balancing Model in Public Cloud

4. Fixed-Priority Scheduling

Comparison between scheduling algorithms in RTLinux and VxWorks

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

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

1. Comments on reviews a. Need to avoid just summarizing web page asks you for:

Understanding Linux on z/vm Steal Time

Completely Fair Scheduler and its tuning 1

Quality of Service su Linux: Passato Presente e Futuro

A Review of Load Balancing Algorithms for Cloud Computing

Various Schemes of Load Balancing in Distributed Systems- A Review

Factors to Describe Job Shop Scheduling Problem

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

Transcription:

Scheduling 1 Job Scheduling Model problem scenario: a set of jobs needs to be executed using a single server, on which only one job at a time may run for theith job, we have an arrival timea i and a run time r i after the ith job has run on the server for total timer i, it finishes and leaves the system a job scheduler decides which job should be running on the server at each point in time let s i (s i a i ) represent the time at which theith job first runs, and let f i represent the time at which theith job finishes the turnaround time of the ith job isf i a i the response time of the ith job iss i a i

Scheduling 2 Basic Non-Preemptive Schedulers: FCFS and SJF FCFS: runs jobs in arrival time order. simple, avoids starvation pre-emptive variant: round-robin SJF: shortest job first - run jobs in increasing order of r i minimizes average turnaround time long jobs may starve pre-emptive variant: SRTF (shortest remaining time first)

Scheduling 3 FCFS Gantt Chart Example J1 J2 J3 J4 0 4 8 12 16 20 time Job J1 J2 J3 J4 arrival (a i ) 0 0 0 5 run time (r i ) 5 8 3 2

Scheduling 4 SJF Example J1 J2 J3 J4 0 4 8 12 16 20 time Job J1 J2 J3 J4 arrival (a i ) 0 0 0 5 run time (r i ) 5 8 3 2

Scheduling 5 Round Robin Example J1 J2 J3 J4 0 4 8 12 16 20 time Job J1 J2 J3 J4 arrival (a i ) 0 0 0 5 run time (r i ) 5 8 3 2

Scheduling 6 SRTF Example J1 J2 J3 J4 0 4 8 12 16 20 time Job J1 J2 J3 J4 arrival (a i ) 0 0 0 5 run time (r i ) 5 8 3 2

Scheduling 7 CPU Scheduling CPU scheduling is job scheduling where: the server is a CPU (or a single core of a multi-core CPU) the jobs are ready threads a thread arrives when it becomes ready, i.e., when it is first created, or when it wakes up from sleep the run-time of the thread is the amount of time that it will run before it either finishes or blocks thread run times are typically not known in advance by the scheduler typical scheduler objectives responsiveness - low response time for some or all threads fair sharing of the CPU efficiency - there is a cost to switching

Scheduling 8 Prioritization CPU schedulers are often expected to consider process or thread priorities priorities may be specified by the application (e.g., Linux setpriority/sched setscheduler) chosen by the scheduler some combination of these two approaches to scheduling with priorites 1. schedule the highest priority thread 2. weighted fair sharing let p i be the priority of theith thread try to give each thread a share of the CPU in proportion to its priority: p i j p j (1)

Scheduling 9 Multi-level Feedback Queues objective: good responsiveness for interactive processes threads of interactive processes block frequently, have short run times idea: gradually diminish priority of threads with long run times and infrequent blocking if a thread blocks before its quantum is used up, raise its priority if a thread uses its entire quantum, lower its priority

Scheduling 10 Multi-level Feedback Queues (Algorithm) scheduler maintains several round-robin ready queues highest priority threads in queue Q 0, lower priority inq 1, still lower inq 2, and so on. scheduler always chooses thread from the lowest non-empty queue threads in queue Q i use quantumq i, andq i q j if i < j newly ready threads go into ready queue Q 0 a level i thread that is preempted goes into queue Q i+1 This basic algorithm may starve threads in lower queues. Various enhancements can avoid this, e.g, periodically migrate all threads intoq 0.

Scheduling 11 3 Level Feedback Queue State Diagram blocked unblock block ready(0) dispatch run(0) preempt block ready(1) dispatch run(1) preempt block ready(2) dispatch run(2) preempt

Scheduling 12 Linux CFQ Scheduler - Key Ideas Completely Fair Queueing - a weighted fair sharing approach suppose that c i is the actual amount of time that the scheduler has allowed the ith thread to run. on an ideally shared processor, we would expect c 0 = c 1 CFQ calls c i thread j p j p i j p j p 0 j p j p 1 = the virtual runtime of theith thread, and tracks it for each CFQ chooses the thread with the lowest virtual runtime, and runs it until some other thread s virtual runtime is lower (subject to a minimum runtime quantum) virtual runtime advances more slowly for higher priority threads, so they get longer time slices all ready threads run regularly, so good responsiveness

Scheduling 13 Scheduling on Multi-Core Processors core core core core core core core core per core ready queue(s) vs. shared ready queue(s)

Scheduling 14 Contention and Scalability Scalability and Cache Affinity access to shared ready queue is a critical section, mutual exclusion needed as number of cores grows, contention for ready queue becomes a problem per core design scales to a larger number of cores CPU cache affinity as thread runs, data it accesses is loaded into CPU cache(s) moving the thread to another core means data must be reloaded into that core s caches as thread runs, it acquires an affinity for one core because of the cached data per core design benefits from affinity by keeping threads on the same core shared queue design does not

Scheduling 15 Load Balancing in per-core design, queues may have different lengths this results in load imbalance across the cores cores may be idle while others are busy threads on lightly loaded cores get more CPU time than threads on heavily loaded cores not an issue in shared queue design per-core designs typically need some mechanism for thread migration to address load imbalances migration means moving threads from heavily loaded cores to lightly loaded cores

Scheduling 16 Disk Head Scheduling goal: reduce seek times by controlling the order in which requests are serviced disk head scheduling may be performed by the controller, by the operating system, or both for disk head scheduling to be effective, there must be a queue of outstanding disk requests (otherwise there is nothing to reorder) an on-line approach is required: the disk request queue is not static

Scheduling 17 FCFS Disk Head Scheduling handle requests in the order in which they arrive fair and simple, but no optimization of seek times 1 50 100 150 200 head 14 37 53 65 70 104 122 130 183 arrival order: 104 183 37 122 14 130 65 70

Scheduling 18 Shortest Seek Time First (SSTF) choose closest request (a greedy approach) seek times are reduced, but requests may starve 1 50 100 150 200 head 14 37 53 65 70 104 122 130 183 arrival order: 104 183 37 122 14 130 65 70

Scheduling 19 Elevator Algorithms (SCAN) Under SCAN, aka the elevator algorithm, the disk head moves in one direction until there are no more requests in front of it, then reverses direction. there are many variations on this idea SCAN reduces seek times (relative to FCFS), while avoiding starvation

Scheduling 20 SCAN Example 1 50 100 150 200 head 14 37 53 65 70 104 122 130 183 arrival order: 104 183 37 122 14 130 65 70